Recreating Tiberium Damage in Yuri's Revenge
Note that, while simply replacing the ore images will work in both Red Alert 2 and Yuri's Revenge, the method creating Tiberium Damage in this tutorial is only compatible with YR.
All of us who played the original, "Tiberian" Command & Conquers know (and probably dreaded) the so-called "Tiberium Damage" effect, where any infantry unit stepping on a field of Tiberium (save for a few selected immune ones) would take periodic damage until they died.
Adding Tiberium
Assuming you want to add Tiberium (as opposed to ore/gems) with Tiberium Damage, you first need some Tiberium. There are three ways you can implement this:
- Replacing the original ore's/gems' images
- Creating a new Resource System
- Use Vinifera — as noted in this thread, it seems like the resource type defined as "Vinifera" is already present on maps, only disguised as normal ore (Riparius). By replacing only the Vinifera-images and only editing [Vinifera], you could potentially have Ore, Gems, and Tiberium in your game, without having to create your own ore tree - the only drawback being that no one documented which maps employ Riparius as their ore, and which use Vinifera. (Meaning some maps might only have Tiberium, while others only have ore, some have both in seperate fields, and some have both in the same field.)
For the sake of simplicity, we'll assume you simple want to replace the original types. YR Argentina → SHPs → Other → Tiberium Pack includes both green and blue Tiberium, converted to RA2/YR format and correctly named to simply put them at an appropriate place to override the original files. Usage instructions should be included.
Creating the Damage
The basic concept of this tutorial/technique is this: On random cells over any field of ore, the animation defined under OreTwinkle will be played — this is TWNK1 by default. Independent from that, in Yuri's Revenge, the death animation generated by the InfDeath caused by Yuri's Virus spawns several particles further damaging units they come in contact with. What we're going to do is make the twinkle animation played over ore use this system to spawn invisible, infantry-damaging particles where it appears, thereby creating a damaging "aura" over the Tiberium field.
Create the Particle
Start your new particle somewhere in your rulesmd.ini; name it whatever you want (of course not using a name that already exists) and add it to the [Particles] list.
Add this code to it, and alter it to fit your mod:
Image=none ; it's invisible MaxDC=15 ; the maximum number of frames that can pass before the particle can start to damage things around it MaxEC=60 ; the maximum number of frames that the particle can be in existence for, keep it small to reduce lag Damage=150 ; how much it hurts, this damage ignores tags such as ImmuneToPoison even if the attached warhead is Poison=yes Warhead=YourWarhead ; the Warhead with which the damage is calculated StartFrame=0 ; irrelevant, since it refers to frames within SHPs, and we're not using one EndStateAI=20 ; irrelevant, since it refers to frames within SHPs, and we're not using one WindEffect=0 ; since the tiberium doesn't move, neither should the damage BehavesLike=Gas ; floating around - other types make no sense. StateAIAdvance=4 ; irrelevant, since it refers to frames within SHPs, and we're not using one
Remember, 15 frames approximately equal 1 second at middle game speed. Most important are MaxEC, Damage, and Warhead.
Create the Warhead
Start your new warhead somewhere in your rulesmd.ini; name it whatever you want (of course not using a name that already exists) and add it to the [Warheads] list.
Add this code to it, and alter it to fit your mod:
CellSpread=1 ; up to three soldiers can occupy one cell - this way, they all get affected PercentAtMax=1.0 ; damage stays constant Verses=100%,100%,100%,1%,0%,1%,0%,0%,0%,0%,0% ; this is what makes this type of tiberium less indiscriminate ProneDamage=100% ; multipler to apply to damage when infantry use prone sequence in art InfDeath=4 ; flame death like in TD
Using these settings, your warhead will
- Deal the amount of damage you set on the particle to soldiers
- Deal minimal damage to tanks
- Deal no damage to harvesters, buildings, Terror Drones and spawned missiles
- Play the flame death animation if a soldier gets killed through Tiberium Damage
Increase ProneDamage to hit soldiers lying down harder (since they are closer to the crystals).
If you find the soldiers burning away to be illogical, you might want to try InfDeaths 7 or 8 instead, 7 being the radiation melt death, and 8 being the Virus "explode to venom gas due to poisoning" death.
Adjust the Twinkle Animation
Still assuming the Twinkle Animation is TWNK1, go to [TWNK1] in artmd.ini and modify it to look like this:
[TWNK1] LoopCount=-1 RandomLoopDelay=120,300 DetailLevel=2 HideIfNoOre=true Rate=450 SpawnsParticle=NameOfYourNewParticle NumParticles=1
Bold lines are the new ones. Replace NameOfYourNewParticle with the name you gave the particle you created above. Keep NumParticles to 1, as there'd be no reason to have two damaging particles when you could just double the Damage value, and more particles always cause more lag.
With that done, every time TWNK1 is played by the game, it should generate your new, invisible particle, damaging whatever you want it to damage.
Adjust the Slave
On its default settings, the Slave Miner's Slave uses Armor=none, which is also be used by normal soldiers. It is therefore subject to damage on Tiberium fields, if you used the code above.
This, of course, is less than optimal.
Fortunately, the seperate Armors are not bound to categories, so you can just go to [SLAV] and replace Armor=none with Armor=medium, which is the armor only used by Harvesters (at least on the ground).
Alternatively, if you want to distinguish the Slave from the Harvesters, armor-wise, you might want to consider using Armor=special_1, the Terror Drone armor, which is generally treated like other unit armors, but unaffected by the warhead code above. However, given that all other resource-gathering units use Armor=medium, it should clearly be preferred.
Extension
Having done all of the above, it should be rather easy to give the particle a warhead with InfDeath=0 and an animation that spawns a neutral infantry looking like a Visceroid, using an armor you selected to be immune. This part of the tutorial, however, has not been written yet. Feel free to do that.
Explosive Tiberium
Unfortunately, the Exploding Tiberium system has been disabled. As off now, no way has been found to bring it back. There is a Tiberium=yes flag for warheads, to enable them to affect resources, however, one would have to make sure such a warhead is rapidly spread across a field in a cascading fashion. You might be successful by working with (multiple) particles spawned from shell-explosion-anims which, in turn, have a Tiberium=yes warhead, WindEffect=5 and a high Velocity, with their warhead-explosion-anims spawning further of them, to spread the effect. This, however, is pure theory and has never been done before, and you should take into account that the number of particles could result in significant amounts of lag. It is posssible to recreate something similar to explosive tiberium by placing the flag Explodes=yes into all the overlay types for that particular type of tiberium. In this case the tiberium will explode whenever a weapon hits it, regardless of whether the weapon had Tiberium=yes set on it. The damage done is controled by the AmmoCrateDamage tag in [CombatDamage] and only effects the cell the tiberium was in. The explosion, debris spawned, and particle system are controled by the tags BarrelExplode, BarrelDebris, and BarrelParticle, respectively. These tags are located in [General].