There's a bit of work involved, but it's worth it. Scroll down if you want to see the finished product. This tutorial assumes some basic familiarity with general modding practices, in particular it assumes you know how to use Ares and already know how to create new units, weapons, projectiles, and animation art entries. A cursory familiarity with XCC Mixer and SHP Builder is a plus, but not really required.
Anyways:
Before we get to coding, we first need to do some SHP work. If you don't already have it installed, grab a copy of SHP Builder and fire it up.
Create two new SHPs. The first one should be only a single frame, the second should be 29 frames. The width and height are arbitrary, as these will be completely empty. I chose 5x5. Type should be RA2 Animation

Save these immediately with no further edits, name them whatever you'd like. I chose DUMMYANIM1 and DUMMYANIM29 to indicate how many frames they last. If you're not using a mod manager, these need to go directly into your RA2 install folder.
Next, crack open XCC Mixer and go to File -> Found -> Red Alert 2 -> ra2.mix. Open up Conquer.mix and look for WCCLOUD1.shp. Extract it to the same directory where you saved the dummy animations. Name it something other than WCCLOUD1 (we don't want to override the existing animation, as that will screw up the lightning storm), I chose LCLOUD.
Open LCLOUD in SHP Builder and go to Edit -> Resize Canvas. Add about 360 pixels to the bottom of the frame (this is what I used, feel free to adjust this to your liking). Save your edits and close
Don't worry if SHP Builder loads the animation in the wrong palette. The WCCLOUDs use unittem.pal instead of anim.pal. Since you're not editing colors, it will still look correct in-game.

(N.B. on the above: If you like, you can skip this step and use YDrawOffset instead)
Next we need to graft the lightning bolt and the lightning bolt explosion together, because the warhead will only trigger one animation at a time. Head back to XCC Mixer to the same location and extract WCLBOLT1.shp and EXPLOLB.shp. Rename EXPLOLB.shp to something unique, I chose simply LBOLT.
Next you'll have to copy/paste these two SHPs together. This can be a bit tricky and I believe there is already a tool or tutorial somewhere for that, so I won't go into details (I'll attach the anim I created a few years back for this, no credit necessary).
Now on to the rules/art code.
Firstly, a few concepts to explain:
- 1. PreImpactAnim. This is the linchpin of the whole operation. This allows you to specify an animation that that plays and completes before the warhead is detonated.
This poses a problem however, because the PreImpactAnim needs to fully complete before the warhead is detonated, meaning the cloud will have dissipated before the lightning bolt is fired. This is why you created the dummy animations--More on that later.
2. TrailerAnim and TrailerSeperation. Another two critical pieces of the puzzle. Animations can have Trailers just like projectiles, however they are specified by different tags, namely the two above. TrailerAnim is the anim to play as a trailer, and TrailerSeperation is the delay in frames between spawning said animation.
3. Next. A very seldom-used, but extremely useful tag that lets you specify what animation to play after the given animation has completed. In our case, PreImpactAnim does not detonate the warhead until both the original anim and the one specified by Next have completed.
So, because the cloud animation is 59 frames, and the bolt doesn't fire until the 29th frame, we need a way to delay firing the lightning bolt (which will be the eventual animation in the Warhead's AnimList= by exactly 29 frames, while still completing the last 30 frames of the cloud animation.
The basic strategy for accomplishing that effect is this:
- 1. Using PreImpactAnim attached to a warhead, spawn a 1-frame dummy animation.
2. Using TrailerAnim= and TrailerSeperation=, spawn the actual cloud animation as a TrailerAnim. Because the cloud is a trailer, this means it will not be tied to the timing of detonating the warhead per PreImpactAnim.
3. Using Next=, have the dummy 1-frame animation progress on to a 29-frame dummy animation that doesn't have TrailerAnim= set. This prevents any more cloud animations from spawning, as otherwise you would get a new cloud every other frame for 30 frames.
4. After the 29-frame dummy animation has finished (which should be exactly half-way through the cloud animation playing), detonate the warhead and create the lightning bolt.
Firstly, you need a weapon to fire your lightning bolt. Use all the standard tags and include whatever damage, ROF, etc. that you want. Ideally, the projectile should be set to something like InvisibleHigh for direct hits or create a new invisible projectile with Inaccurate= and FlakScatter=, whatever suits you.
Code:
[LightningStrikeWeapon]
...
Projectile=InvisibleHigh
Warhead=LightningStrikeWarhead
...
Projectile=InvisibleHigh
Warhead=LightningStrikeWarhead
Next is the Warhead. Again, use whatever tags and values suit you. Just make sure you have the following:
Code:
[LightningStrikeWarhead]
...
PreImpactAnim=LCLOUD1; this will be our 1-frame dummy animation
AnimList=LBOLT; this is the actual lightning bolt
...
PreImpactAnim=LCLOUD1; this will be our 1-frame dummy animation
AnimList=LBOLT; this is the actual lightning bolt
Now on to the art. First, add your animations to the [Animations] list in rulesmd.ini:
Code:
[Animations]
...
XXX=LBOLT
XXX=LCLOUD1
XXX=LCLOUD2
XXX=LCLOUD3
...
XXX=LBOLT
XXX=LCLOUD1
XXX=LCLOUD2
XXX=LCLOUD3
I always do this first because it's the easiest step to forget! Again, name those whatever you want. Those are just the names I chose.
Now, create the entries in Artmd.ini. Let's start with the easiest one:
Code:
[LBOLT]
Layer=ground
Report=WeatherStrike; We need this for the lightning strike sound to play. WCLBOLTX don't have this because the sound is specified in SW-specific code in AudioVisual
Layer=ground
Report=WeatherStrike; We need this for the lightning strike sound to play. WCLBOLTX don't have this because the sound is specified in SW-specific code in AudioVisual
If you would like, you can add a negative ZAdjust= to LBOLT if you find it's rendering behind buildings when it shouldn't. I put a ZAdjust=-20 on mine, as it helps in certain edge cases without being too aggressive.
Now for the clouds, where the magic happens. First, define your 1-frame dummy animation. Start by copying from WCCLOUD1 and add TrailerAnim=LCLOUD2, TrailerSeperation=2, and Next=LCLOUD3. Note you can remove AltPalette=yes and Layer=Top. If you used the SHP Editor method of raising the clouds, ZAdjust is important here:
Code:
[LCLOUD1]
Image=DUMMYANIM1; I didn't just name the section ID DUMMYANIM1 because I want to keep it generic for other purposes
TrailerAnim=LCLOUD2
TrailerSeperation=2
Next=LCLOUD3
ZAdjust=-150; important if you used the SHP editor method of raising the clouds. If you use YDrawOffset, omit this
Image=DUMMYANIM1; I didn't just name the section ID DUMMYANIM1 because I want to keep it generic for other purposes
TrailerAnim=LCLOUD2
TrailerSeperation=2
Next=LCLOUD3
ZAdjust=-150; important if you used the SHP editor method of raising the clouds. If you use YDrawOffset, omit this
Next, define your actual cloud animation:
Code:
[LCLOUD2]
Image=LCLOUD; you don't have to have this. you could instead simply name your SHP lcloud2.shp or name this section LCLOUD. Up to you
Rate=450; tweak this to your liking. Orginal clouds use Rate=375
Layer=Top
AltPalette=yes
ZAdjust=-150
Image=LCLOUD; you don't have to have this. you could instead simply name your SHP lcloud2.shp or name this section LCLOUD. Up to you
Rate=450; tweak this to your liking. Orginal clouds use Rate=375
Layer=Top
AltPalette=yes
ZAdjust=-150
Finally, define the 29-frame dummy animation that plays after LCLOUD1 completes:
Code:
[LCLOUD3]
Image=DUMMYANIM29
Rate=450; Make sure this matches the Rate= of LCLOUD2, otherwise your lightning bolt will be out of sync w/ cloud
Image=DUMMYANIM29
Rate=450; Make sure this matches the Rate= of LCLOUD2, otherwise your lightning bolt will be out of sync w/ cloud
And that should do the trick. If you have everything wired up correctly, it should look just like this. If you try this out, let me know how it goes!