Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Phantasmagoria on May 19, 2008, 06:24:23 PM
-
Hi Hi
just signed up, BTW love WME.
I tried and tried to get this to work but I have no idea how. This is what should happen;
the player enters the scene and automatically starts talking to an NPC.
After the dialog ends the player can either leave the scene or talk to the NPC again.
If the player talks to the NPC and selects a special line of the dialog string then the character changes and the
player can not leave the scene until picking up an item that previously the player could only look at.
I can get the player to talk to the NPC automatically and change the way he looks with special line of dialog,
but as for the item and stopping the player from leaving the scene until after picking up the item I'm lost.
If anyone can help or has a bit of code it would be greatly appreciated.
-
The exit from your scene is probably some region entity. All you need to do is to activate/deactivate this entity based on player's action. Something like this:
var Exit =
Scene.
GetNode("exit_entity");
// the name of your exit entity here Exit.
Active =
true;
// or false, to activate or deactivate
As for where exactly to execute this code depends on how exactly your script works.
-
Thank you Mnemonic, that worked a treat ;D
I added it to my dialog and the door stops working. Here is a shortened bit of my code;
// fill the response box
Game.AddResponse(0, Responses[0]);
Game.AddResponse(1, Responses[1]);
Game.AddResponse(1, Responses[2]);
// let the player choose one
Selected = Game.GetResponse();
// let the actor say the selected sentence
actor.Talk(Responses[Selected]);
// now let the Old Guy reply depending on the selected sentence
if(Selected==0)
{
this.Talk("Some text.");
this.Talk("Something else.");
actor.Talk("*ahem*");
}
else if(Selected==1)
{
this.Talk("Some other text");
actor.Talk("*ahem*.");
Game.UnloadObject(actor);
actor = Game.LoadActor("actors\Sarg2\Sarg2.actor");
Game.MainObject = actor;
var Exit = Scene.GetNode("DoorToF2"); // the name of your exit entity here
Exit.Active = false; // or true, to activate or deactivate
}
else if(Selected==2) Loop = false;
}
}
Am I right in thinking that this bit of code is also used to make the item active and to turn the door back
on after getting it?
BTW, Sorry about posting in the wrong forum :)
-
Am I right in thinking that this bit of code is also used to make the item active and to turn the door back
on after getting it?
Yes. Generally speaking, you can use GetNode() method to query any part of the scene and change it's properties. Not just its activity, but for example its name, graphics, font, etc.
BTW, Sorry about posting in the wrong forum :)
No problem.
-
Yes. Generally speaking, you can use GetNode() method to query any part of the scene and change it's properties. Not just its activity, but for example its name, graphics, font, etc
Wow. That's really cool thanks. It's works so good :D
::beer to you Mnemonic, thanks for making WME.