ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Adding A Kamikaze Airstrike To RA2/YR

From ModEnc
Jump to navigation Jump to search

This is a fairly easy method of adding a suicide bomber aircraft and/or it's superweapon. Note: Requires RockPatch 1.06 or later. Note: All credit for the warhead, projectile and airplane goes to Renegade, while Electro designed the superweapon code.

The Missile Code:

The missile code is placed in the rules(md).ini. Of course you may tailor it to your needs.

[MissileJump]
Damage=40              ;Determines the amount of damage caused
ROF=45                 ;Determines the Rate Of Fire
Range=6                ;Determines the range at which the plane will start diving into it's target
Speed=80               ;Determines the speed of the diving plane
Warhead=CruiseAP       ;Determines which warhead will be used for the missile
OmniFire=yes           ;See OmniFire
Projectile=SCDMISSILE1 ;Set's which projectile to use as the payload
LimboLaunch=yes        ;Here's the limbo launch trick

The Warhead Code:

The warhead code is also placed in the rules(md).ini. Of course you may tailor it to your needs.

[CruiseAP]
CellSpread=1.3                                          ;Determines the radius of the warheads blast
Wall=yes                                                ;Determines if the warhead can destroy walls
Wood=yes                                                ;Determines if the warhead can damage terrain
Verses=25%,25%,15%,75%,100%,100%,100%,95%,90%,100%,100% ;See Verses
Conventional=yes                                        ;See Conventional 
InfDeath=2                                              ;See InfDeath
AnimList=MININUKE                                       ;Determines anim played when warhead explodes
ProneDamage=100%                                        ;See ProneDamage
MinDebris=1                                             ;See MinDebris
MaxDebris=2                                             ;See MaxDebris

The Projectile Code:

The projectile code is also placed in the rules(md).ini. Of course you may tailor it to your needs.

[SCDMISSILE1]
Image=FALC            ;Determines the image of the projectile, currently set to Harrier's image
AA=no                 ;Determines if the projectile can damage airborne units
Arm=2                 ;See Arm
AG=yes                ;See AG
ROT=8                 ;Rate Of Turn, requires to use Rotates
Shadow=yes            ;Determines should a shadow be drawn on the ground
Proximity=no          ;See Proximity
Ranged=no             ;See Ranged
FirersPalette=yes     ;This tag can only be used on SHP projectiles, so it's useless here
SubjectToCliffs=no    ;See SubjectToCliffs
SubjectToElevation=no ;See SubjectToElevation
SubjectToWalls=no     ;See SubjectToWalls

The Kamikaze Airplane:

This is the kamikaze airplane code. It is placed (again) in rules(md).ini. It has to be specified in AircraftTypes. You should also add the appropriate string into Ra2md.csf. You may tailor it to your needs.

[CRUISEM]
Image=FALC
UIName=Name:CRUISEM
Name=Kamikaze Airplane
Primary=MissileJump         ;Weapon to use when it kamikazes into it's target
DeathWeapon=HornetCollision ;Alternate weapon when it gets shot down
CanPassiveAquire=no
CanRetaliate=no
Strength=120
Category=AirLift
Armor=light
TechLevel=-1 
Sight=0
RadarInvisible=no
Landable=yes
MoveToShroud=yes
PipScale=Ammo
Speed=16
PitchSpeed=1.1
PitchAngle=0
OmniFire=yes
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,YuriCountry
Cost=1000
Points=20
ROT=3
Ammo=1
Crewed=no
ConsideredAircraft=yes
AirportBound=no
GuardRange=1
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=3
IsSelectableCombatant=no
VoiceSelect=ChaosDroneSelect
VoiceAttack=ChaosDroneAttackCommand
VoiceMove=ChaosDroneMove
VoiceFeedback=
VoiceCrashing=ChaosDroneDie
DieSound=
MoveSound=IntruderMoveLoop
CrashingSound=IntruderDie
ImpactLandSound=GenAircraftCrash
Locomotor={4A582746-9839-11d1-B709-00A024DDAFD1}
MovementZone=Fly
ThreatPosed=20
DamageParticleSystems=SparkSys,SmallGreySSys
AuxSound1=IntruderTakeOff
AuxSound2=IntruderLanding
Fighter=yes
AllowedToStartInMultiplayer=no
ImmuneToPsionics=yes
ImmuneToRadiation=yes
PreventAttackMove=yes
Trainable=no
Spawned=yes

