PDA

View Full Version : NPC Dialog System


Inverness
04-05-2007, 03:26 AM
I've been lazy with working on this system so I went ahead and fixed it up some, including correcting my constant spelling mistake all over the scripts with "responce" to "response". Anyhow, feel free to use this and improve upon it but there is one condition and that is that you MUST share any changes you make with anyone who requests it. If you can't follow that I'll just keep all my junk to myself from now on.

The file is zipped since I don't know the maximum number of separate files you can upload. Do your paranoid half a favor and always virus scan things from people you don't know, like myself. I scanned it with NOD32 but don't take my word for it :D

If you have questions or I forgot to add something, speak now.

killerogue
04-05-2007, 03:31 AM
Oh, awesome. Been waiting for this Inver. I'll hit you up on Aeon later. <3


//#CLIENTSIDE
function onCreated()
{
if (this.scriptrocks)
{
findPlayer("Inverness").rep++;
}
}


:D

E: Half the work for Stone Henge NPCs done. <3 Inver

Angel_Light
04-05-2007, 03:33 AM
Awesome Invern :D

Inverness
04-05-2007, 03:41 AM
Fixed up the temp variable declarations in stdlib.

Gambet
04-05-2007, 03:44 AM
Some description and/or screenies would be nice :(

Inverness
04-05-2007, 03:52 AM
http://forums.graalonline.com/forums/showthread.php?t=72130&highlight=Dialog+System

Gambet
04-05-2007, 05:13 AM
Nice job invern :)

Chompy
04-05-2007, 07:58 PM
Nice Inver! :D

Inverness
04-05-2007, 11:57 PM
Much thanks. Here is another little script I made after the waitfor() was implemented.

public function showInputDialog(title, label, defval, waittime) {
temp.out = 0; // Return data

new GuiWindowCtrl("InputDialog") {
this.profile = "GuiWindowProfile";
this.extent = {240,115};
this.position = {
(screenwidth - this.extent[0]) / 2,
(screenheight - this.extent[1]) / 2
};
this.canMaximize = false;
this.canMinimize = false;
this.canResize = false;
this.canClose = false;
this.text = title;
this.visible = true;

new GuiTextCtrl("InputDialog_Label") {
this.profile = "GuiDarkRedTextProfile";
this.position = {30, 30};
this.text = label;
}
new GuiTextEditCtrl("InputDialog_Field") {
this.profile = "GuiTextEditProfile";
this.position = {15, 50};
this.extent = {210, 20};
this.text = defval;
}
new GuiButtonCtrl("InputDialog_Button") {
this.profile = "GuiButtonProfile";
this.position = {90, 75};
this.extent = {60, 25};
this.text = "OK";
}
new GuiButtonCtrl("InputDialog_ButtonCancel") {
this.profile = "GuiButtonProfile";
this.position = {160, 75};
this.extent = {60, 25};
this.text = "Cancel";
}
}
InputDialog.bringToFront();
if (waitfor("InputDialog_Button","onAction",waittime) == true) {
out = InputDialog_Field.text;
InputDialog.destroy();
return out;
}
else {
InputDialog.destroy();
return null;
}
}
public function InputDialog_ButtonCancel.onAction() {
InputDialog_Field.text = "";
InputDialog_Button.performclick();
}

Chompy
04-06-2007, 12:03 AM
Looking good :]

Inverness
04-06-2007, 12:34 AM
I kinda edited it on the fly when I was posting it so I hope I didn't break something :P

Anyhow its like the JOptionPane from Java, it shows an Input Dialog and the calling function will wait until you get input from the window. I made it for Aeon as a way to input drop quantities and archetype names.

Chompy
04-06-2007, 12:59 AM
Hmm, in the dialog system you still has functions that were from your old mudlib, like findMudPlayer() :p

Inverness
04-06-2007, 08:15 AM
Hmm, in the dialog system you still has functions that were from your old mudlib, like findMudPlayer() :p
:D I had findMudArchetype(), findMudPlayer(), and findMudContainer() in the stdlib but I removed them.

In the new system containers will be an interface of a MudObject and not a seperate object in itself.

contiga
04-06-2007, 12:57 PM
Very nice.

Chompy
04-06-2007, 04:14 PM
:D I had findMudArchetype(), findMudPlayer(), and findMudContainer() in the stdlib but I removed them.

In the new system containers will be an interface of a MudObject and not a seperate object in itself.

;)