Issue With Saved Slices

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Gizmog
Metal King Slime
Posts: 2622
Joined: Tue Feb 19, 2008 5:41 am

Issue With Saved Slices

Post by Gizmog »

I forget if I've already reported this. I also mentioned it in IRC, but I didn't want it to get lost in the shuffle. Sorry if I'm seeming naggy/needy/insistent, and note that I have absolutely nothing in the works that relies on this behavior.

Basically, when you load a game with the "Save Script Slices" thing active, the Slice Layer is in a different place than it is otherwise.

I used this script to demonstrate.

Code: Select all

include, plotscr.hsd

plotscript,NewGame,begin
#This is the New-Game special plotscript
#Create a big red circle on new game
CreateEllipse (320,320,88,88)
end

plotscript,LoadGame,begin
#This is the Load-Game special plotscript and isn't necessary
#Creates a big brown circle on new game
CreateEllipse (320,320,104,104)
end
On New Game, there'll be a HUGE red circle on the screen. Hit Ctrl+F4 and look at the Slices. If I'm reading it correctly, a Script Slice will be ABOVE backdrops but BELOW textboxes and strings. Now save your game, quit, and load. There'll be a huge brown circle on the screen: The brown circle was drawn later, so it makes sense for it to be on top. This is expected behavior.

What's unexpected is the position of the Script-Layer. It's now at the very bottom of the list, meaning that your Scripted Slices are drawn OVER Textboxes and strings. I did a little testing and found that this mis-positioning persists on map changes. Potentially very bad!

I also did some testing and found that with "Save Script/Sprite Layer slices" set to NO, this repositioning doesn't happen.

So to cut it down to the simplest reproduction, you don't even need scripts, just the ability to save the game...

Step 1: In custom, Turn "Save Script/Sprite Layer Slices" to YES
Step 2: Start a new game and hit Ctrl+F4 to open the slice editor. Note the position of the Script Layer.
Step 3: Save game, quit game, load game.
Step 4: Note the position of the Script Layer. It's changed!

I tried fighting battles and changing maps: Neither reverted it to the default behavior.

If I already reported this, I'm sorry.
Attachments
Demonstration of behavior. Note the position of ScriptLayer relative to Textbox and String layer after loading game.
Demonstration of behavior. Note the position of ScriptLayer relative to Textbox and String layer after loading game.
SliceSaveTest0001.png (52.92 KiB) Viewed 412 times
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7660
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Thanks for mentioning this!

I do not remember you reporting it before.

We will definitely need to fix this
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7660
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

This turned out to be an easy one-line fix. Thank you for spotting the bug! :)

I am rebuilding the nightly right now, so you can test.
User avatar
Gizmog
Metal King Slime
Posts: 2622
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

Sorry it took me so long to get back, but I can confirm that the bug is fixed as of latest nightlies. Good job!
Post Reply