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 04-06-2009, 12:34 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
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?
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #2  
Old 04-06-2009, 03:15 PM
fragman85 fragman85 is offline
Banned
Join Date: Mar 2009
Location: Switzerland
Posts: 261
fragman85 is on a distinguished road
"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
Reply With Quote
  #3  
Old 04-06-2009, 03:22 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by fragman85 View Post
"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.
Reply With Quote
  #4  
Old 04-06-2009, 03:24 PM
fragman85 fragman85 is offline
Banned
Join Date: Mar 2009
Location: Switzerland
Posts: 261
fragman85 is on a distinguished road
Well, I don't think anyone will read throught his codes if he doesn't use PHP tags :o
Reply With Quote
  #5  
Old 04-06-2009, 03:26 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by fragman85 View Post
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"
Reply With Quote
  #6  
Old 04-06-2009, 10:13 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
Try setting their chat or something ... player.attr can be unreliable sometimes. If the chat works, at least you've solved your trigger problems.
__________________
Reply With Quote
  #7  
Old 04-07-2009, 12:34 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Codein figured it out, somewhere in the code it was setting on name rather than on account. :-D
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #8  
Old 04-08-2009, 12:58 PM
fragman85 fragman85 is offline
Banned
Join Date: Mar 2009
Location: Switzerland
Posts: 261
fragman85 is on a distinguished road
Huh
Reply With Quote
  #9  
Old 04-08-2009, 01:33 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
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.
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 02:51 PM.


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