Mewdoom Posted August 26, 2017 Helllo guys, I have a monster that spawn two other monsters when attacking. But I would like to limit the spawn. If it have spawned two minions, I would like it to not spawn anymore and if minions dies, it can spawn two other again. Any idea I could do that ? :) thanks for your help. 0 Quote Share this post Link to post
0 scifista42 Posted August 26, 2017 Make a new inventory actor with maxamount 2. When the monster is about to spawn minions, use A_JumpIfInventory to abort spawning if the monster has at least 1 item of the inventory. Otherwise use A_GiveInventory to give him 2 items of the inventory and spawn 2 minions via A_SpawnItemEx with SXF_SETMASTER flag. In the minion's death animation, use A_TakeInventory with actor pointer AAPTR_MASTER to take 1 item of the inventory from the monster who spawned it. Therefore, once both minions die, the monster will once again have 0 items of the inventory and be able to spawn minions again. 0 Quote Share this post Link to post
Question
Mewdoom
Helllo guys,
I have a monster that spawn two other monsters when attacking. But I would like to limit the spawn. If it have spawned two minions, I would like it to not spawn anymore and if minions dies, it can spawn two other again.
Any idea I could do that ? :)
thanks for your help.
Share this post
Link to post
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.