Sign in to follow this  
  • entries
    65
  • comments
    133
  • views
    77650

Scripting

Sign in to follow this  
Drilian

220 views

Scripting's done. And I use the term "Scripting" lightly.

All "scripts" are hard-coded into the game. For instance, a sample short script would look like the following:


Add(new StopMusicPoint(m_audio));
// Whistler fades in.
Add(new CreateEntityPoint(this, m_audio, m_renderer, m_world, "Whistler", "Whistler", Vec2(14,1)));
Add(new LerpEntityVarPoint(this, "Whistler", "alpha", 0, 0.5f, 50));

Add(new DialogPoint(m_audio, m_renderer, 0xFF7FFF7F, 20, "Sound\\3-1.ogg", " 'Nuther seal down, Jack? Good for you! Man, you're sweatin' like a pig...you look like you could use a towel."));
Add(new DialogPoint(m_audio, m_renderer, 0xFF7F7FFF, 20, "Sound\\3-2.ogg", " Silly me for leaving home without it. Arthur Dent would be so disappointed."));
Add(new DialogPoint(m_audio, m_renderer, 0xFF7FFF7F, 20, "Sound\\3-3.ogg", " Who?"));
Add(new DialogPoint(m_audio, m_renderer, 0xFF7F7FFF, 20, "Sound\\3-4.ogg", " Just a...nevermind."));
SkipTo();



Basically, that creates an entity named "Whistler" given the entity type "Whistler", lerps its alpha value from 0 to 0.5, plays a bunch of dialog (the dialog point both plays the ogg dialog sound file and displays the text), then ends.

The SkipTo lets the script know that this is the point that it skips to when the user skips a cutscene. I'm not using it to make unskippable sections, it's just a quick hack because I'm also using scripts to set up the background music at the beginning of each music zone, so I don't want the player to be able to skip THAT.

Anyway, a couple of screenshots to tide you over. The first shows a script that's running (along with the shopkeeper, Whistler P. Higgins), and the second shows the game running in wireframe (That's right, I'm not using textures! For anything!)




Click to enlarge


Anyway, I hope to finish up the history details in an entry soon...I haven't had much time to do so!
Sign in to follow this  


2 Comments


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now