Jump to content
  • Advertisement
Sign in to follow this  
Jinroh

Cutscene Scripting

This topic is 3725 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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 nessecary
Cutscene.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 :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!