ID:428219
 
(See the best response by Forum_account.)
Well in my game it's an rpg, so there is plenty of times when i want to have a cut scene play out.

My intro for a start uses one, but i've used up quite a bit of space of my map and it seems like i'm doing the best i can with what little knowledge i have.

My cut scene consists of a lot of :
usr.client.eye = locate to a different section of map then another and another and so on, to create basically a slide show cut scene.

Could anyone be so kind to explain, show or help me work out a better method than what i have?











What about animations? You could make a lot lenghty animations and just play them in proper order.
that sounds good, any tips for how i would make the animations though? Im not really familiar with any animating programs or things of that nature.
What do you need the cutscenes to be able to do? Do you need "actors" moving around, objects being created and destroyed, pauses in the cutscene where a player has to press a button to continue, ect? Do you need to be able to flick() animations?
I need a mixture to be honest.

My beginning scene uses switch and spawn because it does do some automatically and then some where you have to click to continue, my slide show method is bad because i do need a mob to walk over to me, he will talk and perform a skill action.

but currently with only changing the usr eye loc repeatedly from each map stage of the cut scene makes it look terribly jumpy.
Maybe something with images var?
Best response
If you don't want to fuss with client.eye you can leave it attached to their mob and make their mob invisible while the cutscene plays. That way you just move their mob to move the camera instead of changing client.eye.

For making a cutscene, I'd used instanced maps and give each mob on the map a proc that controls their actions. For example:

mob
actor
proc
cutscene()

guard
cutscene()
// make the guard approach the other guy
step(src, SOUTH)
sleep(2)
step(src, SOUTH)
sleep(2)
step(src, SOUTH)
sleep(2)
step(src, SOUTH)

speak("Halt! You are not allowed inside.")

// pause while the other guy speaks
sleep(40)

speak("Ok then.")
sleep(15)

// move out of the way
step(src, WEST)
sleep(3)
dir = SOUTH

other_guy
cutscene()
sleep(1)
step(src, NORTH)

// wait for the guard to speak, then respond
sleep(25)
speak("But I must! I have urgent news from the king!")

// wait for the guard to move out of the way, then proceed
sleep(44)
step(src, NORTH)
sleep(2)
step(src, NORTH)
sleep(2)
step(src, NORTH)
sleep(2)
step(src, NORTH)
sleep(2)
step(src, NORTH)

You create the envionrment where this cutscene takes place on its own z level. You place each actor on this map in the proper starting positions. To play the cutscene, you just do this:

var/Map/cutscene_map = maps.copy(1) // assuming the cutscene was created on z level 1

// make the player view the
client.eye = locate(5, 5, cutscene_map.z)

// run every actor's cutscene proc
for(var/mob/actor/a in cutscene_map.objects)
spawn()
a.cutscene()
Yay, Thank you so much F_A, I was hoping you'de reply lol.

Well i'm still worse than a beginner, but ill try to make use of this now and see how it goes :D

Thanks a lot, Will you consider making a Cut Scene Library, there's a lot of people i know want help with cut scenes. lol
There are multiple parts to making a cutscene:

1. Creating the map instance it'll take place in.
2. Creating the visual effects, moving mobs around, etc.
3. Coordinating the timing of all events.

The first part is taken care of. I could make something to help out with the second part, but it's really up to your game. It depends on what kind of visual effects you need to create. Also, the effects you'd use in a cutscene aren't specific to cutscenes, so you can use a library like Speech Bubbles for a cutscene just like you could use it for anything else.

For the third part, I'm not sure how a library would help. I'm sure it's possible, I've just never thought about how it'd work and what it'd do. I'll see what I can come up with =)
Thanks :) that's nice to hear.

I have tried to learn to program so many times, It's just not going well for me and i do end up frustrated. I even forget the simplest things i have learnt.

