Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   NPC Dialog System (https://forums.graalonline.com/forums/showthread.php?t=73286)

Inverness 04-05-2007 02:26 AM

NPC Dialog System
 
1 Attachment(s)
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 02:31 AM

Oh, awesome. Been waiting for this Inver. I'll hit you up on Aeon later. <3

PHP Code:

//#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 02:33 AM

Awesome Invern :D

Inverness 04-05-2007 02:41 AM

1 Attachment(s)
Fixed up the temp variable declarations in stdlib.

Gambet 04-05-2007 02:44 AM

Some description and/or screenies would be nice :(

Inverness 04-05-2007 02:52 AM

http://forums.graalonline.com/forums...=Dialog+System

Gambet 04-05-2007 04:13 AM

Nice job invern :)

Chompy 04-05-2007 06:58 PM

Nice Inver! :D

Inverness 04-05-2007 10:57 PM

Much thanks. Here is another little script I made after the waitfor() was implemented.
PHP Code:

public function showInputDialog(titlelabeldefvalwaittime) {
  
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 = {3030};
      
this.text label;
    }
    new 
GuiTextEditCtrl("InputDialog_Field") {
      
this.profile "GuiTextEditProfile";
      
this.position = {1550};
      
this.extent = {21020};
      
this.text defval;
    }
    new 
GuiButtonCtrl("InputDialog_Button") {
      
this.profile "GuiButtonProfile";
      
this.position = {9075};
      
this.extent = {6025};
      
this.text "OK";
    }
    new 
GuiButtonCtrl("InputDialog_ButtonCancel") {
      
this.profile "GuiButtonProfile";
      
this.position = {16075};
      
this.extent = {6025};
      
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-05-2007 11:03 PM

Looking good :]

Inverness 04-05-2007 11:34 PM

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-05-2007 11:59 PM

Hmm, in the dialog system you still has functions that were from your old mudlib, like findMudPlayer() :p

Inverness 04-06-2007 07:15 AM

Quote:

Originally Posted by Chompy (Post 1297259)
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 11:57 AM

Very nice.

Chompy 04-06-2007 03:14 PM

Quote:

Originally Posted by Inverness (Post 1297357)
: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.

;)


All times are GMT +2. The time now is 10:53 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.