Simple Tiled Implementation - STI v1.2.3.0

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Karai17
Party member
Posts: 892
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.6.9

Post by Karai17 » Sat Jan 25, 2014 3:21 pm

I'm glad you're finding my library useful! I'm using an early January build of Tiled, but animated tiled were recently added (January 23rd) so I think I'll be installing that one today. :)

I also just pushed a new release (0.6.10) of STI that dramatically improved the load time for maps. Check out the latest benchmarks!
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé

User avatar
UberBosser
Prole
Posts: 4
Joined: Sat Jan 25, 2014 7:13 pm

Re: Simple Tiled Implementation - STI v0.6.10

Post by UberBosser » Sat Jan 25, 2014 7:30 pm

Hello, im new to love2D and lua. Does this library support love2D 0.9.0? i keep getting this error:

Code: Select all

main.lua:5: attempt to call global 'require'(a string value) 

this is the line 5 of my main.lua file : local sti = require "sti"

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Simple Tiled Implementation - STI v0.6.10

Post by Robin » Sat Jan 25, 2014 8:16 pm

What are the four lines before it? It's likely to be a problem with your code, rather than with STI.
Help us help you: attach a .love.

User avatar
UberBosser
Prole
Posts: 4
Joined: Sat Jan 25, 2014 7:13 pm

Re: Simple Tiled Implementation - STI v0.6.10

Post by UberBosser » Sat Jan 25, 2014 8:27 pm

The first 5 lines are =

Code: Select all

2: x, y = 400, 300 3: playerA = nil 4: require = "data"  5: local sti = require "sti"

User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

Re: Simple Tiled Implementation - STI v0.6.10

Post by Kingdaro » Sat Jan 25, 2014 9:23 pm

You've overwritten the require function by setting it to "data". Use a different variable name.

User avatar
Nixola
Inner party member
Posts: 1940
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Simple Tiled Implementation - STI v0.6.10

Post by Nixola » Sat Jan 25, 2014 9:24 pm

The problem lies in the fourth line: require = "data" makes the global variable "require" point to the string "data", in fact preventing you from accessing the require[d, ha ha pun] function. Remove that line, or assign the string to another variable

Fake edit: ninja'd
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

User avatar
UberBosser
Prole
Posts: 4
Joined: Sat Jan 25, 2014 7:13 pm

Re: Simple Tiled Implementation - STI v0.6.10

Post by UberBosser » Sat Jan 25, 2014 9:28 pm

Kingdaro wrote:You've overwritten the require function by setting it to "data". Use a different variable name.
Thanks, but now how do i create the map .lua file, do i just change the the .tmx file to .lua or do i need to do it differently? Are there any Tutorials online? Thanks for everything.

User avatar
Karai17
Party member
Posts: 892
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.6.10

Post by Karai17 » Sat Jan 25, 2014 9:46 pm

Thanks for checking out my library! If you click File, then Export, you can export your TMX to a Lua file. Alternatively, ctrl+E will also bring up the Export menu.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé

User avatar
UberBosser
Prole
Posts: 4
Joined: Sat Jan 25, 2014 7:13 pm

Re: Simple Tiled Implementation - STI v0.6.10

Post by UberBosser » Sun Jan 26, 2014 2:17 am

Ok, so its all working but... Its hiding my player. How do i make a tile solide and how do i make one "not solid" do i do it directly in Tiled or then code it in in the main.lua. Sorry for the newby Question :P

User avatar
Karai17
Party member
Posts: 892
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.6.10

Post by Karai17 » Sun Jan 26, 2014 10:42 am

Draw order is important. If you are drawing your player before you are drawing the map, then the map will be on top. I've included the ability to place objects such as your player within the map itself, giving it a proper draw order. Check out the Callbacks section of the documentation for an example.

If you're referring to "solid" as in a collidable tile where the player cannot move, you can create a Collision Map with STI, but you need to write your own collision code to work with that map.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests