Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-15-2014, 10:36 PM
Struggler Struggler is offline
Zone Repulser =D
Struggler's Avatar
Join Date: May 2006
Posts: 54
Struggler is an unknown quantity at this point
Passing this. variables from clientside to serverside via triggerserver

Hello again, sorry to be back so soon but I ran into another problem whilst coding things. I'm trying to make an NPC targetting system (weapon set up to interface with clientr values, which are updated by the targets when clicked), and it seems to have problems sending my [this.] variables over triggerserver. I was wondering if I'm doing something wrong or is there a workaround I'm not quite seeing? Thanks in advance!

As a sidenote, this is the NPC being clicked as a demonstration of principle. I set the values clearly, but when it's sent via triggerserver they all come out as NULL or 0 values for some reason.

Quote:
function onActionTarget(){
pl = findplayerbycommunityname(params[0]);
pl.clientr.target_name = params[1];
pl.clientr.target_health = params[2];
pl.clientr.target_healthmax = params[3];
pl.clientr.target_level = params[4];
pl.clientr.target_healthbar = params[2]@"/"@params[3];
pl.(@ "Public/Struggler/NPCTargeting").trigger("update");
}
//#CLIENTSIDE
function onCreated(){
setshape(1,32,44);
showcharacter();
this.bodyimg = "body2.png";
this.shieldimg = "no-shield.png";
this.headimg = "head5.png";
this.nick = "";
this.blevel = 1;
this.bname = "Badguy";
this.health = 10;
this.maxhealth = 10;
this.ap = 0;
}
function onMouseDown(mode){
if(mode == "left"){
triggeraction(this.x,this.y,"Target",player.commun ityname,this.bname,this.health,this.maxhealth,this .blevel);
}
}
Reply With Quote
  #2  
Old 10-15-2014, 11:01 PM
Inari Inari is offline
Registered User
Join Date: Sep 2014
Posts: 47
Inari is on a distinguished road
Are you sure it isn't because of the space in "player.communityname"?
Reply With Quote
  #3  
Old 10-15-2014, 11:13 PM
Struggler Struggler is offline
Zone Repulser =D
Struggler's Avatar
Join Date: May 2006
Posts: 54
Struggler is an unknown quantity at this point
Honestly there's no space in the script idk why it put all those spaces in the forum post
Reply With Quote
  #4  
Old 10-15-2014, 11:19 PM
Struggler Struggler is offline
Zone Repulser =D
Struggler's Avatar
Join Date: May 2006
Posts: 54
Struggler is an unknown quantity at this point
On the same topic, is there a way to perform a function when a variable changes in value?
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 07:11 AM.


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