I have a window for dialogues when you left click on an npc that shows their picture, name and dialogues.
I need to update that every time you click on a new npc so it shows the new npc's name little pic and its own dialogues.
I have a window that lays out the picture and buttons but what I'm trying to do is to detach the last script attached to the window that represents the old npc's dialogue and attach the new one that is the new npc's dialogue. Don't know if the new script has to be in the same file as the old one.
Here is what the window looks like when you left click on the original ncp:
Here is my script originally attached to the original npc that calls this dialogue window:
#include "scripts\base.inc"
global Statekolobok;
on "LeftClick"
{
var Box = Game.LoadWindow("scenes\Kolobok\Box.window");
Box.Visible = true;
}
Here is my script attached to that window that I want to use forever in the game and just make little changes to it on each npc : ) :
#include "scripts\base.inc"
on "Buttop1"
{
var a = this.GetControl("Buttop2");
a.Text = "Ready for action. Here take this key.";
var key = Scene.GetNode("key");
actor.TakeItem("key");
}
on "Buttop3"
{
var b = this.GetControl("Buttop2");
b.Text = "Princess Vasilisa's Book of Weather Spells is missing. That could mean mischief in the wrong hands. Let me hop in your back pack and let's go.";
actor.TakeItem("kolo");
}
on "Goodbye"
{
var e = this.GetControl("Buttop2");
e.ParentNotify = false;
e.Text = "";
this.Close();
}
Here is my script on the new npc.
#include "scripts\base.inc"
global Statekolobok;
on "LeftClick"
{
var Box = Game.LoadWindow("scenes\Kolobok\Box.window");
Box.Visible = true;
Box.DetachScript.Box.script;
Box.AttachScript.Box2.script;
}
The Box 2 script is just the new dialogues.
I get an error message that the game can't load Box2 script.
Do I have to make a new talk window and its accompanying script for each npc? : (