Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Bug Report
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 07-16-2010, 02:24 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Exclamation player.hears & player.ap

So, if the players AP is less than 50, the player.hearts serverside when increasing wont work! For example

if my ap is 20 and I try to heal the player via serverside
HTML Code:
temp.p = findplayer("Graal707396");
temp.p.hearts += 1;
Wouldn't work! However it works if I want to hurt the player.

If I change my ap to above 50, the above code works and so does decreasing the players health! please fix
__________________
Reply With Quote
  #2  
Old 07-16-2010, 04:21 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Known problem. I don't think it'll be fixed, either. Just use the classic workaround:
PHP Code:
temp.pl findPlayer("xAndrewx");
temp.ap temp.pl.ap;
temp.pl.ap 50;
temp.pl.hp 5// yes, hp is valid, and so is maxhp
temp.pl.ap temp.ap
__________________
Reply With Quote
  #3  
Old 07-16-2010, 04:58 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
I didn't know about the HP/MAXHP, however still doesn't work

Quote:
Originally Posted by Crow View Post
PHP Code:
temp.pl findPlayer("xAndrewx");
temp.ap temp.pl.ap;
temp.pl.ap 50;
temp.pl.hp 5// yes, hp is valid, and so is maxhp
temp.pl.ap temp.ap
I'm using it as a public player class function
__________________
Reply With Quote
  #4  
Old 07-16-2010, 05:32 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by xAndrewx View Post
I'm using it as a public player class function
Can't exactly follow..
__________________
Reply With Quote
  #5  
Old 07-16-2010, 06:58 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
HTML Code:
player.join("functions");
Inside this class
HTML Code:
public function onHealPlayer(amount) {
  this.hearts = min(this.hearts += temp.amount, this.fullhearts);
}
doesn't seem to fix it with sliding the ap either
__________________
Reply With Quote
  #6  
Old 07-16-2010, 09:19 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
Just set up some functions in the player class....

PHP Code:
public function heal(hearts) {
  
this.setHealth(this.getHearts() + hearts);
}

public function 
hurt(hearts) {
  
this.setHealth(this.getHearts() - hearts);
}

public function 
getHearts() {
  return 
this.hearts;
}

public function 
setHealth(hearts) {
  
this.oldAP this.ap;
  
this.ap 50;
  
this.hearts max(0min(this.fullheartshearts));
  
this.ap oldAP;

then you don't have to worry about it
__________________
Reply With Quote
  #7  
Old 07-16-2010, 09:24 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by cbk1994 View Post
Just set up some functions in the player class....

PHP Code:
public function heal(hearts) {
  
this.setHealth(this.getHearts() + hearts);
}

public function 
hurt(hearts) {
  
this.setHealth(this.getHearts() - hearts);
}

public function 
getHearts() {
  return 
this.hearts;
}

public function 
setHealth(hearts) {
  
this.oldAP this.ap;
  
this.ap 50;
  
this.hearts max(0min(this.fullheartshearts));
  
this.ap oldAP;

then you don't have to worry about it
still doesn't work :[
__________________
Reply With Quote
  #8  
Old 07-16-2010, 11:29 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
so much for "hp cant be recovered by normal means"
where did i hear that? im pretty sure it was classic. problem is, it cant be healed by er.. abnormal means either. only death. I always found that a bit misleading
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #9  
Old 07-17-2010, 01:12 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
You could possibly try a "hack" towards solving this in the form of player.hurt(-number);, still seems strange not to be working however, I recall having issues where using "this." as opposed to "player." within player classes and more specifically the same with "this.hearts" within Gani Attribute scripts which fixed by changing it to "player.", could possibly be the solution here aswell.
Reply With Quote
  #10  
Old 07-17-2010, 01:24 AM
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
I've never had problems using 'this' to refer to the player which a player class is joined to—it's the preferable way to do it. There may be some weird problem with hearts though. I've never scripted with the classic heart system (and don't really know why anyone would want to).
__________________
Reply With Quote
  #11  
Old 07-17-2010, 03:43 AM
Cloven Cloven is offline
Delteria
Cloven's Avatar
Join Date: Dec 2006
Location: Florida, United States
Posts: 542
Cloven has a spectacular aura about
Send a message via AIM to Cloven
Quote:
Originally Posted by cbk1994 View Post
I've never had problems using 'this' to refer to the player which a player class is joined to—it's the preferable way to do it. There may be some weird problem with hearts though. I've never scripted with the classic heart system (and don't really know why anyone would want to).
Yeah my guess is it's some weird problem with hearts, if anything. We have multiple scripts that refer to the player as 'this' without issue.
Reply With Quote
  #12  
Old 07-17-2010, 10:26 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
lets hope stefan fixes it!!!
__________________
Reply With Quote
  #13  
Old 07-17-2010, 12:18 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
It is indeed a "problem" with the default hearts system. Many default systems seem to be coded in a hackish way. This specific problem is just related to the "no heals for PKers" thing. Another hackish implementation is the heart dropping stuff when lifting a pot. Try adding the default pot tiles to a level, and change them to the "pot lifted" tiles using the two-dimensional tiles array and updateBoard(). Doing so will drop a heart.
__________________
Reply With Quote
  #14  
Old 07-17-2010, 06:45 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
Quote:
Originally Posted by Crow View Post
Doing so will drop a heart.
Graal never ceases to amaze me...
__________________
Reply With Quote
  #15  
Old 07-17-2010, 06:47 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
lol no way

Stefan please fix for v6 this aint cool
__________________
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 04:38 PM.


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