Page 1 of 1

Elevators, stairs, and other height tricks

Posted: Sat Nov 01, 2014 1:56 pm
by nichg
Looking through the dungeon editor assets, I realized that there's nothing along the lines of a set of stairs that moves you between elevations within a level rather than between levels (instead, you must use ladders). So it got me thinking, what are the limits as far as ways in which you can let the party change heights and are there tricks we can use to broaden that up a bit?

So far I've found that setWorldPositionY and setPosition each can accomplish particular effects, but overall it hasn't quite come together to something entirely useful.

setWorldPositionY - you can use this with a timer and a platform to (visually) make a descending elevator that works even when the party is standing on it. Once you've descended by about 0.2 into water then the game will consider the party to be underwater if they're standing on that platform. However, as far as whether or not a given direction is passable, the game will not take this vertical offset into account. So you can, for example, have a platform fairly high up that the party mysteriously 'jumps' to if they walk in that direction, because the game thinks the platform is actually at a different Y level when it comes to actual map elevations. Similarly, even if you make the platform vertically higher up than a ledge using this, the party still can't step off onto the ledge.

The other issue with setWorldPositionY is that if you raise the platform rather than lowering it, the party will tend to fall through. So you probably need to also check and update the party position simultaneously.

setPosition - you can pass this function non-integer elevations, and it will work. However, when determining passability, it seems as though the engine rounds down to the nearest integer, so if you place something at -0.05, the map connectivity behaves as if it is at -1.

What I haven't been able to do yet is to make a tile which behaves as if it is at two heights at once for passability (e.g. you can step up to it from height 0, and step up from it to height 1), which is what you'd need for a stair or fully flexible elevator. Has anyone else found anything that'd be useful with scripting elevations?

Edit: Found out how to do the two-heights-at-once thing. The trick is to use two platforms, each set to be at the same height using setWorldPositionY but set to be different heights in the editor. It seems that the engine defaults to the higher of the two platforms when determining how the party moves out of the square, but uses the lower of the two to figure out if the party is able to move into the square.

Re: Elevators, stairs, and other height tricks

Posted: Tue Jan 20, 2015 1:55 pm
by Granamir
i'v tried... and to me seems it works only if u have collision toggled off, that is not possible during playgame...

Re: Elevators, stairs, and other height tricks

Posted: Tue Jan 20, 2015 2:24 pm
by Drakkan
I am almost 99% sure I have seen some kind of elevation stairs uploaded on steam workshop... or on nexus, not sure. But it was there :)

Re: Elevators, stairs, and other height tricks

Posted: Tue Jan 20, 2015 3:57 pm
by THOM

Re: Elevators, stairs, and other height tricks

Posted: Tue Jan 20, 2015 4:09 pm
by Drakkan
ah yes thats it, thanks :) and it is from nichg :d

Re: Elevators, stairs, and other height tricks

Posted: Wed Jan 21, 2015 6:06 pm
by Granamir
trying
thanks guys