Page 1 of 1

How to install STI

Posted: Tue Oct 20, 2015 9:20 pm
by arr5454
Hey everyone, this is my first post so please forgive me if this question has been answered already.

I couldn't find any instruction on how to install and configure Simple Tiled Implementation by karai17. If someone could explain or even direct me to a site with a tutorial, it would be much appreciated! If there is a better alternative to this Tiled Loader, I am open to suggestions as well. Thanks!

Re: How to install STI

Posted: Tue Oct 20, 2015 9:30 pm
by Karai17
I suspect you're not very familiar with Lua. I would recommend reading a few chapters of Programming in Lua.

Re: How to install STI

Posted: Tue Oct 20, 2015 10:11 pm
by arr5454
Oh, I figured it out. I was over-thinking it, thank you!

Re: How to install STI

Posted: Thu Mar 02, 2017 11:32 am
by eitanbron
Hello,
I am doing something wrong because i can not get it to work.

My main folder is called game. In that folder I have a sub folder called sti. I have copied to following files to this path /game/sti:
init.lua
utils.lua
bump.lua
box2d.lua

in my main.lua (which is in /game) I have typed in

local sti = require ("sti/init")
It does manage to get init.lua but it does not manage to load the other files. This is the error message which I get:
lua: ./sti/init.lua:18: module 'sti/init.utils' not found:
and then a long list of directories, which lua tries in vain.

what am I doing wrong?

Help is much appreciated.

Re: How to install STI

Posted: Thu Mar 02, 2017 5:43 pm
by Karai17
first off, use . instead of / for require. lua modules are a bit different from file paths.

second, Lua can require folders if the folder has an init file. so you only need to require "sti".

Re: How to install STI

Posted: Fri Mar 03, 2017 9:20 am
by eitanbron
Thank you very much for answering.
I have no idea what is exactly going on. Using love2d it works and there are no problems when I use require. When I try to just load it using Lua (version 5.2) it fails. Never mind this thing was made for LOVE. Thanks for the help!.

Re: How to install STI

Posted: Fri Mar 03, 2017 10:01 am
by bartbes
eitanbron wrote: Fri Mar 03, 2017 9:20 am Using love2d it works and there are no problems when I use require. When I try to just load it using Lua (version 5.2) it fails.
Hah, I knew this was going to come up.
Karai17 wrote: Thu Mar 02, 2017 5:43 pm second, Lua can require folders if the folder has an init file. so you only need to require "sti".
In versions of lua before 5.3 the default search path only looks for init.lua in system folders, and not in the local folders. Love's own (default) search paths do include init.lua in local folders.

Re: How to install STI

Posted: Fri Mar 03, 2017 3:37 pm
by eitanbron
Thanks for the Info bartbes!