The basic aim here is to have a room full of breakable obstacles (example: terracotta_jars_block) and have the player break them all to open a door (via a counter). I also like elsewhere in my dungeon to have breakable objects that trigger other things when broken.
The initial problem here is that breakable obstacles don't have connectors
My first experiment involved putting the Jars on Floor Triggers - this of course did not work because floor triggers don't detect obstacles / obstacles don't count as Items
So my first thought was to use the Jar's Heath reaching 0 and it seemed simple enough. Note because this was a experiment I wired one directly to the door rather than to a counter.
Code: Select all
if terracotta_jars_block_3.health:getHealth() == 0 then dungeon_secret_door_50.door:open()
So I decided on a different approach using what I learned about spawning Monsters with connectors
Code: Select all
spawn("terracotta_jars_block", 8, 14, 17, 1, 0)health:addConnector("onDie", dungeon_secret_door_50.door:open() )
So what next? Do I really need to go about making custom versions of the Breakable Obstacles with added Connectors? (and if so, how? I'm going to need pointing to a good tutorial)