Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Bugs : Unique case regarding Custom Equipment scripts in battle
New Topic New Poll Post Reply
Poster Message
TFMurphy
Level: Smitemaster
Rank Points: 3023
Registered: 06-11-2007
IP: Logged
icon Unique case regarding Custom Equipment scripts in battle (+2)  
Here's a fun little bug, based around Custom Equipment that tinker with stats and go to level entrances under certain conditions.

As a full example, let's say the player has a Custom Armor with the following script:
  Each defend "Defend"
  Go to "End"
Label "Defend"
  If ... 
        Wait until var _HP < 1
     Set var _HP = 1
     Go to level entrance "Hospital: Once West: Waking up"
  If End 
Label "End"

Now, right-clicking on an enemy that you cannot kill in one hit will start causing problems. You will get the Expected Damage of Death, even if you would easily survive the fight and not trigger the Level Entrance move. On top of this, various effects may occur immediately after this, including any movement causing the previous movement to replay, or the Go to Level Entrance command being run, or similar. Undoing from this can also cause problems, like completely removing the last enemy you killed in such a way that restarting the room doesn't cause it to reappear.

Whilst the "Go to Level Entrance" command is obviously the major trigger for this, it's not the only problem. If you remove the command, for example, and leave this piece of equipment as something that keeps your HP at a minimum of 1, then the Expected Damage for all fights where you take any damage at all is Death, even if you would come nowhere near the amount of HP needed to activate the condition. (Attacking a Roach when you have 40 ATK and 10000 HP, as an example, would still show an Expected Damage of Death.)

I realise this is a rather unorthodox use of custom equipment, but having it work as you might expect from the code could allow for some very interesting behaviour, and at the very least, the bugs resulting from this need to be closed up somehow.
01-19-2009 at 06:19 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 4443
Registered: 02-04-2003
IP: Logged
icon Re: Unique case regarding Custom Equipment scripts in battle (0)  
Thanks for reporting this. The root of this problem appears to be that projecting damage from a duel starts the player with a theoretical HP of UINT(-1) (maximum unsigned 32-bit integer), in order to see how much damage the player might take. This causes the shield script query for player HP < 0 to inadvertently trigger on the first round of combat.

Starting the predicted combat at MAX_INT instead of UINT(-1) won't cause the "hospital" event to trigger. I couldn't see any other problems occurring after this fix was applied. I'll consider this fixed in rev 145.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
01-23-2016 at 12:50 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 1602
Registered: 07-11-2014
IP: Logged
icon Re: Unique case regarding Custom Equipment scripts in battle (+2)  
I can confirm that checking for HP values of less than 1 inside an equipment use label doesn't cause any problems, and triggers when you'd expect in 1.2.3.148 :thumbsup

I tried a couple of things, including fighting monsters with the maximum possible attack value, and was never able to get the expected damage to mess up or otherwise cause issues. :thumbsup

EDIT: No wait, it looks like a roach egg that I don't have enough damage to hurt gives a predicted battle result of "Death", which is clearly untrue because it has 0 attack. :no In build 57 it showed "Cannot be hurt by your attack" instead.

[Last edited by kieranmillar at 01-24-2016 07:31 PM]
01-24-2016 at 06:10 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 4443
Registered: 02-04-2003
IP: Logged
icon Re: Unique case regarding Custom Equipment scripts in battle (0)  
quote:
kieranmillar wrote:
EDIT: No wait, it looks like a roach egg that I don't have enough damage to hurt gives a predicted battle result of "Death", which is clearly untrue because it has 0 attack. :no In build 57 it showed "Cannot be hurt by your attack" instead.
Good catch! This is a regression introduced in rev 145 (support for scripted checks for negative HP during combat projections). Fixed in rev 152.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
01-26-2016 at 04:31 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 1602
Registered: 07-11-2014
IP: Logged
icon Re: Unique case regarding Custom Equipment scripts in battle (+1)  
quote:
mrimer wrote:
quote:
kieranmillar wrote:
EDIT: No wait, it looks like a roach egg that I don't have enough damage to hurt gives a predicted battle result of "Death", which is clearly untrue because it has 0 attack. :no In build 57 it showed "Cannot be hurt by your attack" instead.
Good catch! This is a regression introduced in rev 145 (support for scripted checks for negative HP during combat projections). Fixed in rev 152.

Can confirm fixed in 1.2.3.152 :thumbsup
01-26-2016 at 10:50 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD RPG Boards : RPG Bugs : Unique case regarding Custom Equipment scripts in battle
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.