Page 1 of 1

Not Tiled doesn't work with sti

Posted: Tue Aug 22, 2023 8:43 pm
by Ominitrin
My code:

Code: Select all

io.stdout:setvbuf("no")
local love = _G.love
local sti  = require "sti"
local map, world, tx, ty, points

function love.load()
	map = sti("Map/export.lua",  { "box2d" })
end


I just load the map, but there is a error:
Error

sti/utils.lua:195: Could not open file ../assets/block1.png. Does not exist.


Traceback

[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'newImageData'
sti/utils.lua:195: in function 'fix_transparent_color'
sti/init.lua:106: in function 'init'
sti/init.lua:48: in function 'sti'
main.lua:7: in function 'load'
[love "callbacks.lua"]:136: in function <[love "callbacks.lua"]:135>
[C]: in function 'xpcall'
[C]: in function 'xpcall'

Someone can explain why this happen with just not tiled map? In the same maps in tiled this error doesn't happen.

Re: Not Tiled doesn't work with sti

Posted: Thu Aug 24, 2023 9:08 pm
by dusoft
Ominitrin wrote: Tue Aug 22, 2023 8:43 pm sti/utils.lua:195: Could not open file ../assets/block1.png. Does not exist.
Clearly some file is missing, check the directory and the file stated. The location path might be off, too.

Re: Not Tiled doesn't work with sti

Posted: Sat Aug 26, 2023 9:31 pm
by Ominitrin
dusoft wrote: Thu Aug 24, 2023 9:08 pm
Ominitrin wrote: Tue Aug 22, 2023 8:43 pm sti/utils.lua:195: Could not open file ../assets/block1.png. Does not exist.
Clearly some file is missing, check the directory and the file stated. The location path might be off, too.
Sorry, but i checked the path and the file is in the path, it seems that sti cannot locate the file, even though it is in the default directory (lovegame) and this only happens with not tiled. Can you test, for verify if just me?

Re: Not Tiled doesn't work with sti

Posted: Sat Aug 26, 2023 10:49 pm
by zorg
The error shows that your image path contains a .. in it;

File paths can't contain .. as far as i know, so you might want to check some settings so that the paths for the images for your maps are referenced in a specific way.