How to make enemy spawn enemies with an attack?
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- JtoTheB
- Posts: 45
- Joined: Sat Aug 09, 2025 9:46 am
- Operating System Version (Optional): Windows 11
- Location: New Jersey
How to make enemy spawn enemies with an attack?
I'm working on a boss fight for my mod, and I want the boss to spawn enemies on all four of his sides. I'm not entirely sure on how to do this, but if someone could help that'd be greatly appreciated.
Re: How to make enemy spawn enemies with an attack?
The pain elemental zscript seems helpful for this
https://zdoom.org/wiki/Classes:PainElemental
https://zdoom.org/wiki/A_PainAttack
the A_DualPainAttack shows how you can spawn them at specific angles.
https://zdoom.org/wiki/Classes:PainElemental
https://zdoom.org/wiki/A_PainAttack
the A_DualPainAttack shows how you can spawn them at specific angles.
- JtoTheB
- Posts: 45
- Joined: Sat Aug 09, 2025 9:46 am
- Operating System Version (Optional): Windows 11
- Location: New Jersey
Re: How to make enemy spawn enemies with an attack?
Would it be possible to give the spawned enemies tags?
Re: How to make enemy spawn enemies with an attack?
I'm not an expert with Zscript but it is possible to track spawn actors, or you could make them spawn 4 distinct enemies that inherit from a parent actor. What exactly do you want to do with it?
-
- Posts: 20
- Joined: Thu Jun 15, 2023 1:29 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows10 / Ubuntu 22.04.3
- Graphics Processor: ATI/AMD (Modern GZDoom)
Re: How to make enemy spawn enemies with an attack?
Hi,
I think https://zdoom.org/wiki/A_SpawnItemEx is what you are looking for.
the "Item" it spawns can (afaik) be any actor. So it can spawn an enemy also.
The tid argument would also allow you to manage tags.
I think https://zdoom.org/wiki/A_SpawnItemEx is what you are looking for.
the "Item" it spawns can (afaik) be any actor. So it can spawn an enemy also.
The tid argument would also allow you to manage tags.