Page 1 of 2
insta damage square
Posted: Thu Dec 11, 2014 2:27 pm
by bongobeat
Hello,
I want to make some kind of insta damage tile, based on log1 script, that kills the party when jumping in a mine chasm
I tried the script from log1, but that don't work. I got an error message, and only when the trigger plate is on a walking floor (of course)
anyone knows how to re-do the insta damage
log1 script:
Code: Select all
function instadeath()
damageTile(party.level, party.x, party.y, party.facing, 128, "physical", 9001)
hudPrint("You Foolish Adventurers, MWAHAHAHA!!!")
end
anyone knows how to apply the insta damage when the party jump in a mine chasm?
Re: insta damage square
Posted: Thu Dec 11, 2014 3:24 pm
by Scotty
Something like this should do the trick, connected to a floor trigger.
Code: Select all
function killParty()
for i = 1, 4, 1 do
party.party:getChampion(i):damage("physical",1000)
end
end
Re: insta damage square
Posted: Thu Dec 11, 2014 5:04 pm
by bongobeat
thanks for help,
I ve just try, but there is still a error message
bad argument #1 to 'damage (number expected, got string) X
anyway, this can't be triggered while the party is falling
Re: insta damage square
Posted: Thu Dec 11, 2014 5:36 pm
by GoldenShadowGS
You could use, party:isFalling()
You could put floor triggers all around the chasm that have "ondeactivate" connect to "delay"
function delay()
delayedCall(self.go.id, 1, "falling")
--adjust the time of the delay by changing 1 to 1.2, 0.8, etc..
end
function falling()
if party.party:isFalling() then
for i = 1, 4, 1 do
party.party:getChampion(i):damage("physical",1000)
end
end
end
Re: insta damage square
Posted: Thu Dec 11, 2014 6:36 pm
by Scotty
Oh, we had damage and damage type backwards by the way, should be:
Code: Select all
party.party:getChampion(i):damage(1000, "physical")
Re: insta damage square
Posted: Thu Dec 11, 2014 9:38 pm
by minmay
You just need to change your damageTile to account for the fact that Grimrock 2 has elevation, like this:
Code: Select all
function instadeath()
damageTile(party.level, party.x, party.y, party.facing, party.elevation, 128, "physical", 9001)
hudPrint("You Foolish Adventurers, MWAHAHAHA!!!")
end
Re: insta damage square
Posted: Thu Dec 11, 2014 11:22 pm
by bongobeat
thank you all for your help
I finally use the party is falling script with trigger plate, works well!
to minmay:
works well if you put the trigger plate on the same heigth of the hole, but if you put it a under it don't detect the plate while falling.
Re: insta damage square
Posted: Sun Dec 28, 2014 9:04 pm
by MrChoke
Question on damageTile. What does the "flags" parameter do? The example above uses 128.
Re: insta damage square
Posted: Sun Dec 28, 2014 9:07 pm
by Batty
Re: insta damage square
Posted: Sun Dec 28, 2014 11:09 pm
by JKos
I just added a usage example of DamageFlags to community docs:
https://github.com/JKos/log2doc/wiki/Ob ... amageflags