Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-25-2011, 09:17 PM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is a jewel in the roughMysticalDragon is a jewel in the rough
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
What Am I doing Wrong?(Triggers)

At first I tried to Just trigger to clientside, so that didn't work. But for some reason I can't get my triggers to work at all for a class NPC(Tried both Clientside and serverside triggers). Is it Era's NC being stupid?
PHP Code:
function onCreated()
{
 
showcharacter();
 
setshape(1,16,16);
}
function 
onActionServerSide()
{
 if (
params[0] == "getVars"){
   echo(
"Triggered to Server? what about Client?");
   
temp.data findplayer("MysticalDragon");
   
clientEcho(temp.data);
  }
}
function 
clientEcho(temp.data)
{
 
triggerClient("gui"name"echo"temp.data);
}
//#CLIENTSIDE
function onCreated()
{
 
setshape(1,16,16);
}
function 
onPlayertouchsme()
{
  echo(
"Echo Test::getVars");
  
triggerServer("gui"name"getVars");
}
function 
onActionClientSide()
{
  switch (
params[0])
  {
    case 
"echo":
       echo(
"Echo Test" SPC params[1]);
     break;
  }

__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote
  #2  
Old 11-25-2011, 09:20 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Problems here would be that triggerclient() only works within weapons, not NPCs, and that triggerserver() would only work with a local NPC/putnpc2 object, but even this would require the name being stored as an ATTR serverside for the client to read from as name is not synchronised.
Reply With Quote
  #3  
Old 11-25-2011, 09:53 PM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
Personally, I've always thought using a system NPC to act as a buffer was the most elegant solution.
Reply With Quote
Reply


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:43 PM.


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