Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   What Am I doing Wrong?(Triggers) (https://forums.graalonline.com/forums/showthread.php?t=134265107)

MysticalDragon 11-25-2011 09:17 PM

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;
  }
} 


ffcmike 11-25-2011 09:20 PM

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.

Hezzy002 11-25-2011 09:53 PM

Personally, I've always thought using a system NPC to act as a buffer was the most elegant solution.


All times are GMT +2. The time now is 08:09 PM.

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