Page 1 of 1

Map Layers

Posted: Wed Oct 29, 2014 6:17 pm
by NutJob
Question 1: Has anyone successfully retrieved information about the layers, be it specific:

Code: Select all

-- fake code
tile_type, floor_height, ceiling_height, {list, of, objects, at, this, coordinate}, other, variables = map.layer:getInfo(x,y)
or general:

Code: Select all

-- more fake code
table = getMapLayer(level)
-- table containing all the layers much like the generated layout in dungeons.lua
--
--
--


Question 2: Is there way to force objects to a certain point within a tile? I was looking at the MapGraphicsComponent and there's a few curious methods that may do this. I could be wrong. The result I'm looking for requires more in-depth placement then just facing a cardinal direction something like theObj.controller.pushObj(280,891) from it's starting location on a tile. (Example Use: push a few levers so they're all lined up next to one another on one wall; they do, only, require a mouse click to use so I see no reason to have them bunched together, if possible).

Re: Map Layers

Posted: Wed Oct 29, 2014 9:13 pm
by Prozail
for #2: Not really sure if this is what you mean, but try putting two levers ontop of eachother and then try this

Code: Select all


local t = lever_1:getWorldPosition()
t[2] = 0.7
print(t)
lever_1:setWorldPosition(t)


Re: Map Layers

Posted: Wed Oct 29, 2014 9:26 pm
by NutJob
Prozail wrote:for #2: Not really sure if this is what you mean, but try putting two levers ontop of eachother and then try this

Code: Select all


local t = lever_1:getWorldPosition()
t[2] = 0.7
print(t)
lever_1:setWorldPosition(t)

That is EXACTLY what I needed to know! Thank you!

Code: Select all

	local t = lever_1:getWorldPosition()
	for m,n in ipairs(t) do
		print(m,n)
	end
	t[1] = 84.5
	lever_1:setWorldPosition(t)

Now I can do this!

Image

Re: Map Layers

Posted: Wed Oct 29, 2014 11:52 pm
by MrChoke
I would love to know how to access the layers as well. It seems like that is still an known in what people have been able to figure out.

Re: Map Layers

Posted: Mon Nov 03, 2014 8:31 am
by Isaac
Man... the hoops I had to hop through to get that to work in LoG1. :shock:
Image

Re: Map Layers

Posted: Mon Nov 03, 2014 9:57 am
by Blichew
I'll just chip-in with my memory-like puzzle that looks like this:
Image

viewtopic.php?f=22&t=8049&p=81414#p81400 :)