Cutscene Scripting

Started by
2 comments, last by Jinroh 15 years, 8 months ago
Hey all, I have a Scripting System for my Game Engine. It is similar to that of RPG Maker in a 3D Engine. I mean you can be like while(p1.x < p1.x + 4) move right. or Play Animation XtoTheZ Stuff like that. Now! Would this be a good system for some cool action sequences or do I want to make something a bit cooler. I read some posts about making like a Movie Maker type of system with a timeline and everything. Which is a cool idea for some sweet action scenes and machinima and such as I like that idea. I mean the current system I have now is good for ingame stuff like, "Oh I'm an NPC and I'm gonna walk over to this spot and do this animation." I'm just curious about how others do their cutscenes and if I could get any tips on how to approach this. Thanks all, Jinroh.
The wolf and his mate howl, taking solace in the silver moon. Pressing ever foreward to see what the future holds.
Advertisement
I think it strongly depends what scripting type you use.
In my oppinion, there are two types, the type of script that gets fully executed every x frames and a script that works more like a behaviour tree.

I think the second sort will be much easier to use since you can do things like these:

StartCutScene()Move( NPC1, Vector(0,0,0) )Print( "Hello, blaaaa" )


You might even create an editor that simplifies things even more.
However, I would still use a normal script and then write some helper classes to simplify things. I didn't implement cutscenes yet, however this is how I will propably do it in the future:

Write a class that allows the registration of events like this:
// I assume that you use a script that gets executed x times per second:if( !registered ){    // The cutscene class will be able to accept callbacks between 0s and 30s    Cutscene.setlength( 30 );    // The cutscene class will then call the callback function after 12.5 seconds have elapsed from the beginning of the cutscene    Cutscene.register( 12.5, &Callback );    // Now the cutscene class will start counting the time    Cutscene.start();    registered = true;}// During that update call, the class will check the time and execute callbacks, if nessecaryCutscene.update();void Callback(){    Print( "Who have we here?" );    Attack( Player );}


Depending on how much cutscenes you want to use, you can improve that system, maybe add some triggers (Call the Callback function when w walked to xyz), to avoid the precise timing of things.

The big plus of doing it like that is, that you avoid alot of nasty if/else statements. You will be able to change things very easy: just register another callback, change the parameters and/or triggers, done :)
Thanks for the post Shadowman, I'll check that method out. I appreciate it.
The wolf and his mate howl, taking solace in the silver moon. Pressing ever foreward to see what the future holds.
Thanks for the post Shadowman, I'll check that method out. I appreciate it.
The wolf and his mate howl, taking solace in the silver moon. Pressing ever foreward to see what the future holds.

This topic is closed to new replies.

Advertisement