View Single Post
  #9  
Old 02-20-2010, 04:40 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by adam View Post
Yeah, I got to work with the npc server some before my "long vacation" if you will. Maybe it's because I was younger, but it seemed way complicated to do it with gs1 and make it look easy.

NPC Code:
    triggerServer("gui", this.name, "tell", acc, msg); 



I have been looking at this line, am I to understand "gui" refers to Weapons/Gui npc's and 'this.name' is the name of the current weapon/gui npc and that's why it triggers the 'onActionServerside' from the current weapon?

I suppose it may be obvious, but hey i'm here to get this stuff down, and I want to know exactly why i am typing something if I have to include it.
Yeah, that's correct. The parameters are:

triggerServer(type, script, param1, [...]);

'type' can be 'gui' or 'weapon' (Weapon/GUI scripts; personal preference which to use) or 'npc' (DB npc).

'script' is the name of the script. You can always use 'this.name' if triggering the same script. This is preferable since it makes it easy to change script names without a lot of refactoring.


With GS1 it was something like

PHP Code:
triggeraction 00serverside#N, param1; 
if I recall.
__________________
Reply With Quote