How to install STI

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
arr5454
Prole
Posts: 5
Joined: Tue Oct 20, 2015 9:09 pm

How to install STI

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

Re: How to install STI

Post by Karai17 »

I suspect you're not very familiar with Lua. I would recommend reading a few chapters of Programming in Lua.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
arr5454
Prole
Posts: 5
Joined: Tue Oct 20, 2015 9:09 pm

Re: How to install STI

Post by arr5454 »

Oh, I figured it out. I was over-thinking it, thank you!
eitanbron
Prole
Posts: 4
Joined: Thu Mar 02, 2017 11:23 am

Re: How to install STI

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

Re: How to install STI

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

Dev Blog | GitHub | excessive ❤ moé
eitanbron
Prole
Posts: 4
Joined: Thu Mar 02, 2017 11:23 am

Re: How to install STI

Post 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!.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: How to install STI

Post 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.
eitanbron
Prole
Posts: 4
Joined: Thu Mar 02, 2017 11:23 am

Re: How to install STI

Post by eitanbron »

Thanks for the Info bartbes!
Post Reply

Who is online

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