Superweapon Code:

The superweapon code is (again) placed in the rules(md).ini. You must list the superweapon in SuperWeaponTypes. I don't recommend editing anything here but: RechargeTime, IsPowered, Spyplane, SpyplaneNums, ShowTimer, SidebarImage and EvaReady. You must add a different action. See Adding Custom Actions for help.

[AirstrikeSpecial]
UIName=Name:KAZI
Name=Kamikaze Airstrike 
IsPowered=false             ;Defines whether this superweapon requires base power to be online
RechargeTime=4              ;Time until it charges up
Type=SpyPlane               ;SpyPlane is the type for SpyPlane clones or Airstrikes
Action=Kazi                 ;check out the Adding custom Actions page to find out more about this
SidebarImage=KAZICON        ;Cameo in the sidebar
ShowTimer=no                ;Should everyone be allowed to see the timer
DisableableFromShell=no     ;Defines can this superweapon be disabled by turning off superweapons 
FlashSidebarTabFrames=120   ;See FlashSidebarTabFrames
AITargetingType=1           ;Defines where will the AI use this superweapon. See AI Targeting for info
SpyPlane=CRUISEM            ;Sets which plane will be used for the airstrike
SpyPlanesNum=3              ;The number of planes which will kamikaze
IsAirstrike=yes             ;Defines is this an airstrike or spyplane
EvaReady=EVA_AirstrikeReady ;The sound which is played when it's fully charged up

Without RockPatch

Attempting to create a Kamikaze plane based on LimboLaunch=yes in RA2 will result in having the engine count the airplane as if it still existed, even when it has been limboed, thus a dot will be seen on the radar map on the location it detonated, although it is not really there. And Suicide=yes on an aircraft-fired weapon results in an IE. This is obviously not what you'd want. Thus:

Create an airplane and give it a primary weapon with the following flags:

rules.ini:

Damage=1
Projectile=Invisible   ;THIS IS IMPORTANT
Anim=SUICIDE_ANIM      ;A NEW ANIM. THIS IS VERY IMPORTANT!
Range= This should be equal to the distance the plane travels while falling (when being shot). 

For those with Fighter=yes, it should be about 5, those with Fighter=no drop vertically.

Warhead=NullWH ;any dummy warhead

Then, give the plane a powerful Secondary= or DeathWeapon=. This should be the weapon you want the plane to hit your enemies with in in its suicide attack.

Then, open art.ini and create an animation called SUICIDE_ANIM (or whatever the name of Anim of the weapon was). You can give it any animation you like. Give it a Damage= at least equal to the Strength= of the Kamikaze Plane.

Now, once the plane gets in range of its target and fires, the firing animation the weapon sets off will cause damage to the airplane and destroy it. If the primary weapon's Range= was set to the right distance, the plane will then crash into whatever was targetted.

Note however, that this cannot be put on a superweapon in RA2, since the only plane spawned by a SW action is the Paradrop Plane, which doesn't really fire its weapon.

This also works in TS.

With vanilla RA2 NO animation required

The simple DetonationAltitude=1 method:

rules(md).ini


[HornetBomb]
OmniFire=yes
Projectile=SuicideP
; Make sure I have Damage=x enough to kill myself. Default value is strong enough already
[SuicideP]
DetonationAltitude=1
Dropping=yes
Image=none

All this does is set the DetonationAltitude to an impossibly low number meaning that this projectile will explode whenever it's fired above that height

This works so long as the unit caries a weapon / warhead combination powerful enough to kill itself. This is a universal technique that works on jumpjet, pad aircraft as well as spawned ones and is useful as spawned aircraft do not support firing animations.

Very rarely this may fail due to extremely fast units with high speed. To fix this, increase the damage and add a cell spread value to the warhead