Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Passing this. variables from clientside to serverside via triggerserver (https://forums.graalonline.com/forums/showthread.php?t=134269625)

Struggler 10-15-2014 10:36 PM

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

Inari 10-15-2014 11:01 PM

Are you sure it isn't because of the space in "player.communityname"?

Struggler 10-15-2014 11:13 PM

Honestly there's no space in the script idk why it put all those spaces in the forum post

Struggler 10-15-2014 11:19 PM

On the same topic, is there a way to perform a function when a variable changes in value?


All times are GMT +2. The time now is 05:50 AM.

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