Open stairs in a level to move between elevations?

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!
ninjanerdbgm
Posts: 28
Joined: Tue Nov 04, 2014 6:53 pm

Re: Open stairs in a level to move between elevations?

Post by ninjanerdbgm »

NutJob wrote:Thanks for sharing the elevator script ninjanerdbgm, learned a few things.
Always glad to help a fellow Sin City dweller.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Open stairs in a level to move between elevations?

Post by Doridion »

And one elevator's script sticked in the superthread, one !
ninjanerdbgm
Posts: 28
Joined: Tue Nov 04, 2014 6:53 pm

Re: Open stairs in a level to move between elevations?

Post by ninjanerdbgm »

Doridion wrote:And one elevator's script sticked in the superthread, one !
Cool! Maybe someone could improve upon my design and make the whole thing simpler.
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: Open stairs in a level to move between elevations?

Post by Granamir »

I'm not a programmer so maybe what i'm going to write has no sense, but i think is rather simple to go up or down without ladders.
What people want is a way to go up (or down) that seems more natural than climbing, like walking is.
Solution i have in mind doesn't need any 0.5 height inbetween tile, just 2 tiles first at 0 second at 1.
Graphics of those tiles have to be like stairs, going down or up, ending at half height, so they meet looking like a continuous ground.
So from code side of view is like having ladder (except that animation starts only if tile where i'm going is free), but from graphic point of view is like walking.
For solving any fighting problem we can consider both tiles at same height (monsters and party can fight like they are at same height).
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: Open stairs in a level to move between elevations?

Post by MrChoke »

Granamir wrote:I'm not a programmer so maybe what i'm going to write has no sense, but i think is rather simple to go up or down without ladders.
What people want is a way to go up (or down) that seems more natural than climbing, like walking is.
Solution i have in mind doesn't need any 0.5 height inbetween tile, just 2 tiles first at 0 second at 1.
Graphics of those tiles have to be like stairs, going down or up, ending at half height, so they meet looking like a continuous ground.
So from code side of view is like having ladder (except that animation starts only if tile where i'm going is free), but from graphic point of view is like walking.
For solving any fighting problem we can consider both tiles at same height (monsters and party can fight like they are at same height).
I don't think the engine is going to let you do this and have it look good in any way. If you are talking about a 1 height transition across only 2 tiles, there is only going to be 2 height difference. If the higher tile is at a higher elevation, the only way to get the party to move onto that tile is to use setPostion() on the party. And you will probably have to trigger this by overriding the onMove() hook of the party. Even if you get this to work the result will be an instant jump up one level, it will look pretty bad.

I also looked up the Stairs component to see if it has any animations for the "walking" the party does as it moves up and down stairs. I find none which leads me to believe its hard-coded in the engine. So re-use of that is not possible without somehow incorporating a stairs component.

The only workable approach I found (and one I am doing in my dungeon) is the gradual transition across multiple tiles with 2 invisible platforms per square to "lift" the party coming up or "catch" the party coming down. It will take very finite modifications to the Y-position of these platforms to look decent. And for me, even then the party does a little odd movement as it walks up and down. But I deemed it acceptable.
minmay
Posts: 2770
Joined: Mon Sep 23, 2013 2:24 am

Re: Open stairs in a level to move between elevations?

Post by minmay »

MrChoke wrote:I don't think the engine is going to let you do this and have it look good in any way. If you are talking about a 1 height transition across only 2 tiles, there is only going to be 2 height difference. If the higher tile is at a higher elevation, the only way to get the party to move onto that tile is to use setPostion() on the party.
you can just use setWorldPosition() every frame to make the transition smooth
only problem is that you probably can't determine whether the player has the cameraBobbing option disabled, but it's so subtle that I doubt anybody will notice (and most players don't even know it exists)
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: Open stairs in a level to move between elevations?

Post by Granamir »

Maybe i was not clear...
What i meant is that AH could do that, easily i think. In editor mode with collision disabled already does, but as u say transition is not so good, camera just go from height 0 to 1 instantly. I guess they could easily solve this problem.

Btw now i guess even we modders can do it (not me ^_^, i guess a better programmer is needed).
We just need a tile model (for every tile) with 3 borders at height 0 and last at height 0.5, and a tile with 3 borders at height 1 and last at height 0.5, like the 1st one. Then we need some code that disable (or overwrite, if possible) the onMove() of the game, and make champions move forward and up (or down), like someone already did for lift.
Not saying it's easy but i guess it's possible to do with a nice result.

I'd like to be able to programming, this height change transition is thing i miss most in editor (with digging holes going to level down...but this only AH can solve).
Post Reply