Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 07-20-2008, 07:29 AM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Unhappy

Quote:
Originally Posted by Inverness View Post
That's what catchevent() is for.

objectA.catchevent(objectBName, eventNameToCatch, newEventName);
PHP Code:
function blah() {
  new 
GuiButtonCtrl("SpecialButton" number) {
    
//stuff
    
thiso.catchevent(this.name"Action""ButtonAction");
  }
}
function 
onButtonAction(objectname) {
  echo(
"Button Action from " objectname);

The new event will always have the name of the object you're catching from as the first parameter.
I've also been curious about this for awhile. I understand the concept of how this would work, but when I create a test script to see if it actually works out it doesn't seem to produce anything. Right now I have:

PHP Code:
function newFuncindx ) {
  new 
GuiButtonCtrl"TestButton_" indx ) {
      
profile GuiBlueButtonProfile;
      
height 22;
      
width 67;
      
text "Test Button!";
      
50;
      
50;
      
thiso.catcheventthis.name "Action""ButtonReceive" );
  }
}
function 
onButtonReceiveobjectname ) {
  
player.chat objectname " has triggered this event!";

The ButtonReceive event isn't triggered at all. With 'objectname' am I supposed to just be parsing parameters like that or do I actually need to place a specific object name in there? Otherwise I'm not sure what I'm doing wrong.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:50 AM.


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