A few bug reports (7/27/22)

Not sure if bug-fixing is really a priority (these end up being pretty niche), but I figure it's my duty to give back a little and report what I find, given how helpful people have been:

Bug 1:

the following script produces tempvar="cardbleachcard"(wrong) instead of tempvar="cardbleach" (right)

tempvar=0//I set this to zero for debugging; in the program it would be either 0 or the name of a card. 
if tempvar==0 then

I thought maybe it runs both conditions sequentially (also a bug), but actually it's worse than that, because this produces the same thing:

if tempvar!=0 then

It looks like instructing an if-then statement to alter the variable referenced by the if-condition causes the function to run twice. I changed it to this and it fixed the problem:

if tempvar!=0 then

Bug 2:

My program told a 0fps tile to

frame 2

When the tile had only 1 frame (i.e. "frame 0"), this caused no problems, even though the tile obviousy couldn't switch to the non-existent frame 2.

I subsequently added a second frame to the tile (i.e. "frame 1"). Telling a tile with 2 frames to "frame 2" caused massive visual glitches. The tile turned black, but instead of staying black it copied whatever was drawn on top of it last, causing the classic "curser trails" phenomenon seen since Windows 3.1 when your computer freezes but the mouse keeps moving.

This one could honestly be a VERY cool effect for some games, but it did cause massive slowdown on my PC, at least for the moment when I told the tile to "frame 2."

I fixed this by duplicating frame0 to create a frame2 that looks exactly like frame0 for that tile.

Bug 3 (from the discord, not my discovery):

Normally, using multiple "goto" instructions in a single cycle produces proper behavior, e.g.:

goto 3,5
goto 4,9

This code correctly leaves the player at 4,9, not 3,5.

However, telling the player to go to two different rooms only executes the first room-change and ignores any subsequent goto-room commands.

goto 3,5 in "room1"
goto 4,9 in "room 2"

If the player starts outside room1, the above code improperly leaves the player at 3,5 (not 4,9) in room1. If the player starts in room1, it sends the player first to 3,5 in room1(you can see it happen onscreen), then sends the player to room2. This means that if you run the above code two separate times (e.g. "on confirm" with two separate button presses) then the code will first send the player to 3,5 in room 1 and then send the player to 4,9 in room 2.

This bug does not affect goto commands sending the player to the room they are already in. So, if the player is in room1, then:

goto 1,1 in "room1"
goto 2,2 in "room1"
goto 3,3 in "room2"
goto 4,4 in "room3"

the above code would execute the first three goto functions, then ignore the last one. I'm pretty sure that's not intended behavior. It definitely would go against the intentions of the person writing the code, since it is not documented. You could imagine a long series of if-conditions or event-calls that should leave the player in a certain place, but seem to randomly work or not work based (unknow to the dev) on where the player starts when the code is run.

Anyways. Anyone else have bugs to share?

Actually bug2 clearly has some other special conditions attached to it, since it only happens in my game, but the effect is too cool not to share (note that the images leaving shadows are tile draws, not tile swaps):
Screen_Recording_20220727-181415_Samsung Internet_4
Screen_Recording_20220727-181415_Samsung Internet_5
Screen_Recording_20220727-181415_Samsung Internet_6

Also, totally unusable in practice, since this tanked my fps and made the game take ages to load.
Playcee's mod 0.7 - shadow glitch.zip (35.0 KB)

Edit: I've since just started using the bug-report form in the stickied post, but I figure adding things here will at least be searchable for people wondering what's going on:

Just submitted a bug for the "ask...then" function. Any code in the function that is not inside an option will run twice: once when the question is asked (appropriate, for setting up the options) and a second time when an option is chosen.

If you're careful to create your own "local" variables that won't matter after the question, this is no big deal, but if you have any variable++, etc. in your script and expect it to only run once, you'll be disappointed.

This can be really hard to spot, since many things may appear to run fine. For example, if you wrote
ask "Are you having fun?" option1 "Yes." end option2 "Yes!" end say "thanks for answering my question" end
It would appear to run only once because the first "say" would be covered up by the "ask" box.

Another user helped me understand that any script you put in "ask...then...end" is really only for setting up the options, so you can't put any steps that are supposed to happen after the question there, unlike "ask."

Thanks, we'll take a look at these!