How to "replace" enemies?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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!)
Post Reply
DXGG
Posts: 8
Joined: Tue Nov 13, 2018 6:52 pm

How to "replace" enemies?

Post by DXGG »

Hello, i'm fairly new to ZDoom, and so far i only changed a few weapons in my mods, and i'm here to ask for help, since i have no idea how to do this...

Basically, i want to add a new enemy type, like a zombie holding a new weapon for example, i know how to that, but is there anyway i can replace say, a few zombiemen as my new enemy?

Let's say a make an Enemy called "ZombiePlasma", how can i make it so, this enemy replaces ZombieMen in some places they should appear?

Like, in map01, of the two zombiemen that are in front of you when you spawn, one of them is my new enemy.

I have no idea if what i said even makes sense, but well... please help :3:
Guest

Re: How to "replace" enemies?

Post by Guest »

Use a RandomSpawner. (https://zdoom.org/wiki/Classes:RandomSpawner)
For example:
Actor ZombieReplacer : RandomSpawner 3004
{
DropItem "ZombieMan"
DropItem "ZombiePlasma"
}

While you can check the monster's position and replace them that way, it's way better to just use a RandomSpawner to randomly spawn your new enemy.
DXGG
Posts: 8
Joined: Tue Nov 13, 2018 6:52 pm

Re: How to "replace" enemies?

Post by DXGG »

Thank you so much. Guess i should have read through the wiki first :3:
Post Reply

Return to “Scripting”