Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Bugs : Monster don't move after undo (An unusual bug?)
New Topic New Poll Post Reply
Poster Message
komachi
Level: Master Delver
Rank Points: 172
Registered: 07-30-2012
IP: Logged

File: It dont move.drh (1.1 KB)
Downloaded 57 times.
License: Public Domain
icon Monster don't move after undo (+1)  
I have a script which makes a monster unkillable, it set another appearance to the monster when you kill him and then, he move to the player. The code is:
    Set var "_MyHP" = 90
  Set var "_MyATK" = 1
  Behavior Face Target
  Imperative Unkillable
  Wait for defeat 
  Wait 1
  Imperative Killable
  Set appearance gel baby
  Set var "_MyHP" = 100
  Set var "_MyATK" = 10
  Move to Player 0,0

If you exit the room, re-enter with the gel baby and you use undo, the gel baby won't move for the rest of the room until you re-enter again.
Here is a hold with a custom pirate that when you kill him it turns into a gel baby (with other stats).

I use a gel baby as example, it happens the same with any monster.
I'm using the last build (1.2.3.98).
01-13-2016 at 10:53 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
Doom
Level: Smitemaster
Avatar
Rank Points: 3323
Registered: 07-05-2004
IP: Logged
icon Re: Monster don't move after undo (0)  
Found about this after running into it in the recently released hold "Great place". I've tested this more and narrowed down the cause to "Set appearance" command inside a custom character's default script (same script on a regular character works fine).

Here's a simplified example of the same thing:
Create a new custom character "Moving roach" and give it the following default script, then follow komachi's directions.
Set appearance Roach
Move to Player 0,0
I suspect that this'll cause score verification issues because it's easy to trigger and lets you skip some enemies. We could probably try patching the hold to work around the bug (remove the "Set appearance" command from Temple guardians and maybe replace it with a MyColor change or something that doesn't break the universe), since I doubt there will be game patches anytime soon.

[Last edited by Doom at 04-16-2018 01:34 PM]
04-16-2018 at 01:23 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
komachi
Level: Master Delver
Rank Points: 172
Registered: 07-30-2012
IP: Logged
icon Re: Monster don't move after undo (0)  
To be honest, I totally forgot about this bug. I can upload again the hold fixing this if it's needed.

[Last edited by komachi at 04-22-2018 07:46 PM]
04-22-2018 at 07:46 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
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5166
Registered: 02-04-2003
IP: Logged
icon Re: Monster don't move after undo (0)  
Just noticed this topic. Is there an outstanding issue that still exists in the latest 1.2.8 dev build?

If so, would someone please clarify what's the experienced issue and what the expected behavior should be? Thanks!

____________________________
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.
11-10-2020 at 07:37 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
Doom
Level: Smitemaster
Avatar
Rank Points: 3323
Registered: 07-05-2004
IP: Logged

File: Movement Bug Test.drh (970 bytes)
Downloaded 51 times.
License: Public Domain
icon Re: Monster don't move after undo (+1)  
Yes, this bug still exists in the latest dev build.

Komachi's example contains some irrelevant details, here's a much simpler test hold.

Reproduction steps:

- Start a new game
- Enter 1N
- Walk a couple of steps and undo. The roach's movement is reverted. This is the expected behavior.
- Leave 1N
- Enter 1N again
- Walk a couple of steps and undo. The roach teleports to its starting location and stops moving. This is the broken behavior.

As mentioned in my older post, this happens only if the command "Set appearance" is used inside a custom character's default script.

[Last edited by Doom at 11-10-2020 08:48 PM]
11-10-2020 at 08:32 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
Doom
Level: Smitemaster
Avatar
Rank Points: 3323
Registered: 07-05-2004
IP: Logged
icon Re: Monster don't move after undo (+1)  
A little bump, since this kinda got forgotten after Mike started looking into it, and a lot of other RPG things have got fixed recently.

I've checked that this is still happening on all the latest builds (both stable and beta).
06-18-2023 at 10:19 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: 3019
Registered: 07-11-2014
IP: Logged
icon Re: Monster don't move after undo (+1)  
07-25-2024 at 06:53 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 3019
Registered: 07-11-2014
IP: Logged
icon Re: Monster don't move after undo (0)  
Ooops, I thought my change fixed this, but instead I had changed the test case while debugging and was no longer showing the bug. The bug is still happening in Doom's provided example after my PR.
07-26-2024 at 04:38 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 3019
Registered: 07-11-2014
IP: Logged
icon Re: Monster don't move after undo (0)  
I've discovered that when it comes to process the character's commands after undoing, the command index is still what it should be, but the character's list of commands is empty.

If you leave the room again after triggering the undo bug and re-enter, the monster goes back to moving, until you undo again, so the commands aren't permanently lost against the character, they just get temporarily wiped out somehow.

[Last edited by kieranmillar at 07-26-2024 11:47 PM]
07-26-2024 at 11:46 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 3019
Registered: 07-11-2014
IP: Logged
icon Re: Monster don't move after undo (0)  
When the monster is saved into the room db, there's an extra var called NumCommands that's saved (search for numCommandsStr), to say how many commands the monster has. This is only done if the monster is a Character type, as it's a part of Charatcer.cpp. This is recovered correctly when you re-enter the room.

However, when you undo and reload the room, this value is now 0, therefore it doesn't load the character's scripts.

This must be happening because the character is no longer considered a Character type, but the type is the monster you've changed appearance to, so despite loading at room start, something about reloading the room decides to not save down this numCommands extra var.

[Last edited by kieranmillar at 07-28-2024 11:08 PM]
07-27-2024 at 01:22 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 3019
Registered: 07-11-2014
IP: Logged
icon Re: Monster don't move after undo (+1)  
When the room is reloaded from an undo, the character has no pCustomChar, which means the default script is not loaded.
07-29-2024 at 01:18 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 3019
Registered: 07-11-2014
IP: Logged
icon Re: Monster don't move after undo (+2)  
07-30-2024 at 11:30 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 3019
Registered: 07-11-2014
IP: Logged
icon Re: Monster don't move after undo (+2)  
08-23-2024 at 03:01 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 3019
Registered: 07-11-2014
IP: Logged
icon Re: Monster don't move after undo (+2)  
PR Take 4 (sigh)
12-18-2024 at 04:30 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 : Monster don't move after undo (An unusual bug?)
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.