Site:
 News/Home
 CNC Guild Forums
 Submissions
 Contact Staff
 
 Downloads:
 Voxels:
 Aircraft
 Ground
 Naval
 Voxel Comp ´06

 SHPs:
 Infantry
 Buildings
 Animation
 Other

 Icons:
 Packs
 Buildings
 Armored
 Infantry

 Maps:
 RA2 Mp maps
 RA2 Sp maps
 YR Mp maps
 YR Sp maps
 Other

 Other:
 paFileDB
 GFX Packs
 TSGFX Packs
 Tutorials
 Utilities
 Mods
 Sounds
 
 Recommended Downloads:
 Ares
 
RA2 Missions Argentina -English-

How to create units that deploy into other units
Submitted by Commodus

First of all, youíre going to need a few things:
A program to view INI files
XCC Mix Editor (to put graphics + ini files into mix files)
Graphics for the units

You are trying to create a unit that can morph into another unit the simple action of double-clicking it to deploy it. The unit will then turn into a fundamentally different unit, i.e :

A cyborg mechanical walker that could be whipped into a battle frenzy by the getting it high on GA (gigadrenaline) drug - this would give it lower hit-points but make its attacking strength much more powerful.
A deadly attack mechanism that can switch between having excellent anti-infantry weapons (poor anti-armor) or excellent anti-armor weapons (poor anti-infantry) - my mod, the Torestine Jihad, has a unit that uses this function. The main part of coding will be used to demonstrate this.
An experimental prototype of a covert, high-tech tank that could switch on cloaking, at the expense of weakening its otherwise powerful gamma ray.

It works in a very similar way to DeeZireís MAD Tank. This tutorial will show you how to make effects like these. First of all, create an entry for a unit, like I have done here with my Ares PAX (Protected Assault Column Section):

[APAX] ; the unit entry
UIName=Name:MTNK
Name=Ares PAX
Image=APAX
Primary=105mm
Prerequisite=GAWEAP ; keep the prerequisite low so you can test it out in game
Strength=300
Category=AFV
Armor=heavy
Turret=yes
IsTilter=yes
Crusher=no
DeploysInto=PHOBOS ; put this tag in to make it deploy into a building - I will explain later on why
TooBigToFitUnderBridge=true
TechLevel=5
Sight=8
Speed=7
CrateGoodie=no
Owner=British,French,Germans,Americans,Alliance
Cost=1200
Points=50
ROT=5
IsSelectableCombatant=yes
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
VoiceSelect=GenAllVehicleSelect
VoiceMove=GenAllVehicleMove
VoiceAttack=GenAllVehicleAttackCommand
VoiceFeedback=
DieSound=GenVehicleDie
MoveSound=GrizzlyTankMoveStart
MaxDebris=10
; origional - Locomotor={55D141B8-DB94-11d1-AC98-006008055BB5}
Locomotor={4A582741-9839-11d1-B709-00A024DDAFD1}
MovementZone=Normal
ThreatPosed=15 ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys,SmallGreySSys
VeteranAbilities=STRONGER,FIREPOWER,SIGHT,FASTER
EliteAbilities=SELF_HEAL,STRONGER,FIREPOWER,ROF
Accelerates=false
ImmuneToVeins=yes
Size=3
OpportunityFire=yes

Donít forget to add an entry in the Vehicle list as well:
Ö
57=CDEST
58=APAX

Now, the reason why you put the tag DeploysInto=PHOBOS, is because we are going to use a workaround to make the deploying work: the Ares PAX deploys into an invisible building which has an active animation that will kill it. The building, upon deployment, gives a free unit, and this free unit is the unit you want the original deployer to turn into. Without much further ado, add the following:

[PHOBOS] ; The building that will make the work around work. The following 5 tags make the building less of a building ie. more of a work around.
Insignificant=yes ; Eva/Zofia wonít announce it as a loss
Spyable=no ; canít be infiltrated
Capturable=no ; canít be captured
Selectable=no ; canít be selected (it defeats the purpose)
Repairable=no ; no point :)
Strength=1 ; This will make the building weak so its easier to clean up the remains once the unit is deployed
Armor=none ; same concept as Strength=1
FreeUnit=PHPAX ; This makes a new unit appear with the building.

PHOBOS is the building which gives you the Phobos PAX as a free unit that came with the building. Add the following to the Active Animation list:

[Number after last one]=PHOBOS_A

Now, open up art.ini and add a section for APAX (nothing special about it - itís the same as any other vehicle) and for the Building - add something like this:

[PHOBOS]
Image=none ; that is, unless you have a good image that can be put inÖ
Buildup=none ; same as Image=
ActiveAnim=PHOBOS_A ; This directs to an animation - explained next

Ö which is when you add an ActiveAnim entry to the Active Animation section. The ActiveAnim is obviously an invisible one, but it will have a tag that makes it do enough damage to a building per minute so that it is destroyed by its own animation, and thus cleaned up. The entry should be something like this.

[PHOBOS_A]; entry name
Rate=300 ; Determines the speed
Damage=1 ; damage done - 1 will be enough to kill the building because its Strength=1

Last but not least, at the entry for the [PHPAX] (Phobos PAX). And voila! Youíre done.
Please note that I have experienced problems when the invisible building was still sitting around near my base. Donít worry, it should disappear after a minute (after all, the definition of Damage= says that it states how much damage is done in a minute)

> Back to Tutorials

Favourites: 
Ares 
Mental Omega 
raminator CnC 
Sleipnir's Stuff 
Wagnerma.de 
 
Webmaster: 
Nighthawk 
 
Affiliates: 
CNC Guild 
Project Perfect Mod 
CNC Source 
Sudden Strike 
C&C Reloaded 
Revora Frontpage 
Revora Hosting 

This site is best viewed at 1024x786  
Aqua Arg site design created by Mig Eater © 1999-2006 Team Revenge  
Should there be any problems with the site, please contact the current webmaster