

Now that you have the code ready, it is time to compile it and test it out. In case the unit is UNIT_NUKE_TANK, the coordinate will be 240 leptons (?) above the center of the turret.Īnd that's it. WEAPON_NUKE_LOB,WEAPON_NONE means that primary weapon is WEAPON_NUKE_LOB and that there is no secondary weapon.Īnd just like the weapons, you need to add the pointer to this class at UnitTypeClass::Pointers.Ĭoord = Coord_Move(coord, DIR_N, 0x00A0) The weapons are set right after the houses. but the real deal is HOUSEF_GOOD means that GDI can build it and HOUSEF_BAD means that Nod can build it. Except for HOUSEF_BAD, everything else is mere formality that does not deny any player from building it nor the "Disaster Containment Team" to own it. The house/faction that this unit belongs is defined by HOUSEF_MULTI1 | HOUSEF_MULTI2 | HOUSEF_MULTI3 | HOUSEF_MULTI4 | HOUSEF_MULTI5 | HOUSEF_MULTI6 | HOUSEF_JP | HOUSEF_BAD. Most things there are explained by Petroglyph/Westwood's documentation, so I will focus on few things above. MISSION_HUNT // ORDERS: Default order to give new unit. MPH_KINDA_SLOW, // SPEED: Miles per hour.ģ, // ROT: Rate of turn (degrees per tick).Ġ, // Turret center offset along body centerline. HOUSEF_BAD, // OWNABLE: Ownable by house (bit field). 1, // AMMO: Number of shots it has (default).Ħ00, // STRENGTH: Strength (in damage points).ġ0, // SCENARIO: Starting availability scenario.Ĩ0,80, // RISK/RWRD: Risk/reward rating values. True, // Is this a gigundo-rotund-enormous unit?įalse, // Is the unit's art as "chunky" cardinal facing only?įalse, // Is the unit capable of cloaking?įalse, // Does the unit have a constant animation? True, // Does it lay tracks while moving? True, // Can the player construct or order this unit?įalse, // Does it have a rotating radar dish?įalse, // Is there an associated firing animation?įalse, // Must the turret be in a locked down position while moving? True, // Can it be repaired in a repair facility?

True, // Is it equipped with a combat turret?įalse, // Fires multiple shots in quick succession? True, // Can it be a target for attack or move?įalse, // Is it insignificant (won't be announced)?įalse, // Is it immune to normal combat damage? True, // Can this be a goodie surprise from a crate?įalse, // Always use the given name for the vehicle?įalse, // Is this a typical transport vehicle?įalse, // Can it be crushed by a heavy vehicle?įalse, // Does this unit harvest Tiberium? STRUCTF_TEMPLE, // Building prerequisite. "NTNK", // NAME: Text name of this unit type.ĪNIM_ART_EXP1, // EXPLOSION: Type of explosion when destroyed. TXT_HTANK, // NAME: Text name of this unit type. You should add a pointer to the NukeLob class at the end of the list. If anyone wants me to explain each attribute, it will be done in a later version of this tutorial.Īnd finally, in order to allow the game to use this class, it must know about it at the same BBDATA.CPP, there is an array of pointers below called BulletTypeClass::Pointers.

So we have a class called NukeLob that inherits BulletClass and it has all the attributes documented above. WARHEAD_HE, // WARHEAD: If fires weapon, warhead typeĪNIM_ATOM_BLAST // Explosion to use upon impact. MPH_MEDIUM_FAST, // SPEED: Miles per hour.Ġ, // ROT: Rate of turn (degrees per tick). True, // Is projectile inherently inaccurate?Ġ, // ARMING: Time to arm projectile after launch.Ġ, // RANGE: Inherent override range factor. True, // Is there no visual difference between projectile facings? "BOMB", // NAME: Text name of this unit type.įalse, // Is this a dropping bomb-like object?įalse, // Will it blow up even if it gets just NEAR to target?įalse, // Does it have flickering flame animation? In Nuke Tank's case, we will only define labels for the unit, projectile, weapon type and voice (sound effect played when you select the unit or order it to do something).Īt the typedef enum UnitType, you should define a new constant to your unit before UNIT_COUNT, as seen in bold. Once you are able to compile the source code, let's move on:ġ) Define the constants for your new unit.Īt the file DEFINES.H, you will need to defines constants that you will use to refer to your unit, projectile, weapon type, voice and few other entities that you may need to create to allow your unit to work as you desire. We recommend you to follow the instructions of this topic to do it. So, let's show how they have coded this Nuke Tank, shall we?įirst of all, all units in Tiberian Dawn are declared inside the DLL, so you will need appropriate tools (Visual Studio compatible IDE) to open the source code and compile it. “What would the Brotherhood of Nod do if they captured the Mammoth Tank?” Well, one guess is they’d replace the turret with a giant artillery cannon, and have it fire tactical nukes! Thus, the Nuke Tank was born.
