Spider Eggs and cracking them open
Posted: Wed Jan 23, 2013 9:35 pm
Hi everyone,
I'm trying to put together a room with a lot of hatch-able spider eggs as a trap. Step one is complete and that's following the steps to make the eggs spawn a spider on hatching. That bit works fine.
What I want to do though is to make pressing a button hatch all the eggs.
I wrote a script to go through the eggs in the room and destroy them using damageTile(). That works but it also almost always kills the freshly spawned spider even though they are spawned onDeath() of the eggs. I think I can see why in terms of game logic update that happens because onDeath() happens spawns the monster then the damageTile() spots another entity in the tile to damage and kills the spider.
I think I can get round it by making a custom spider that's immune to one type of damage and have them spawn out the piosion immune spider and use poison damage to break the eggs. I'd rather not go this way just in case the player has dumped all his magic points into earth magic it'd suck to have it all rendered useless.
So assuming I've not overlooked something obvious can anyone suggest a way to kill the eggs better than damageTile() or a way to prevent the spider death which won't screw over a party's abilities if they have been stacked that way?
I'm trying to put together a room with a lot of hatch-able spider eggs as a trap. Step one is complete and that's following the steps to make the eggs spawn a spider on hatching. That bit works fine.
What I want to do though is to make pressing a button hatch all the eggs.
I wrote a script to go through the eggs in the room and destroy them using damageTile(). That works but it also almost always kills the freshly spawned spider even though they are spawned onDeath() of the eggs. I think I can see why in terms of game logic update that happens because onDeath() happens spawns the monster then the damageTile() spots another entity in the tile to damage and kills the spider.
I think I can get round it by making a custom spider that's immune to one type of damage and have them spawn out the piosion immune spider and use poison damage to break the eggs. I'd rather not go this way just in case the player has dumped all his magic points into earth magic it'd suck to have it all rendered useless.
So assuming I've not overlooked something obvious can anyone suggest a way to kill the eggs better than damageTile() or a way to prevent the spider death which won't screw over a party's abilities if they have been stacked that way?