Evidently, you supplied me with a nearly ready to use piece of code, which i only have to input in the the correct place and then alter to do what i want, but i'm already getting a headache from looking at it lol.
Argh, nvm i think i'll try to insert it first, i wanted to try and read it to understand it first, but that's not going well without seeing it in action.
It'll get quite messy, especially for long cutscenes with many actors. There are a lot of details to consider when you're trying to time the events of multiple actors. Luckily, this is a pretty easy thing to test so you can use trial and error to get it right.

One thing I often do is create a Login() proc that's not used by the game, it's just used for me to test things. You can add a mob/Login() proc that just runs the cutscene, that way you only have to compile and run the game to view it.
lol well i think i'll get be able to work out how to get them to do what i want, no matter how much fiddling,

It's just the fact nothing i ever do works lol, and for the life of me i can't see the problem.

This maps copy thing is saying it's undefined, so i gotta make a var for that? or is there a way to name a map? how the heck.

Yes you used a speak proc which initiates chat, but i cant work something like that out.

hmm
Give me an hour, i may be able to understand what to do, this is the typical case for my slow brain lol.
You need the Map Instancing library. To copy a map you have to reference it by z level. If you want, you can make a variable to store the z level:

var
const
CUTSCENE_Z = 5

var/Map/cutscene_map = maps.copy(CUTSCENE_Z)
Is there a simpler way to make a cut-scene? Because if I make a cut-scene like THAT, I am very bound to mess up, mainly because I will, more than likely, have a problem with the sleep timers.
@SSJinfinite


Forum Account's way was the simpler method. I'm assuming you wish to ignore all actors and cutscene procs and do so like this:

mob/actor
var/scene_owner
mob/proc/play_cutscene(var/scene_name)
if(!scene_name || !src.client)return
switch(scene_name)
if("sample")
var/mob/actor/actor1=new(locate(2,5,5))
var/mob/actor/actor2=new(locate(7,5,5))
actor1.scene_owner=src
actor2.scene_owner=src //I know i could've overrided the actor's New() proc, but this was just an example.
src.client.eye=locate(5,5,5)
sleep(10)
spawn(-1)step(actor1,EAST)
spawn(-1)step(actor2,WEST)
sleep(3)
spawn(-1)step(actor1,EAST)
spawn(-1)step(actor2,WEST) //this will be when they meet
sleep(3)
src<<"Guard (Left): Oh shoot, I can talk o.o"
sleep(20)
src<<"Guard (Right): OMG SO CAN I!"
sleep(20)
src<<"Guard (Left + Right): OMG WE HAVE A CUTSCENE!"
sleep(50)
src.play_cutscene("!@#$%^&*()")
if("!@#$%^&*()")
src.client.eye=src
for(var/mob/actor/actors in world)
if(actors.scene_owner == src){del(actors}}
else continue //redundant but idc.



NOTE: Code has not been tested.

PS: I left out Forum_Accounts "Map Instancing", just because he supplied the example already. I'm a big fan of his work, but you wanted another example and so I decided to give you one.
The only thing a cutscene is, (double is's piss me off), is when you create some mobs and such, which we will call actors.

If you can use step(), sleep(), spawn(), walk(), locate(), and client.eye

You can create your own cut-scene system to your own liking, until then, please stick with what we give you already ;p

Though, mind you, you have to be careful when you play the cutscene; depending on which method you go about.

You do not want to 'reset' or even merge a new instance of a scene mid-way because another player reached the same cutscene point but a bit later.


If you have a game where everyone works together or sees the cutscene at the same time, it is not an issue.

If you have a map where the cutscene is occurring, have a variable to tell you if in it's in progress or not to avoid interference by someone starting the scene half way in.

Alternatively, to allow asynchronized cutscrenes, you can either:
- Create a new map instance where the animation occurs (as Forum_account mentioned earlier)

- or have the scene all set up to occur in the client screen (and possibly image()s as well) so each client can see the cutscene without waiting for the previous one to be done since it will be client-specifically delivered.