preventing fall damage

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
remilafo
Posts: 23
Joined: Wed Mar 20, 2013 3:36 am

preventing fall damage

Post by remilafo »

So in my custom dungeon, i have the party falling really long way. like 50 levels

anyone got ideals of how to prevent fall damage or allow the party to absorbs a large hit in the range of 600+ dmg..

Teleporters conserve momentum and pits conserve momentum...

so?

Prem
Dunkler
Posts: 73
Joined: Thu Jul 10, 2014 3:20 pm

Re: preventing fall damage

Post by Dunkler »

Let them fall into water :)
remilafo
Posts: 23
Joined: Wed Mar 20, 2013 3:36 am

Re: preventing fall damage

Post by remilafo »

Dunkler wrote:Let them fall into water :)
first thing i tried. Even with water that is 13 cells deep they still splatter to their deaths.
GoldenShadowGS
Posts: 168
Joined: Thu Oct 30, 2014 1:56 am

Re: preventing fall damage

Post by GoldenShadowGS »

It worked for me. I have a fall from +1 to -7 elevation pit. the floor below has -1 elevation deep water. No damage at all when I splash into it.
User avatar
QuintinStone
Posts: 72
Joined: Sat Nov 01, 2014 9:58 pm

Re: preventing fall damage

Post by QuintinStone »

Does the 'party' game object have a gravity component?
Crypt of Zulfar
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: preventing fall damage

Post by NutJob »

Maybe there a way to setImmunities() briefly before the impact on each champion in the party?

isFalling() the trigger, and then a floor_trigger to remove whatever was set after the fall (impact)?

Is this a question? Oh oh, I can answer that! Yes.
remilafo
Posts: 23
Joined: Wed Mar 20, 2013 3:36 am

Re: preventing fall damage

Post by remilafo »

GoldenShadowGS wrote:It worked for me. I have a fall from +1 to -7 elevation pit. the floor below has -1 elevation deep water. No damage at all when I splash into it.
I will try it again, perhaps water does buffer a bit of damage but +1 to -7 is only 8 cells. In my case i have the party transiting 7 to -7 9 times for a total of 126 cells. The acceleration is quick impressive, near the end of the transistion the party is clocking around 50 cells/s ...

Prem
User avatar
mahric
Posts: 192
Joined: Sun Nov 04, 2012 3:05 pm

Re: preventing fall damage

Post by mahric »

The way I did it in LoG1 in the Wine Merchant's Basement was like this:

Before fall:
- Just before falling, increase the max health of all party members by 250 (250 was enough for my fall, you might need to add more)
- Heal the part by 250 health
- Open the trapdoor and start the falling! :twisted:

Landing:
- Make sure they land on a pressure plate that triggers a script
- In the script reduce the max health and health that you added before (250 health in my case)
- Set the health of all party members to 1 (but not the max health), to make it seem like they're really lucky having survived and have to heal up first

The source of the Wine Merchant's Basement is available in the thread in my signature.

You might be able to do something like this with the functions getHealth() and getMaxHealth() and setHealth() and such on the champion component.
I can't try right now (i'm at work) but you might give it a try.
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
nichg
Posts: 48
Joined: Thu Oct 11, 2012 12:38 pm

Re: preventing fall damage

Post by nichg »

This gave me an awesome idea. If we figure out how to mess with the party's gravity-based movement, can we create something where the party is actually flung upwards (e.g. maybe they have to bounce up into a teleporter at a higher elevation)?

Is it possible to have horizontal momentum too? Can you tweak the party's Gravity component to make them try to 'jump' a gap, possibly falling one or more levels down as they go?
minmay
Posts: 2770
Joined: Mon Sep 23, 2013 2:24 am

Re: preventing fall damage

Post by minmay »

There's no horizontal gravity.
nichg wrote:This gave me an awesome idea. If we figure out how to mess with the party's gravity-based movement, can we create something where the party is actually flung upwards (e.g. maybe they have to bounce up into a teleporter at a higher elevation)?
Sure: just use setWorldPosition to place the party somewhere off the ground, then use "party.gravity:setFallingSpeed(velocity)" where velocity is the downward velocity you want the party to have. You can also use "party.gravity:disable()" to make them stop in midair and hover there, but it will be reactivated as soon as the party moves or turns with the keyboard (turning with mouselook, however, doesn't re-enable gravity). Note that the party can freely turn and move while "falling" upwards, but not downwards.

I was able to jump over the Forgotten River by typing this in the debug console:

Code: Select all

party:setWorldPosition(55.5,0.1,70.5,0) party.gravity:setFallingSpeed(-50)
though I took a lot of damage when I hit the ground.

However, there is something you should be concerned about: the party doesn't really change elevations while falling upwards - you can't use it to "jump" onto a higher platform or over an obstacle (but jumping over water/pits/teleports/etc works fine), and utter chaos will occur if the party moves into a ladder while falling upwards.
Last edited by minmay on Tue Nov 18, 2014 12:18 pm, edited 1 time in total.
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.
Post Reply

Return to “Mod Creation”