ID:156841
 
So... how would you do it? I mean I want to make cutscenes in a game and I'd like to how to do it.
i assume phasing.
In response to EnigmaticGallivanter
Phasing? O.O
In response to Ganing
You could also use a made video as the cutscreen but that just stupid I'd use icons on a top layer but that uses too much space so you could make on the map spots that are used for the cutscreen copy it the best you can in a diffrent space on the map that is not being used code it to start when you get there then after the set time is up, then the player is taken back to the preise location if it is a single player game if it is a multi player then what is the cutscreen for inless your going for a diablo style game then good for you otherwise when player starts the cutscreen other players could kill them.
In response to TheDarque
That is if you even coded some of the games you have and not ripped them. If you did code why ask?
In response to TheDarque
I asked because most of the expert and more experienced programmers are here in these forums. I had already a plan for cutscenes in my head, but I wanted to see what other people would say. Also this is the Developer How-To section, you're supposed to ask things like this here.
There's a demo or a library somewhere on BYOND that shows you how to, though I don't know who it's by, so I can't guarantee it works good.
In response to Jeff8500
There is one made by Choka/Jamkell or whatever his other account is. But I really don't like that kid.
In response to Ganing
There's another one, it might've been made by Iain Peregrine or some other reputable developer, but I'm not sure.
Some notes on the way that I do it:

