Question about modding

Information and discussion for custom maps and mods.
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?

Last edited by steal a brainrot two days go
Last edited by williamicen on Wed Mar 11, 2026 9:39 am, edited 1 time in total.
User avatar
JovialFeline
Posts: 28
Joined: Mon May 15, 2023 1:58 pm

Re: Question about modding

Post by JovialFeline »

example-zombie.zip
(5.29 KiB) Downloaded 1385 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.

Who is online

Users browsing this forum: No registered users and 192 guests