Page 5 of 92

Re: Simple Tiled Implementation - STI v0.6.9

Posted: Sat Jan 25, 2014 3:21 pm
by Karai17
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!

Re: Simple Tiled Implementation - STI v0.6.10

Posted: Sat Jan 25, 2014 7:30 pm
by UberBosser
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"

Re: Simple Tiled Implementation - STI v0.6.10

Posted: Sat Jan 25, 2014 8:16 pm
by Robin
What are the four lines before it? It's likely to be a problem with your code, rather than with STI.

Re: Simple Tiled Implementation - STI v0.6.10

Posted: Sat Jan 25, 2014 8:27 pm
by UberBosser
The first 5 lines are =

Code: Select all

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

Re: Simple Tiled Implementation - STI v0.6.10

Posted: Sat Jan 25, 2014 9:23 pm
by Kingdaro
You've overwritten the require function by setting it to "data". Use a different variable name.

Re: Simple Tiled Implementation - STI v0.6.10

Posted: Sat Jan 25, 2014 9:24 pm
by Nixola
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

Re: Simple Tiled Implementation - STI v0.6.10

Posted: Sat Jan 25, 2014 9:28 pm
by UberBosser
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.

Re: Simple Tiled Implementation - STI v0.6.10

Posted: Sat Jan 25, 2014 9:46 pm
by Karai17
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.

Re: Simple Tiled Implementation - STI v0.6.10

Posted: Sun Jan 26, 2014 2:17 am
by UberBosser
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

Re: Simple Tiled Implementation - STI v0.6.10

Posted: Sun Jan 26, 2014 10:42 am
by Karai17
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.