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?
Question about modding
-
JovialFeline
- Posts: 15
- Joined: Mon May 15, 2023 12:58 pm
Re: Question about modding
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.
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.
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.
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
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