Page 55 of 92

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Tue Aug 23, 2016 11:24 pm
by Positive07
Glad I could help! <3

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Sun Aug 28, 2016 11:01 pm
by Crossing
Yeah. So I have my code setup like on the tutorial at Luaspace. My map is in the correct directory. However it's saying when I try to add a new map "attempt to call field "new" (a nil value)" any suggestions?

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Sun Aug 28, 2016 11:03 pm
by Karai17
The API was slightly changed and my pull request to the tutorial hasn't been approved yet. You simply want to do sti() instead of sti.new()

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Sun Aug 28, 2016 11:18 pm
by Crossing
Thanks so much!

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Thu Sep 01, 2016 6:58 pm
by Daniel Eakins
Hey Karai, I've been slowly getting back into coding and I'm kinda embarrassed because I can't get this module to work anymore :?

More specifically, I don't know what to put in the functions to refer to a layer!

For example, just taking the example demo on GitHub and replacing this one line:

Code: Select all

map:draw()
with this:

Code: Select all

map:drawLayer("Grid")
gets me an error:
sti/init.lua:698: attempt to perform arithmetic on field 'opacity' (a nil value)
Am I doing it wrong or is there a bug maybe?

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Fri Sep 02, 2016 3:37 am
by Karai17
drawLayer is looking for a layer object, not just the layer name.

Code: Select all

local layer = map.layers["Grid"]
map:drawLayer(layer)

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Fri Sep 02, 2016 10:57 am
by Daniel Eakins
Awesome thanks for the quick reply :D

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Fri Sep 02, 2016 4:01 pm
by Zireael
How does one create a texture atlas in Tiled? I was going to take STI for a spin and it spat out that it doesn't support tilesheets, only texture atlases.
P.S. My Tiled for some reason set itself to the system language, so tell me not only the button name, but where to find it.

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Fri Sep 02, 2016 4:07 pm
by raidho36
Tilesheet is an atlas, just built using different conventions. Try running it through atlas generating software, load final final atlas and define sprites in it manually. If that won't work, you can always just feed tiles into it one by one and it'll generate proper atlas.

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Fri Sep 02, 2016 4:27 pm
by Zireael
raidho36 wrote:Tilesheet is an atlas, just built using different conventions. Try running it through atlas generating software, load final final atlas and define sprites in it manually. If that won't work, you can always just feed tiles into it one by one and it'll generate proper atlas.
I don't know any such software - any tips?

Maybe there's a sample working map somewhere I could throw at STI to see how it works?