I am new to coding and scripting, I ran into a problem when trying to load my map. I tried to find the solution myself, but nothing seemed to work. The error was:
s_ti/sti/init.lua:44: attempt to perform arithmetic on global 'st_i' (a nil value)
Full code: https://gist.github.com/BansheeSonic/01 ... e9f4d8aa63
If you can send me a fixed version, that would be great.
Thanks for helping!
Trying to load a Tiled map with STI
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Trying to load a Tiled map with STI
You're missing the quote marks, that should be a string.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Trying to load a Tiled map with STI
where do i put them?
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Trying to load a Tiled map with STI
Code: Select all
local map = setmetatable(love.filesystem.load(st_i/sti/map.lua)(), Map)
Code: Select all
local map = setmetatable(love.filesystem.load('st_i/sti/map.lua')(), Map)
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Trying to load a Tiled map with STI
Welcome to the forums.
You tried to edit the library itself, thats not how it works. To learn how you use it look at the quick example in the description of the library on github or try this tutorial.
If you're completely new to lua and LÖVE I would recommend you to learn the language (lua) and some basics with LÖVE before looking further into the matter.
You tried to edit the library itself, thats not how it works. To learn how you use it look at the quick example in the description of the library on github or try this tutorial.
If you're completely new to lua and LÖVE I would recommend you to learn the language (lua) and some basics with LÖVE before looking further into the matter.
Re: Trying to load a Tiled map with STI
I've been actually using that tutorial for my game, thats how I found out about STI. I still got an error on the same line: loader/sti/init.lua:44: attempt to call a nil value, is this one of the new errors that would pop up?
Re: Trying to load a Tiled map with STI
Your line
seems to don't match up with the original line of the file of the library (newest on github), which is
I would say that this is the reason. maybe its a different version or you altered the path of the library (or the line above).
Make sure that there is the right file in your project folder, which should be ../st_i/sti/map.lua if the above line is correct.
If you still got problems feel free to upload your project.
Code: Select all
local map = setmetatable(love.filesystem.load('st_i/sti/map.lua')(), Map)
Code: Select all
map = setmetatable(love.filesystem.load(map)(), Map)
Make sure that there is the right file in your project folder, which should be ../st_i/sti/map.lua if the above line is correct.
If you still got problems feel free to upload your project.
Re: Trying to load a Tiled map with STI
I saw another post where someone added an addition folder to put the original STI file in, the only errors he had was just some typos. Thats why I tried the same thing but with my file names. I guess i'm wrong.
Heres the project: http://www.mediafire.com/folder/i7c4a8brwodf9/game
Heres the project: http://www.mediafire.com/folder/i7c4a8brwodf9/game
Re: Trying to load a Tiled map with STI
You can upload files on the forum next time, there is an attachments tab below the (full) text editor box.
If possible create an *.love file as stated here and upload it.
Also your mediafire folder just contains an mp3 song. You might want to double check that
If possible create an *.love file as stated here and upload it.
Also your mediafire folder just contains an mp3 song. You might want to double check that
Re: Trying to load a Tiled map with STI
I cant send you the whole file containing everything, if you need another file from me just tell me.
Who is online
Users browsing this forum: Bing [Bot] and 2 guests