Creating a New Missile Type
by Psycho
You know that, in the game, there are 3 hardcoded spawning missiles:
V3 rocket, Drednaught missile and Boomer missile. You cannont add a new
spawning missile type in the game. I have found a way to do new missile
type in both Red Alert 2 and Yuri's Revenge. This is done using the Hornet
spawning logic and suiciding spawned aircraft. Here I'll only write an
example how to create a new Tomahawk spawning system with the Tomahawk
Launcher.
Required voxels:
tomahwk.vxl = Tomahawk Launcher with missile; missile cannot have remap
tomahwkwo.vxl = Tomahawk Launcher without missile
tmiss.vxl = Tomahawk missile; cannot have remap
tjump.vxl = Same Tomahawk Missile voxel; cannot have remap
you must have the required HVA files for the voxels.
Now open up the art.
Add the following code:
[TOMAHWK]
Voxel=yes
Remapable=yes
Cameo=THWKICON
AltCameo=THWKUICO
PrimaryFireFLH=50,-10,170
[TMISS]
Trailer=V3TRAIL
TrailerSeperation=50
SpawnDelay=2
Voxel=yes
Remapable=yes
CanBeHidden=no
[TJUMP]
Voxel=yes
Trailer=V3TRAIL
TrailerSeperation=50
Now open up the rules file and add the following code:
Rules entry:
[TOMAHWK]
UIName=Name:TOMAHAWK
Name=Tomahawk Launcher
Category=AFV
Prerequisite=GAWEAP,GATECH ;Change as you like
Primary=TomahawkLauncher
CanPassiveAquire=no
Spawns=TMISS
SpawnsNumber=1
SpawnRegenRate=400
SpawnReloadRate=0
NoSpawnAlt=yes
Strength=300
Armor=light
TechLevel=10
Turret=no
CrateGoodie=yes ; Can be available via crate?
Sight=7
Speed=5
Owner=British,French,Germans,Americans,Alliance
Cost=800
Soylent=800
Points=40
ROT=5
AllowedToStartInMultiplayer=no
Crusher=yes
Crewed=yes
IsSelectableCombatant=yes
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
VoiceSelect=GenAllVehicleSelect
VoiceMove=GenAllVehicleMove
VoiceAttack=GenAllVehicleAttackCommand
VoiceFeedback=
DieSound=GenVehicleDie
MoveSound=GrizzlyTankMoveStart
CrushSound=TankCrush
MaxDebris=3
Locomotor={4A582741-9839-11d1-B709-00A024DDAFD1}
MovementZone=Destroyer
ThreatPosed=25
DamageParticleSystems=SparkSys,SmallGreySSys
Weight=3.5
VeteranAbilities=STRONGER,FIREPOWER,ROF,SIGHT,FASTER
EliteAbilities=SELF_HEAL,STRONGER,FIREPOWER,ROF
AccelerationFactor=0.01
ZFudgeColumn=8
ZFudgeTunnel=13
Size=3
GuardRange=9
TooBigToFitUnderBridge=true
Bunkerable=no
[TomahawkLauncher]
Damage=1
ROF=150
Range=25
MinimumRange=5
Spawner=yes
Projectile=InvisibleHigh
Speed=10
Warhead=Special
[TMISS]
UIName=Name:TMISS
Name=Tomahawk Missile
Primary=TomahawkGroundHit ;Dummy weapon
Secondary=TomahawkCollision ;Actual Damaging Weapon
DeathWeapon=TomahawkCollision ;Actual Damaging Weapon
Strength=75
Category=AirPower
Armor=special_2
Spawned=yes
MissileSpawn=yes
TechLevel=-1
Sight=1
RadarInvisible=no
Landable=no
MoveToShroud=yes
Speed=16
PitchSpeed=.9
PitchAngle=0
Owner=British,French,Germans,Americans,Alliance
Cost=50
Points=20
ROT=3
Ammo=1
Crewed=no
GuardRange=30
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=2
Locomotor={4A582746-9839-11d1-B709-00A024DDAFD1} Hornet Locomotor
MovementZone=Fly
MovementRestrictedTo=Water ;See if this will affect landing only
ThreatPosed=10
DamageParticleSystems=SparkSys,SmallGreySSys
AuxSound1=V3Attack
ImmuneToPsionics=yes
NoShadow=yes
Selectable=no
Trainable=no
DontScore=yes
OpportunityFire=yes
ConsideredAircraft=yes
PreventAttackMove=yes
IsSelectableCombatant=no
CanPassiveAquire=no
CanRetaliate=no
Dock=NONE
AirportBound=yes
[TomahawkGroundHit]
Damage=1
ROF=45
Range=4
Speed=80
Warhead=TomaHawkWH
OmniFire=yes
Projectile=TMJUMP
[TomahawkCollision]
Damage=250
ROF=45
Range=4
Speed=80
Warhead=TomahawkWH
OmniFire=yes
Projectile=TMJUMP
[TMJUMP]
Image=TJUMP
AA=no
AN=no
Arm=2
ROT=8
Shadow=no
Proximity=yes
Ranged=yes
FirersPalette=yes
[TomahawkWH]
CellSpread=1
PercentAtMax=.25
Wall=yes
Wood=yes
Verses=100%,90%,80%,90%,70%,70%,100%,100%,50%,80%,0%
Conventional=yes
Rocker=yes
InfDeath=2
AnimList=XGRYSML1,XGRYSML2,EXPLOSML,XGRYMED1,XGRYMED2,EXPLOMED,EXPLOLRG,TWLT070
Deform=10%
DeformThreshhold=300
Tiberium=yes
Sparky=no
Bright=yes
ProneDamage=70%
Now:
* add TOMAHWK at [VehicleTypes] list
* add TMISS at the line PadAircraft= and [AircraftTypes] list
How It Works:
Well, I told you before that it uses normal Hornet spawn logic. The
TMISS is an aircraft. When it is spawned, it moves to the target, when
it get its target in the range, it fires its primary weapon (dummy). Now
as its airport bounded, it searches for an airport to land and dock, but
there is no airport named as NONE so it crashes. When crashing it disappears
in the sky but it has a death weapon which projectile is same looking voxel
as the missile. The death weapon then hits the target.
Good Features:
* It can be destroyed by AA weapon in the air when flying, like V3
missile.
Bugs:
* Launching isn't smooth.
* It stops for a while in the sky when near target.
* When falling, it cannot be destroyed by AA weapon.
* Missile voxel shouldn't have remap, it causes graphical problems
with remap.
* Can still hit any random object when shot down.
Here's a movie attach to show how it works. Two Tomahawk Launchers launch
2 missiles against the barracks, one of them is shot down by the Patriot
Missile and the other hits the barracks.