How to get damagetile working on plate press

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Xzalander
Posts: 62
Joined: Thu Sep 13, 2012 1:27 pm
Location: Yorkshire, United Kingdom

How to get damagetile working on plate press

Post 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?
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: How to get damagetile working on plate press

Post by antti »

The damagetype is expected to be a string, eg. "physical" instead of physical.
Steven Seagal of gaming industry
User avatar
Xzalander
Posts: 62
Joined: Thu Sep 13, 2012 1:27 pm
Location: Yorkshire, United Kingdom

Re: How to get damagetile working on plate press

Post by Xzalander »

Ah. Its that again. Sorry for these silly mistakes :roll:
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: How to get damagetile working on plate press

Post 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)
Last edited by Montis on Wed Sep 19, 2012 7:57 pm, edited 1 time in total.
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
Xzalander
Posts: 62
Joined: Thu Sep 13, 2012 1:27 pm
Location: Yorkshire, United Kingdom

Re: How to get damagetile working on plate press

Post by Xzalander »

Ooh thanks Montis, that makes it much more simplified.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: How to get damagetile working on plate press

Post by Komag »

nice one, I added it to the script repository :)
Finished Dungeons - complete mods to play
Post Reply