Page 1 of 2
Question on Falling Damage
Posted: Sat Sep 15, 2012 5:22 pm
by Musabb
Greetings. Tried to research this but was not successful.
I'd like to make a very deep trapdoor that drops the party several levels. When I do this, of course, I kill the party. I need a way to mitigate the fall damage resulting from the long fall or something equivalent.
Any help would be greatly appreciated. Thanks.
Re: Question on Falling Damage
Posted: Sat Sep 15, 2012 6:09 pm
by Shroom
Drop them down one level onto a teleporter which moves them to the final destination, which can be on any level - set it to invisible and silent if you dont want them to know
Re: Question on Falling Damage
Posted: Sat Sep 15, 2012 6:31 pm
by Musabb
Thanks but I was hoping for the effect of seeing the party drop several levels into the pit and have them laboriously climb back up.
Dropping onto a teleporter doesn't work unfortunately as the teleporter ignores falling party members.
I can write a script that heals the party as soon as they land but the damage kills them first and ends the game before they can be healed.
Re: Question on Falling Damage
Posted: Sat Sep 15, 2012 6:44 pm
by Magus
Can't really find a way to change/remove the falldamage. The only thing i get to work is:
while falling remove all champions and add them after the player lands on the ground.
(The game isn't over if you remove all champions, only if they die)
Re: Question on Falling Damage
Posted: Sat Sep 15, 2012 7:10 pm
by Shroom
I dont know if they hit the floor first or the teleport, but if its the teleport, you could drop them and move them over multiple pits
Re: Question on Falling Damage
Posted: Sat Sep 15, 2012 7:15 pm
by theruler
Let's say you want to make a pit 8 levels deep.
Have you tried to put a teleporter on 6th (in midair) and place its target on 7th?
EDIT: teleporter ignores falling stuff.
maybe it could be possible to modify the script in order to allow that. Remain to check if inertia is still transferred.
Anyway the solution proposed below is clevest.
Re: Question on Falling Damage
Posted: Sat Sep 15, 2012 7:28 pm
by Lmaoboat
You could use a script that increases the parties max health by a lot, then lowers it by the same amount after they hit the ground.
Re: Question on Falling Damage
Posted: Sat Sep 15, 2012 7:44 pm
by Musabb
Lmaoboat wrote:You could use a script that increases the parties max health by a lot, then lowers it by the same amount after they hit the ground.
Thanks. That's exactly what I did and it works fine.
At the very beginning I run the following:
Code: Select all
-- Bump up hitpoints
for x = 1, 4, 1 do
party:getChampion(x):modifyStatCapacity("health",120)
party:getChampion(x):modifyStat("health",120)
end
And then once they fall the whole distance and take damage (but live) I execute the following via a hidden pressure plate.
Code: Select all
function resethits()
-- Bump down hitpoints
for x = 1, 4, 1 do
party:getChampion(x):modifyStatCapacity("health",-120)
end
end
Thanks everyone for the suggestions.
Re: Question on Falling Damage
Posted: Thu Feb 13, 2014 11:44 am
by Eightball
There's a serious problem with the pitimmunity method described by Komag on the useful scripts thread that spawns from this one.
(useful scripts here:
viewtopic.php?p=31896#p31896)
The problem is that after the player uses the pit immunity, the game can't be saved without it totally crashing! Has anyone else had this error with Komag's script? I'd really like to keep using it if possible, because it works great otherwise!
Code: Select all
function tempImmunity()
for i = 1,4 do
pitImmunity = party:getChampion(i)
pitImmunity:setEnabled(false)
end
end
function immunityRovoke()
for i = 1,4 do
pitImmunity = party:getChampion(i)
pitImmunity:setEnabled(true)
end
end
Here's the game crashing error:
immunityScript: cannot serialize table 'pitImmunity' with metatable
stack traceback:
[C]: in function 'error'
[string "ScriptEntity.lua"]: in function 'saveValue'
[string "ScriptEntity.lua"]: in function 'saveState'
[string "GameMode.lua"]: in function 'saveGame'
[string "SaveGameMenu.lua"]: in function 'update'
[string "GameMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk
OS Version 6.1
OEM ID: 0
Number of processors: 4
Page size: 4096
Processor type: 586
Total memory: 8136 MB
Free memory: 5642 MB
Display device 0:
Device name: \\.\DISPLAY1
Device string: NVIDIA GeForce GTX 660
State flags: 08000005
Display device 1:
Device name: \\.\DISPLAY2
Device string: NVIDIA GeForce GTX 660
State flags: 00000000
Display device 2:
Device name: \\.\DISPLAY3
Device string: NVIDIA GeForce GTX 660
State flags: 00000000
Display device 3:
Device name: \\.\DISPLAY4
Device string: NVIDIA GeForce GTX 660
State flags: 00000000
Display device 4:
Device name: \\.\DISPLAYV1
Device string: RDPDD Chained DD
State flags: 00000008
Display device 5:
Device name: \\.\DISPLAYV2
Device string: RDP Encoder Mirror Driver
State flags: 00200008
Display device 6:
Device name: \\.\DISPLAYV3
Device string: RDP Reflector Display Driver
State flags: 00200008
Re: Question on Falling Damage
Posted: Thu Feb 13, 2014 11:52 am
by JohnWordsworth
If you want to fix the pitImmunity script, add 'local' before the first use of the pitImmunity variable. The problem is, in the current script, that variable is a global, and therefore stored permanently in the script - and you can't save entity references in the save game. By adding local, the variable only lasts as long as the remaining function call and is cleared away afterwards.
Code: Select all
function tempImmunity()
local pitImmunity = nil;
for i = 1,4 do
pitImmunity = party:getChampion(i)
pitImmunity:setEnabled(false)
end
end
function immunityRovoke()
local pitImmunity = nil;
for i = 1,4 do
pitImmunity = party:getChampion(i)
pitImmunity:setEnabled(true)
end
end