Wintermute Engine Forum
Wintermute Engine => Scripts, plugins, utilities, goodies => Topic started by: metamorphium on September 16, 2006, 08:21:20 PM
-
Hi,
I quickly threw together an universal object for icon based dialogues. Feel free to use it, misuse it, change it or throw it out and away.
http://wiki.dead-code.org/wakka.php?wakka=IconBased
-
Damn...I don't know what I'm doing...I tried to use this method,but it didn't work...It gives me a lot of errors like:
20:09: CUIWindow::LoadFile failed for file 'windows\dialogueWindow.window'
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 21
20:09: Call to undefined method 'AttachScript'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 42
20:09: Call to undefined method 'CreateButton'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 46
20:09: Call to undefined method 'SetImage'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 47
20:09: Call to undefined method 'SetHoverImage'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 42
20:09: Call to undefined method 'CreateButton'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 46
20:09: Call to undefined method 'SetImage'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 47
20:09: Call to undefined method 'SetHoverImage'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 42
20:09: Call to undefined method 'CreateButton'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 46
20:09: Call to undefined method 'SetImage'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 47
20:09: Call to undefined method 'SetHoverImage'. Ignored.
And how my entity script should look like?
I could give up and use the standard dialogues method...but I want it!I want the icons!
Help me out...
-
seems you don't have any dialogue window file? You need just a simple window which will be used as a container for icons.
-
Yes,I didn't have it! I solved it,but I still don't know how my entity script should look like...
Can you give me a short example?
-
Ehm...no one can give me a help?
Please?
-
sorry, I have no clue what do you mean by Entity script?
-
I've got this entity called "venditore",and when I Leftclick on him I want the dialogue to start...I've got no problem with the traditional method,but i dont' know how to implement the icon method...what do I have to write inside "venditore.script"?
-
[code script]
on "LeftClick"
{
var your_object = new Object("scripts\dialogueObject.script");
your_object.InsertIcon(...); // supply correct parameters.
your_object.InsertIcon(...);
your_object.InsertIcon(...);
your_object.InsertIcon(...);
your_object.initializeDialogue(path_to_your_responses_script);
}
-
Ok,it worked...the only problem is that the actor can walk during the dialogue!How can I solve this?
I tried to set Game.Interactive = false; but in this way the player can't choose the dialogue icon!
Sorry for all this problems,but I'm dreaming of creating a Broken Sword Style adventure,and I need this kind of dialogue...
-
try modifying the initializeDialogue method in the dialogue object to read:
tmpwin.Visible = true;
tmpwin.GoExclusive();
-
It doesn't seem to work and I really don't know why...I'm starting to give up...
What about a complete step-by-step tutorial for people who doesn't know a thing about scripting in WME like me?
Believe me,for a person who's not so familiar with programming,this procedure is quite difficult...and I'm sure a lot of people would like to use icon based dialogues...Anyway,thanks for your help!
-
For people who don't know a thing about scripting is here my online book.
http://res.dead-code.org/doku.php/wmebook:start
Icon based dialogue is not a trivial matter and if you find the code complex, it's time to go "back to the roots" and learn how WME works. ;)
Ps. Optionally if you upload somewhere some minimalistic version of your dialogue project, I'll look what's wrong with it.
-
a little improove for other users:
in the initializeDialogue method at the end
add little command:
tmpwin.ApplyEvent("Init");
and in the reactions.script
add "Init" event like this:
on "Init"{
dlgObject.insertIcon("first","icon.png","icon.png"); // insert some real image file instead of icon.png
dlgObject.insertIcon("second","icon.png","icon.png"); // insert some real image file instead of icon.png
dlgObject.insertIcon("third","icon.png","icon.png"); // insert some real image file instead of icon.png
}
and then you need to show your dialog, use command like this:
dlgObject.initializeDialogue("scripts\reactions.script");
it will be automaticly started.
this method is more usefull, becouse all icon based dialogs by one per file, you may just call
dlgObject.initializeDialogue("scripts\dialog1.script");
or
dlgObject.initializeDialogue("scripts\dialog3.script");
and all logic in the one file.
thanx for your engine.
P.S. in my project i renamed initializeDialogue to showdialog