Elevators, stairs, and other height tricks

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
nichg
Posts: 48
Joined: Thu Oct 11, 2012 12:38 pm

Elevators, stairs, and other height tricks

Post 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.
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: Elevators, stairs, and other height tricks

Post by Granamir »

i'v tried... and to me seems it works only if u have collision toggled off, that is not possible during playgame...
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: Elevators, stairs, and other height tricks

Post 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 :)
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
THOM
Posts: 1267
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Elevators, stairs, and other height tricks

Post by THOM »

THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: Elevators, stairs, and other height tricks

Post by Drakkan »

ah yes thats it, thanks :) and it is from nichg :d
Breath from the unpromising waters.
Eye of the Atlantis
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: Elevators, stairs, and other height tricks

Post by Granamir »

trying
thanks guys
Post Reply

Return to “Mod Creation”