Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Triggers and their 3 Tile Range (https://forums.graalonline.com/forums/showthread.php?t=85019)

Tyhm 04-06-2009 12:34 PM

Triggers and their 3 Tile Range
 
temp.plr=findplayer(plrn);
triggerserver("gui", this.name, "hurtother", plr.account, this.damage);
plr.gethit(1);
x=plr.x;
y=plr.y;
triggeraction(plr.x+1.5, plr.y+1.5, "melee", "other", this.damage, player.account, clientr.outpost);

Serverside:
elseif (param1 == "hurtother") {
findPlayer(param2).attr[3] = param3;
}


It conveniently ignores anything that happens more than 3 tiles away regardless. It doesn't find the player if they're more than 3 tiles away, doesn't set their attr[3] if they're more than 3 tiles away, doesn't call their gethit(1) if they're more than 3 tiles away...are we really stuck with serverstrings or projectiles for ranged attacks nowadays?

fragman85 04-06-2009 03:15 PM

"params" not "param"

example:

PHP Code:

if (params[1] == "test") { blabla; } 

And I think I told you already in another Thread, please use PHP tags

salesman 04-06-2009 03:22 PM

Quote:

Originally Posted by fragman85 (Post 1481510)
"params" not "param"

example:

PHP Code:

if (params[1] == "test") { blabla; } 

And I think I told you already in another Thread, please use PHP tags

Still doesn't explain why it worked when the objects were within 3 tiles. That's odd...never has happened to me that I can recall.

Maybe his function is set up like this:
PHP Code:

function onActionServerSideparam1param2param3 ) {
  
//...


Pointless, but still might be the case.

fragman85 04-06-2009 03:24 PM

Well, I don't think anyone will read throught his codes if he doesn't use PHP tags :o

salesman 04-06-2009 03:26 PM

Quote:

Originally Posted by fragman85 (Post 1481518)
Well, I don't think anyone will read throught his codes if he doesn't use PHP tags :o

Oh I wasn't arguing with you there...I'm just saying that your answer to his problem doesn't explain why it worked when the players were within 3 tiles, and he most likely just set up his parameters as "param1, param2, param3"

cbk1994 04-06-2009 10:13 PM

Try setting their chat or something ... player.attr can be unreliable sometimes. If the chat works, at least you've solved your trigger problems.

Tyhm 04-07-2009 12:34 AM

Codein figured it out, somewhere in the code it was setting on name rather than on account. :-D

fragman85 04-08-2009 12:58 PM

Huh

Loriel 04-08-2009 01:33 PM

GS2 is the worst debugging environment because it is nigh impossible to reduce any given problem to a testcase that everybody can use to reproduce and examine the problem. :mad:


All times are GMT +2. The time now is 12:40 PM.

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