Page 1 of 1

How to get damagetile working on plate press

Posted: Wed Sep 19, 2012 7:21 pm
by Xzalander
Do we have a working example of

Code: Select all

damageTile(level, x, y, direction, flags, damageType, power)
Floating around here anywhere? I'm mostly confused with how to utilise it.

This is what I have at the moment, with the intention of essentially making a kill tile triggered by a hidden plate.

Code: Select all

function rhymeend()
 damageTile(5, 8, 29, 1, 6, physical, 999)
 hudPrint("Text redacted cause spoilers.")

end
It compiles and previews fine but crashes when the plate is triggered. "Bad argument #6 to 'damagetile' (String expect, got nil)"
I'm expecting that to mean that there's something wrong with the way I've written the parameters for the damage effect?

Re: How to get damagetile working on plate press

Posted: Wed Sep 19, 2012 7:25 pm
by antti
The damagetype is expected to be a string, eg. "physical" instead of physical.

Re: How to get damagetile working on plate press

Posted: Wed Sep 19, 2012 7:35 pm
by Xzalander
Ah. Its that again. Sorry for these silly mistakes :roll:

Re: How to get damagetile working on plate press

Posted: Wed Sep 19, 2012 7:50 pm
by Montis
If you want to make it more versatile you could use party.x, party.y and party.level. Then you could link this script to multiple pressure plates that all kill the party when stepped on. Just make sure that they can be only triggered by the party, else a wandering monster or a randomly thrown rock might kill the party on accident ;)

Code: Select all

damageTile(party.level, party.x, party.y, party.facing, 128, "physical", 9001)

Re: How to get damagetile working on plate press

Posted: Wed Sep 19, 2012 7:52 pm
by Xzalander
Ooh thanks Montis, that makes it much more simplified.

Re: How to get damagetile working on plate press

Posted: Wed Sep 19, 2012 9:10 pm
by Komag
nice one, I added it to the script repository :)