I use images placed on top of mobs (not invisible mobs, but mobs that don't have icon_states set).

var/mob/Actor/M = new/mob/Actor/(location)
var/image/I = image(icon,M,icon_state,MOB_LAYER+1)


This way the 'Actors' are only visible to players that I choose to show the image to. Ex:

for(var/mob/Player/P in movie_list)
P << I


When a player triggers a cutscene a datum is created to run it. Anyone in the datum's movie_list sees everything as it happens. I have various pre-built procs that make directing a cutscene really easy. Ex: procs that move a specific Actor one step in a direction, procs that trigger music/sfx, procs that teleport the viewers to another location to change the setting, etc.

Creating cutscenes is easy if you take the time to make those type of procs that do everything for you with minimal input. Here's an example of the opening cut scene from NEStalgia, followed by the actual code that directs that cutscene:


http://www.youtube.com/watch?v=Z3zTWQuHPbE (The scene starts 28 seconds in)


datum/movie/proc/Q_BEGINNING_MOVIE()

src.MOVIE_MUSIC("Cave")

src.MOVIE_MOB_CREATE(locate(src.x,src.y+8,src.z),'Movie.dmi',"Wizard","Wizard","Down")
sleep(10)
src.MOVIE_MOB_STEP("Down","Wizard")
sleep(5)
src.MOVIE_MOB_CREATE(locate(src.x-1,src.y+8,src.z),'Movie.dmi',"Balzackian","Guard1","Down")
src.MOVIE_MOB_CREATE(locate(src.x+1,src.y+8,src.z),'Movie.dmi',"Balzackian","Guard2","Down")
sleep(5)
src.MOVIE_MOB_STEP("Down","Wizard")
src.MOVIE_MOB_STEP("Down","Guard1")
src.MOVIE_MOB_STEP("Down","Guard2")
sleep(10)
src.MOVIE_MOB_STEP("Down","Wizard")
src.MOVIE_MOB_STEP("Down","Guard1")
src.MOVIE_MOB_STEP("Down","Guard2")
sleep(10)
src.MOVIE_MOB_STEP("Down","Wizard")
src.MOVIE_MOB_STEP("Down","Guard1")
src.MOVIE_MOB_STEP("Down","Guard2")
sleep(10)
src.MOVIE_DIALOGUE("Text1","First Wizard Roen")//"Halt! This is the source of the disturbance... "
sleep(40)
src.MOVIE_CLOSE_BOX()
src.MOVIE_MOB_STEP("Down","Guard2")
sleep(10)
src.MOVIE_DIALOGUE("Text2","Guard")//"I don't see anything. "
sleep(35)
src.MOVIE_CLOSE_BOX()
sleep(5)
src.MOVIE_SFX("Fire")
src.MOVIE_MOB_CREATE(locate(src.x-1,src.y,src.z),'Movie.dmi',"Orb","Effect1","Down")
sleep(10)
src.MOVIE_SFX("Fire")
src.MOVIE_MOB_CREATE(locate(src.x,src.y+1,src.z),'Movie.dmi',"Orb","Effect2","Down")
sleep(10)
src.MOVIE_SFX("Fire")
src.MOVIE_MOB_CREATE(locate(src.x+1,src.y,src.z),'Movie.dmi',"Orb","Effect3","Down")
sleep(10)
src.MOVIE_SFX("Fire")
src.MOVIE_MOB_CREATE(locate(src.x,src.y-1,src.z),'Movie.dmi',"Orb","Effect4","Down")
sleep(10)
src.MOVIE_MOB_STEP("Down","Wizard")
sleep(10)
src.MOVIE_DIALOGUE("Text3","First Wizard Roen")//"Amazing! I've never witnessed such a phenomenon!. "
sleep(35)
src.MOVIE_CLOSE_BOX()
src.MOVIE_MOB_STEP("Down","Guard1")
sleep(10)
src.MOVIE_DIALOGUE("Text4","Guard")//"Um, sir, that looks kind of dangerous... "
sleep(35)
src.MOVIE_CLOSE_BOX()
src.MOVIE_MOB_DIR("Up","Wizard")
sleep(10)
src.MOVIE_DIALOGUE("Text5","First Wizard Roen")//"Does it look like I need advice from a lowly guard? Balzackian soldiers should be seen and not heard! "
sleep(65)
src.MOVIE_CLOSE_BOX()
sleep(10)
src.MOVIE_MOB_STEP("Down","Wizard")
sleep(10)
src.MOVIE_SFX("Magic")
src.SCREEN_FLASH("Purple",src.movie_list)
sleep(5)
src.MOVIE_SFX("Critical")
src.MOVIE_MOB_DEL("Wizard")
src.MOVIE_MOB_CREATE(locate(src.x,src.y+2,src.z),'Movie.dmi',"Fire","Fire1","Down")
sleep(10)
src.MOVIE_DIALOGUE("Text6","Guards")//"Ahhhhhh!!! "
sleep(20)
src.MOVIE_CLOSE_BOX()
sleep(5)
src.MOVIE_MOB_STEP("Up","Guard1")
src.MOVIE_MOB_STEP("Up","Guard2")
sleep(5)
src.MOVIE_MOB_STEP("Up","Guard1")
src.MOVIE_MOB_STEP("Up","Guard2")
sleep(5)
src.MOVIE_MOB_STEP("Up","Guard1")
src.MOVIE_MOB_STEP("Up","Guard2")
sleep(5)
src.MOVIE_MOB_STEP("Up","Guard1")
src.MOVIE_MOB_STEP("Up","Guard2")
sleep(5)
src.MOVIE_MOB_DEL("Fire1")
sleep(5)
src.MOVIE_SFX("Magic")
src.SCREEN_FLASH("Purple",src.movie_list)
sleep(5)
src.MOVIE_MOB_STEP("Right","Effect1")
src.MOVIE_MOB_STEP("Down","Effect2")
src.MOVIE_MOB_STEP("Left","Effect3")
src.MOVIE_MOB_STEP("Up","Effect4")
sleep(10)
src.MOVIE_SFX("Magic")
src.SCREEN_FLASH("Purple",src.movie_list)
sleep(5)
src.MOVIE_MOB_DEL_ALL()
src.MOVIE_MOB_CREATE(locate(src.x,src.y,src.z),src.icon,src.icon_state,"Player","Down")
sleep(20)
src.MOVIE_DIALOGUE("Text7","Mysterious Voice")//"Can you hear me, Champion? I can only maintain this link for a short while, so listen closely... "
sleep(65)
src.MOVIE_CLOSE_BOX()
src.MOVIE_DIALOGUE("Text8","Mysterious Voice")//"As expected, your journey has severely weakened you and also affected your memory. First things first though- let's get you out of this cave. "
sleep(80)
src.MOVIE_END()
In response to SilkWizard
SilkWizard wrote:
I use images placed on top of mobs (not invisible mobs, but mobs that don't have icon_states set).

Assuming everything is entirely scripted and you're trying to make the scene as transparent as possible (f.ex. all mobs are non-dense and you try to prevent any outside interaction with them), I think you can do away with the mobs altogether, and stick only with /images, which you're naturally forced to use unless you use sealed instanced maps for every cutscene. Since /image is very similar to your typical /atom/movable (or /obj if you will) and you can modify its vars after creation, you can just modify it directly when you want the display to change (it can be moved as well by modifying loc to a different turf). Haven't tested modification of all the different vars, but it should work just like it does with atoms.

for(var/mob/Player/P in movie_list)
> P << I


If you have it set up like that, then you can shorten it to just movie_list << I, letting the looping be done internally.

Creating cutscenes is easy if you take the time to make those type of procs that do everything for you with minimal input.

Yes, of course. That's typically how games do it.
If you actually have atoms involved then you should probably have liberal use of checks and failsafes, just in case something interferes between all the sleeping.
In response to Kaioken
Kaioken wrote:
Haven't tested modification of all the different vars, but it should work just like it does with atoms.

As someone who uses images quite a bit I can attest to the fact that they're pretty quirky and can be a pain in the ass sometimes. Attaching them to mobs eliminates a lot of the hassle and guess work - but to each his own.
hey silk wizard, where you put "actor" are you supposed to put the icon file name ?
In response to Cousumaki
Cousumaki wrote:
hey silk wizard, where you put "actor" are you supposed to put the icon file name ?

No, he's using a type of mob called Actor that he's set up for handling movies by showing them as client-specific images rather than showing them to everybody. and making them non-dense.

And silk doesn't frequent the forums. Necroing a thread from 2010 probably won't catch his notice.