SETSHOEBOX not working correctly.... {was missing command feature}

Previous topic - Next topic

spacefractal

I found what it happens, and its a glbasic bug.

Its happens when you use it together with GENSPRITE(), then its will fail to open the file. There is nothing wrong with SETSHOEBOX its self, but its more LOADSPRITE and other commands that use it.

Here is the code that fail to work:

Code (glbasic) Select

DEBUG "File Exist : "+DOESFILEEXIST("Media/gpx.sbx")+"\n"
SETSHOEBOX "Media/gpx.sbx","Media/gpx.sbx"
LOCAL a=GENSPRITE() // <- that trick the bug.
LOADSPRITE "gffd/untitled.jpg",0
LOADSPRITE "fhjjfcb/untitled.png",a
SETSHOEBOX "",""
DRAWSPRITE 0,0,0
DRAWSPRITE 1,256,256
SHOWSCREEN
KEYWAIT


Greedy Mouse is heavy based on GENSPRITE(), so that is why its failed to get working correctly with SETSHOEBOX.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrTAToad

There is a slight problem with your code.  As today's exercise, I'll let you find out why nothing is being display.  Will give you one clue though : GENSPRITE values don't start at 0 :)

spacefractal

#17
yes there was a spelling, ups =D, but its still not work in Greedy Mouse as excepted. Its can open fine (images shown) directly, but still not when using them using regular code. Strange. Its might been somewhere SETCURRENTDIR issue or something like that (even SHOEBOX is open fine and keeps that before using that command). I look future what happens.

But somethings more compliced.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

#18
here is a screenshot: (yes the REPLACE part is a bit messy, but irrerevent here).

I'm are not trying to load a file here in this test, only trying get thier GETFILESIZE (jpg should fail, not png):


EDIT: I did not shown the full path on the second Explore, buts its was correct. Graphics folder was renamed after the shoebox test.

EDIT2: I'm still not 100% sure what happens (its NOT GETSPRITE(), its was a silly mistake, hehe), but something other conflict).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrTAToad

I don't think GETFILESIZE works with shoeboxed files...

Slydog

Could you just use 'DOESFILEEXIST()' instead?
It looks like you're just checking to see if the file exists by seeing if the size is > 0.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

spacefractal

its that.

its GETFILESIZE(), which I meants its have works before (but was long time ago), also DOESFILEEXISTS() not either. And yes I just used GETFILESIZE() for file exists check, since I first noticed doesfileexists recently, propterty because both do the same job really (what I used them for here).

So its turned to just been a missing feature, not a bug.

Sorry if I sound negative og aggresive, that was never intendend, but also thanks for all help.

Its now 100% totally to Gernot if he want to add those missing features to v11  :).

EDIT: Renamed to more precision title.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrTAToad

Yes, DOESFILEEXIST doesn't work with Shoeboxes :)

If you want to make sure a sprite has loaded, check it's size...  If it's 0 then there was a problem...