Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Bugs : Undoing seems to cause problems with scripts
New Topic New Poll Post Reply
Poster Message
Dragon Fogel
Level: Smitemaster
Rank Points: 2434
Registered: 06-21-2014
IP: Logged
icon Undoing seems to cause problems with scripts (+1)  
I'm not sure of the exact cause, but when I was testing Hold Anonymous with the disarm token script, I heard error beeps if I tried to undo or use the R key after the script activated.

The script in question resets a disarm token in the room if it's active on Turn 0. However, when I hit R, the script didn't activate again. Also, when I killed a Soulless with my sword, and started undoing a few turns later, the Soulless came back to life on a turn after the one where I'd killed it.

What's more, the disarm script stopped working entirely after this. Then again, this bug might have meant that I wasn't triggering it properly any more.

I can't find an error log in my Steam files, unfortunately. It would probably be useful, since I heard a number of error beeps.
12-04-2016 at 06:36 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Dragon Fogel
Level: Smitemaster
Rank Points: 2434
Registered: 06-21-2014
IP: Logged
icon Re: Undoing seems to cause problems with scripts (+1)  
Tested my hold with the disarm token script (downloadable here) and the bug happens there, too. This might be useful for finding the problem.
12-04-2016 at 06:39 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: 2670
Registered: 07-11-2014
IP: Logged
icon Re: Undoing seems to cause problems with scripts (+2)  
Mike, this appears to be a problem with using "Activate Item At" onto a token on turn 0. This applies to all tokens (so vision, tarstuff switcher etc. too) but not to activating other items, like doors.

The tokens will be activated and the script appear to run fine until you try to undo or reset the room, at which points the scripts still execute but the activating of tokens seems to get queued up until the next turn. Script commands after the Activate Item At commands will still run on turn 0 as expected. When this happens, you get the following error message:

Assertion error in line 2190 of .\CurrentGame.cpp: "this->pendingTokenActivations.empty()"


Note that if you undo back to turn 0 and then press R when on turn 0, the activating of the tokens will fail completely on the next turn and none of them will activate.

If you undo back to turn 0 and then leave the room, the following error message gets posted 4 times (and the activations will not happen):

Assertion error in line 8177 of .\DbRooms.cpp: "GetTSquare(wX,wY) == T_OBSTACLE || bIsLight(GetTSquare(wX,wY))
 || GetTSquare(wX,wY) == T_TOKEN || GetTSquare(wX,wY) == T_KEY || bIsEquipment(GetTSquare(wX,wY))"


EDIT: Just to confirm there are no issues if you start the player on a token, it appears to be using the script command that's causing problems.

[Last edited by kieranmillar at 12-04-2016 12:13 PM]
12-04-2016 at 12:11 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: 5058
Registered: 02-04-2003
IP: Logged
icon Re: Undoing seems to cause problems with scripts (0)  
kieranmillar wrote:
Mike, this appears to be a problem with using "Activate Item At" onto a token on turn 0. This applies to all tokens (so vision, tarstuff switcher etc. too) but not to activating other items, like doors.
...
I've isolated the issue, and I think there are a few others tied to the same root cause.

Specifically, whenever a room is initialized and turn 0 logic occurs, there's certain event checks that should take place, which weren't.

In addition to checking for tokens being activated via scripting, I understand other areas impacted (i.e., skipped incorrectly) on turn 0 are posing a scripted question and NPC scripts checking for a particular event to occur.

Edit: Oh, also, to be clear, I see this issue can occur in many places in the code when initializing a room, such as starting the hold, a level entrance, loading a saved game, undoing a move and restarting a room. Needed to address all of these cases.

Fixed these oversights for 1.2.8 in this PR.

Other cosmetic events are also now checked in the abovementioned cases that weren't before (See the PR if you want code-level details), but I don't believe these will have any noticeable impact on gameplay at present.

____________________________
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.

[Last edited by mrimer at 09-25-2020 11:16 PM]
09-25-2020 at 11:09 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: 2670
Registered: 07-11-2014
IP: Logged
icon Re: Undoing seems to cause problems with scripts (+1)  
Can confirm you can now activate tokens on turn 0 and it works as expected in 1.2.8.alpha.2010-09-26.

Also tried undo, restarting the room, saving and loading on turn 0, and all worked correctly.

[Last edited by kieranmillar at 09-27-2020 12:27 PM]
09-27-2020 at 12:27 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 : Undoing seems to cause problems with scripts
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.