Question about modding

Information and discussion for custom maps and mods.
Post Reply
williamicen
Posts: 1
Joined: Wed Mar 26, 2025 7:50 am

Question about modding

Post by williamicen »

Hello,
I'm modding this game wanted to add the ability for zombies to zombify infantry. Essentially what needs to happen is when a unit dies to a zombie specifically, it becomes a zombie. I am not sure how and to scared to mess with the C# and add any traits like SpawnActorOnZombieDeath, which was my first idea. I would also settle for when a unit is hit by a zombie, though it is not prefereable.
How can I make this work?

JovialFeline
Posts: 12
Joined: Mon May 15, 2023 12:58 pm

Re: Question about modding

Post by JovialFeline »

example-zombie.zip
(5.29 KiB) Downloaded 210 times
This is not the only way to do this but I've put together a simple example map for RA.

To start, ^Infantry is defined in OpenRA/mods/ra/rules/defaults.yaml and the various types of infantry share it. The map-specific rules in rules.yaml add a SpawnActorOnDeath trait to it.

Code: Select all

^Infantry:
  SpawnActorOnDeath@SPAWNZOMBIE:
    Actor: Zombie
    OwnerType: Killer
    DeathType: ZombieDeath
When infantry now die to a weapon that deals ZombieDeath damage, a fresh zombie will spawn for the owner of the zombie responsible for the death.

Next, the Claw weapon from mods/ra/weapons/other.yaml is tweaked, by adding another rule through the map's weapons.yaml.

Code: Select all

Claw:
  Warhead@1Dam: SpreadDamage
    DamageTypes: Prone50Percent, TriggerProne, DefaultDeath, ZombieDeath
The damage-dealing warhead now has ZombieDeath damage, in addition to the types it already had. With the two rule changes put together, basic "zombification" can occur.

Post Reply