Simple Tiled Implementation - STI v1.2.3.0

Showcase your libraries, tools and other projects that help your fellow love users.
straydogstrut
Prole
Posts: 4
Joined: Mon Aug 22, 2016 10:12 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by straydogstrut »

Thanks Karai,

No worries, I realised putting my query on the end of this topic might mean it would be buried.. but I thought it might end up being useful to others.

Thanks for clarifying. I think that's where I was getting confused. As you said, the only thing your plugin is concerned with is the collidable property exported from Tiled. Everything else I was trying to do with other types of collisions is outside of that and really is what Bump is concerned with. I've managed to handle both cases a bit cleaner in the following code:

Code: Select all

-- override playerFilter function
local playerFilter = function(item, other)
	
local kind

	-- if the object of the collision has a properties table 
	-- (ie. it's been exported from Tiled with the collidable custom property)
	if other.properties ~= nil then
		kind = other.properties -- store a reference to the properties table to use with the filter
	else
		kind = other.name -- else store a reference to the object's name since it has no properties table 
					    -- (useful as we can set the 'name' manually or grab it from the object exported by Tiled)
	end
	
	if kind.collidable then -- if object.properties table has the collidable element
		return 'slide'
	elseif kind == 'spring' then -- if object.name is spring
		return 'bounce'
	elseif kind == 'hotspot' then -- if object.name is hotspot
		return 'cross'
	end
end -- end of playerFilter function

-- actually move the player, obeying collisons
player.x, player.y, cols, len = world:move(player, player.x, player.y, playerFilter)
Jimlarck
Prole
Posts: 14
Joined: Wed Sep 14, 2016 10:30 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Jimlarck »

Hey Karai, it's me (sorry). So it seems like STI is doing some weird drawrender stuff and I was wondering how to disable it or correct it. Here are some screenshots:
Screen Shot 2016-10-06 at 6.36.32 PM.png
Screen Shot 2016-10-06 at 6.36.32 PM.png (265.12 KiB) Viewed 5273 times
Screen Shot 2016-10-06 at 6.36.38 PM.png
Screen Shot 2016-10-06 at 6.36.38 PM.png (187.61 KiB) Viewed 5273 times
If I get a certain distance away it looks like it's not rendering some tiles and it looks a little off. I pm'd you my entire love project so you could look into it. When you run it you have to move down until you see the map (sorry, need to work on spawning the player in a certain tile, which speaking of which is there a prebuilt way to teleport players to a specific tiled coordinate?)
The map file I'm using is called 'improved gym.tmx'

Also, it looks like the map is also offsetting the objects(very slightly), it looks like it's shifting the objects up by one tile.
Screen Shot 2016-10-06 at 6.37.29 PM.png
Screen Shot 2016-10-06 at 6.37.29 PM.png (456.8 KiB) Viewed 5273 times
So any help with that would be appreciated. Anyway, sorry for bugging you!
User avatar
megalukes
Citizen
Posts: 94
Joined: Fri Jun 27, 2014 11:29 pm
Location: Brazil

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by megalukes »

I got an error using STI in Love for Android and I'd like to report it. I don't actually program love to mobile, but I friend of mine always tests our .love files in his cellphone and he got this one. Is there anything I can do?
Attachments
the error
the error
photo_2016-11-22_19-40-37.jpg (27.29 KiB) Viewed 5133 times
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 error message is cut off. Can you have him screen shot the whole error?
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
megalukes
Citizen
Posts: 94
Joined: Fri Jun 27, 2014 11:29 pm
Location: Brazil

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by megalukes »

Karai17 wrote:The error message is cut off. Can you have him screen shot the whole error?
Ah, sorry. Here it is.
Attachments
photo_2016-11-22_19-56-06.jpg
photo_2016-11-22_19-56-06.jpg (41.43 KiB) Viewed 5128 times
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 »

looks like something might be wrong with the path to your map file.

https://github.com/karai17/Simple-Tiled ... it.lua#L40

it's trying to call love.filesystem.load which might be giving an error.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by slime »

If you do setmetatable(assert(love.filesystem.load(map)()), Map), then the assert failure will output the reason that love.filesystem.load gives (and if it succeeds then assert passes the return value along as you'd expect without the assert call there).
User avatar
pgimeno
Party member
Posts: 3673
Joined: Sun Oct 18, 2015 2:58 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by pgimeno »

Clever!
Sarcose
Prole
Posts: 48
Joined: Wed Jul 08, 2015 12:09 am

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Sarcose »

Hi. Did not see this in the feature set. Can STI access and, on that note, can Tiled export, the information about the rotation value of individually placed tiles? As in, to which degree relative to its original position the tile's been rotated/flipped?
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 »

Yes.
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 2 guests