Game Development Reference
In-Depth Information
Sample script
The following is a sample script taken from my forthcoming game, Juniper
Crescent - The Sapphire Claw . This includes all the logic which controls the
dialogue choices and responses as well as some function calls - to animate
characters, for instance. The game is being developed using the Wintermute
Engine and tool set, so the script format is the one that this tool set uses.
Talk to the Skull
global SkullVar;
global BlinkyVar;
global Coconut;
global InvisibleVar;
var Blinky = Scene.GetNode(“blinky”);
var Skull = Scene.GetNode(“skull”);
var Pole = Scene.GetNode(“pole”);
var Scout = actor;
////////////////////////////////////////////////////////////////////////////////
on “Talk”
{
GoToObject();
Game.Interactive = false;
// greetings
if(!SkullVar.Talked)
{
if(!SkullVar.Moved) Scout.ForceTalkAnim(“actors\scout\rr\talkup.sprite”);
Scout.Talk(“Hello, skull.”);
Skull.ForceTalkAnim(“sprites\Skull\talk.sprite”);
Skull.Talk(“Hello, cat. It's so good to meet you.”);
// set the flag, so that we know we've already talked to him
SkullVar.Talked = true;
}
 
Search WWH ::




Custom Search