Page 62 of 92

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Tue Oct 04, 2016 9:43 am
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)

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Fri Oct 07, 2016 12:11 am
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 5203 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 5203 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 5203 times
So any help with that would be appreciated. Anyway, sorry for bugging you!

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Tue Nov 22, 2016 9:42 pm
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?

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Tue Nov 22, 2016 9:43 pm
by Karai17
The error message is cut off. Can you have him screen shot the whole error?

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Tue Nov 22, 2016 9:56 pm
by megalukes
Karai17 wrote:The error message is cut off. Can you have him screen shot the whole error?
Ah, sorry. Here it is.

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Tue Nov 22, 2016 10:54 pm
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.

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Wed Nov 23, 2016 1:04 am
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).

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Wed Nov 23, 2016 2:25 am
by pgimeno
Clever!

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Fri Nov 25, 2016 7:02 am
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?

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Fri Nov 25, 2016 12:32 pm
by Karai17
Yes.