Simple Tiled Implementation - STI v1.2.3.0

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Positive07 »

Glad I could help! <3
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
Crossing
Prole
Posts: 42
Joined: Sat Mar 21, 2015 3:37 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post 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?
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post 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()
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Crossing
Prole
Posts: 42
Joined: Sat Mar 21, 2015 3:37 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Crossing »

Thanks so much!
User avatar
Daniel Eakins
Citizen
Posts: 99
Joined: Thu Jul 18, 2013 9:14 pm
Location: France

Re: Simple Tiled Implementation - STI v0.16.0.3

Post 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?
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post 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)
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Daniel Eakins
Citizen
Posts: 99
Joined: Thu Jul 18, 2013 9:14 pm
Location: France

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Daniel Eakins »

Awesome thanks for the quick reply :D
Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

Re: Simple Tiled Implementation - STI v0.16.0.3

Post 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.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post 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.
Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

Re: Simple Tiled Implementation - STI v0.16.0.3

Post 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?
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 2 guests