Post new topic    
Page «  1, 2
Metal King Slime
Send private message
 
 PostThu Feb 13, 2020 4:38 pm
Send private message Reply with quote
My guess is that "free slice (screen menu)" appears to do nothing because you have loaded the slice collection multiple times, which can happen if you load it e.g. in map autorun scripts instead of the new game script. Each time you load it, a new set of slices is created, and it will exactly overlap the previously loaded menu slices if they already existed, so you can't see the difference. Use the slice debugger/in-game slice editor (Ctrl-F4) to check if this is happening.

If this is the problem, then you need to be careful not to load it multiple times. You could write:
Code:
if (screen menu == 0) then (screen menu := load slice collection (##))

and write "screen menu := 0" whenever you delete the screen menu slice. (By the way, in "General Game Settings -> Saved Games", turn on "Save script/sprite layer slices")
Or, you could use "lookup slice" to check whether the slice already exists.

The only other possible cause is that "screen menu" doesn't contain the correct slice handle. You should have written "screen menu:= load slice collection (##)" when loading it.

You can use "lookup slice" on a loaded slice collection. (Note that once a slice collection is loaded, it's no different from any other set of slices. The engine doesn't record that they were part of a slice collection.)
In the slice collection editor, press F5. This will show the root slice of the collection. "load slice collection" returns a handle to a copy of the root slice. Give this slice a lookup code, then you can use "lookup slice" to get a handle to the collection after loading it, even if you didn't save the handle returned by "load slice collection".
Display posts from previous:
Page «  1, 2