Killing a specific creature with a pressure plate

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Xaxus
Posts: 24
Joined: Mon Sep 17, 2012 4:54 am

Killing a specific creature with a pressure plate

Post by Xaxus »

I want to be able to step on a pressure plate and deal fatal damage to a specific instance of a cube creature. How does one script this?
Additionally, upon using a kill command for the cube (pressing K in the editor), a prompt appears saying "warning! responder not found with id: cube". How do I remove this error?
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Killing a specific creature with a pressure plate

Post by Komag »

you would need to do a damageTile on it, so if it's moving around you would need to find it first to get the x/y, then run the damageTile with the correct location. You could do a setHealth first to reduce health to something like 1, then the damageTile could be small if you want, or else just crank it up to a huge number.

the warning is harmless, it is just a console message, so most players won't see it because I think most people don't have their consoles turned on
Finished Dungeons - complete mods to play
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: Killing a specific creature with a pressure plate

Post by Phitt »

Komag wrote:you would need to do a damageTile on it, so if it's moving around you would need to find it first to get the x/y, then run the damageTile with the correct location. You could do a setHealth first to reduce health to something like 1, then the damageTile could be small if you want, or else just crank it up to a huge number.

the warning is harmless, it is just a console message, so most players won't see it because I think most people don't have their consoles turned on
Personally I had weird results when I tried to kill monsters with damageTile. Sometimes it wouldn't work at all, sometimes the enemies died (smoke and glitter particles appeared), but afterwards there was an invisible and invincible enemy. Maybe I had some special circumstances, but I had to spawn a spell on top of them to kill them, which was the only way to get it working properly.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Killing a specific creature with a pressure plate

Post by Komag »

whoa, really? That sounds somewhat buggy then - I've never ran into those problems but I haven't done it a whole lot, so I don't know.

Is is possibly due to crazy huge damage used? I've only ever tried to damage them just a little more than their HP (well, I mean like if the HP was 100 I might damage 500, but that's at least not 50,000 or whatever).
Could it be something with custom defined monsters?
Maybe something with monster movement, where sometimes as they move they are sorta in two cells at once?
Finished Dungeons - complete mods to play
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: Killing a specific creature with a pressure plate

Post by Phitt »

Komag wrote:whoa, really? That sounds somewhat buggy then - I've never ran into those problems but I haven't done it a whole lot, so I don't know.
I did it from the monsters.lua with a hook, maybe that was the problem. Or maybe it was because I used spawned creatures? I don't know, but I couldn't get it to work and the fire explosion looked better in my case anyway so I didn't test what was causing it.
User avatar
Pandafox
Posts: 268
Joined: Wed Apr 11, 2012 11:25 pm
Location: France
Contact:

Re: Killing a specific creature with a pressure plate

Post by Pandafox »

Another solution is to teleport the enemy to a one square place (not used into the dungeon) and spawn smoke to simulate death :mrgreen:
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Killing a specific creature with a pressure plate

Post by Komag »

Well if you're going to do that you might as well just destroy() it
Finished Dungeons - complete mods to play
User avatar
Xaxus
Posts: 24
Joined: Mon Sep 17, 2012 4:54 am

Re: Killing a specific creature with a pressure plate

Post by Xaxus »

I real issue is I want the cube to shut up, as even after I leave the room on my dungeon where it can see me it still says things like "STOP STRUGGLING!"
I figure this is hardcoded into the game, so I want the cube removed or killed when the puzzle is completed. No fancy lights or nothing.

EDIT: I'll use the destroy(). sounds like want I need, Komag. I'll let you know asap.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Killing a specific creature with a pressure plate

Post by Komag »

yeah, the cube is very quirky/testy, I've worked with it extensively
Finished Dungeons - complete mods to play
Post Reply