Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-22-2009, 09:47 PM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
Talking how would i subtract a flag serverside

how would i do that

so this is clientside clientr.hp -= 20;

what is serverside

oh yea and im getting better at scripting

this is part of my hp sys made all bye myself

thankyou people that told me to go to wiki.graal.net thankyou very much
Reply With Quote
  #2  
Old 02-22-2009, 09:51 PM
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
You need to trigger the serverside portion of a script so it can change the flag.

The command you'll use is called "triggerserver". There's an explanation on this page:

http://graal.net/index.php/Creation/Dev/Script/Client

(look for the 'triggerserver' command)
__________________
Reply With Quote
  #3  
Old 02-22-2009, 10:04 PM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
can you give me an example of minusing it
Reply With Quote
  #4  
Old 03-17-2009, 10:23 PM
fragman85 fragman85 is offline
Banned
Join Date: Mar 2009
Location: Switzerland
Posts: 261
fragman85 is on a distinguished road
Well, I think this Thread is not too old yet.

And I'm not sure if Gulthex got help, so let's give him a small Example =P:

PHP Code:
// This function gets triggered by triggerserver();
function onActionServerSide() {
  if (
params[0] == "HP") {
    
clientr.hp -= 20;
  }
}
//#CLIENTSIDE
function onWeaponFired() {
// this.name is the Name of the Weapon that's getting triggered, you can let it stay this.name if you're the same weapon. HP is a parameter, if you use triggerserver more than once, you can check for different params..

  
triggerserver("gui"this.name"HP");

Hope it helped a little, I know, I suck at commenting =P
Everytime you fire your Weapon now, you'd lose 20HP...
Reply With Quote
  #5  
Old 03-22-2009, 06:21 AM
Novice Novice is offline
Developer
Join Date: Dec 2008
Posts: 90
Novice is an unknown quantity at this point
Send a message via MSN to Novice
Quote:
Originally Posted by cbk1994 View Post
You need to trigger the serverside portion of a script so it can change the flag.

The command you'll use is called "triggerserver". There's an explanation on this page:

http://graal.net/index.php/Creation/Dev/Script/Client

(look for the 'triggerserver' command)
PHP Code:
triggerServer(type,name,param0,param1,param2,...); 
"name" refers to the name of the weapon. "type" is pretty much "weapon" or "gui", either work for anything.

Alternatively you can use triggerAction(), which is almost the same.
PHP Code:
triggerAction(x,y,name,param0,param1,param2,...); 
"name" refers to the part after "onAction" on the serverside, so if you used "HealthSubtract" then the trigger will be sent to "onActionHealthSubtract" in the serverside. "x" and "y" are usually 0.
Reply With Quote
  #6  
Old 03-22-2009, 06:53 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 Novice View Post
Alternatively you can use triggerAction(), which is almost the same.
PHP Code:
triggerAction(x,y,name,param0,param1,param2,...); 
"name" refers to the part after "onAction" on the serverside, so if you used "HealthSubtract" then the trigger will be sent to "onActionHealthSubtract" in the serverside. "x" and "y" are usually 0.
That actually won't work.

Your trigger has to start with "Server" for it to go to that weapon serverside. Otherwise, it's triggering at that location.
__________________
Reply With Quote
  #7  
Old 03-22-2009, 01:10 PM
fragman85 fragman85 is offline
Banned
Join Date: Mar 2009
Location: Switzerland
Posts: 261
fragman85 is on a distinguished road
Quote:
Originally Posted by cbk1994 View Post
That actually won't work.

Your trigger has to start with "Server" for it to go to that weapon serverside. Otherwise, it's triggering at that location.
It doesn't make any sense anyway.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 11:18 PM.


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