Jump to content
  • 0

Zdoom - how to create monsters minions ?


Mewdoom

Question

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

  • 0

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...