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 06-13-2006, 10:24 PM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
TriggerClient() format

I've been searching for it but can't find it. Can anyone give me an example?

Here's what I currently have:

NPC Code:
function onCreated()
{
player.triggerclient("weapon name", "params");
}

//#CLIENTSIDE
function onActionClientside()
{
player.chat = "Recieved";
}

Reply With Quote
  #2  
Old 06-13-2006, 10:49 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
On serverside:

triggeraction(0, 0, "clientside", name, "params");
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 06-14-2006, 12:00 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
It's triggerclient(objecttype, name, params)
Currently only "weapon" works as objecttype, or "gui" which is the same.
Reply With Quote
  #4  
Old 06-14-2006, 09:24 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally Posted by Stefan
It's triggerclient(objecttype, name, params)
Currently only "weapon" works as objecttype, or "gui" which is the same.
NPC Code:
player.triggerclient(weaponname,actionname,params)  ;


Is what I've been using, and it seems to work.
Reply With Quote
  #5  
Old 06-15-2006, 05:08 PM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Quote:
Originally Posted by Python523
NPC Code:
player.triggerclient(weaponname,actionname,params)  ;


Is what I've been using, and it seems to work.
Let me use an example from this.

NPC Code:
function onCreated()
{
player.triggerclient("Weapon", "Recieve", 1, 2, 3);
}
//#CLIENTSIDE
function onActionRecieve()
{
player.chat = "recieved";
}



Would this be correct?
Reply With Quote
  #6  
Old 06-15-2006, 02:43 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Evil, Stefan's post was at Yesterday, 12:00 AM and Jagen's was at Yesterday, 09:24 AM, what is going on?!
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #7  
Old 06-15-2006, 04:50 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by contiga
Evil, Stefan's post was at Yesterday, 12:00 AM and Jagen's was at Yesterday, 09:24 AM, what is going on?!
stefan: 06-13-2006, 11:00 PM
python523: Yesterday 08:24 AM
__________________
Skyld
Reply With Quote
  #8  
Old 06-15-2006, 05:46 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
its triggerclient("gui",weaponname,param1,param2);

Your problem is that you are expecting it to work like triggeraction and it does not.

It will be:
NPC Code:

function onActionServerSide(){
triggerclient("gui",this.name,"dothis","forme");
}
//#CLIENTSIDE
function onCreated() triggerserver("gui",this.name,"");
function onActionClientSide(){
switch (params[0]){
case "dothis":
echo(params[1]);
}
}

Reply With Quote
  #9  
Old 06-16-2006, 06:58 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Python523
NPC Code:
player.triggerclient(weaponname,actionname,params)  ;


Is what I've been using, and it seems to work.
I'm assuming that if you don't use 'object type' for the first parameter, it functions like a normal triggeraction. If you fill in an object type, you will not be able to specify the 'actionname', it always sends actionClientside.

Quote:
Originally Posted by Warcaptain
its triggerclient("gui",weaponname,param1,param2);
Quote:
Originally Posted by Stefan
It's triggerclient(objecttype, name, params)
Currently only "weapon" works as objecttype, or "gui" which is the same.
According to Stefan, 'weapon' works aswell.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #10  
Old 06-16-2006, 07:16 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally Posted by ApothiX
According to Stefan, 'weapon' works aswell.
Yes of course 'weapon' works... but as Stefan said 'gui' and 'weapon' are the same.
Reply With Quote
  #11  
Old 06-16-2006, 02:17 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Warcaptain
Yes of course 'weapon' works... but as Stefan said 'gui' and 'weapon' are the same.
The way you worded your reply it sounded like you were criticising his 'player.triggeraction("weapon", ...' format.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #12  
Old 06-15-2006, 07:53 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
triggerclient(npcname, params); works for me.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #13  
Old 06-15-2006, 09:00 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally Posted by xXziroXx
triggerclient(npcname, params); works for me.
Probably because the default value for object type (the first parameter) is gui/weapon. But it may change (doubt it) if Stefan adds more object types.

Either way, triggerclient(objtype,name,params) is the 100% correct format.
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:55 AM.


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