Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 01:33 AM.


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