


How to add altitude to maps?
like topological maps, if i add z coordinate
edited 1×, last 01.02.15 02:07:38 pm
Scripts
How to add altitude to maps?
How to add altitude to maps?


altitudetiles = {{[[X, Y, HEIGHT]]}}
playerheight = {}
for id = 1, 32 do
	playerheight[id] = 0
end
addhook("always", "alwayshook")
addhook("movetile", "movetilehook")
function alwayshook()
	for none, id in pairs(player(0, "tableliving")) do
		for none, tilevalue in pairs(altitudetiles) do
			if (player(id, "tilex") == tilevalue[1] and player(id, "tiley") == tilevalue[2]) then
				if (tilevalue[3] > playerheight[id]) then
					parse("setpos " .. id .. " " .. player(id, "x") .. " " .. player(id, "y"))
				end
			end
		end
	end
end
function movetilehook(id, tilex, tiley)
	for none, tilevalue in pairs(altitudetiles) do
		if (tilex == tilevalue[1] and tiley == tilevalue[2]) then
			if (tilevalue[3] < playerheight[id]) then
				playerheight[id] = tilevalue[3]
				
				if (tilevalue[3] <= -5) then
					parse("sethealth " .. id .. " " .. player(id, "health") - math.abs(tilevalue[3]) / 5))
				end
			end
		end
	end
end
MikuAuahDark's suggestion.
movetile and set the altitude value at there(for player)
Dousea:
MikuAuahDark: 

Pagyra! Your idea is brilliant! CS2D is lacking perception of depth. You should suggest your idea to DC.
Captione. Some of your ideas are pretty amazing, may DC will accept such things like this, so CS2D will be something a bit impressive (in my opinion).
Re: How to add altitude to maps?
DC is too lazy to implement this anyway. Don't get your hopes high.
GeoB99: If
DC agreed to this, mapmakers will be making maps with more options from CQB battles to large-scale landscape battlefields.
Infinite Rain: Then I could wait for Stranded 3. After that, ill just wait for DC to implement this nice feature.