This process is a lot different than my other guides, so before we begin please read this description: We will be creating (4) things at once, but will try my best to describe it step by step with actual pictures and the sourcecode itself. I will go through the sourcecode alphabetically top to bottom in hopes that helps. To better explain the process below it helps understanding what each class does. So we will start off first explaining that the (2) BulletTypeClass is what fires out of the (3) WeaponTypeClass, the (4) WarheadTypeClass will have the results of the bullet when it hits its target. These 3 will ultimately describe the mechanics of the weapon we are creating which will be the (1) WEAPON_RIFLE2. When finished each bullet will have the damage of an Artillery, distance of an MLRS, & firing speed of a Jeep. I know what your thinking so far that’s insane, well true! Until we give it the warhead characteristics of small arms fire. Now it will be moderately realistic to an automatic 50cal AP FMJ like my RA1 counterpart (Nuclear Specialist).
1)Add to BBDATA.CPP in the (Global Scope) list, but place at the BOTTOM of the list.
#ifdef NUCLEAR_WARFARE // NightFalcon101
static BulletTypeClass const ClassSniper2(
BULLET_SNIPER2,
“50cal2”, // NAME: Text name of this unit type.
false, // Flies over tall walls?
false, // Homes in on target?
false, // Projectile arcs to the target?
false, // Is this a dropping bomb-like object?
true, // Is this projectile invisible?
false, // Will it blow up even if it gets just NEAR to target?
false, // Does it have flickering flame animation?
false, // Can it run out of fuel?
true, // Is there no visual difference between projectile facings?
false, // Is projectile inherently inaccurate?
false, // Translucent colors are used?
false, // Good against aircraft?
0, // ARMING: Time to arm projectile after launch.
0, // RANGE: Inherent override range factor.
MPH_LIGHT_SPEED, // SPEED: Miles per hour.
0, // ROT: Rate of turn (degrees per tick).
WARHEAD_HOLLOW_POINT2, // WARHEAD: If fires weapon, warhead type
ANIM_PIFF // Explosion to use upon impact.
);
#endif // NUCLEAR_WARFARE
1.See BTWTTD01.jpg
2)Add to BBDATA.CPP at the bottom of your enumerated list.
#ifdef NUCLEAR_WARFARE // NightFalcon101
&ClassSniper2, // BULLET_SNIPER2
#endif // NUCLEAR_WARFARE
2.See BTWTTD02.jpg
3)Add to the One_Time list in the exact location displayed in the picture.
#ifdef NUCLEAR_WARFARE // NightFalcon101
if (!bullet.IsInvisible) {
_makepath(fullname, NULL, NULL, “50cal”, “.SHP”);
((void const *&)bullet.ImageData) = MixFileClass::Retrieve(fullname);
}
#endif // NUCLEAR_WARFARE
3.See BTWTTD03.jpg
4)We will now construct the bullet in CONST.CPP under the bullet (Global Scope).
(EXAMPLE)
#ifdef NUCLEAR_WARFARE // NightFalcon101
{BULLET_SNIPER2, 150, 30, 0x0A00, VOC_SNIPER, ANIM_MUZZLE_FLASH}, // WEAPON_RIFLE2
#endif // NUCLEAR_WARFARE
4.See BTWTTD04.jpg
5)Right underneath where we were just at we will build the warhead in CONST.CPP in the warhead (Global Scope).
(EXAMPLE)
#ifdef NUCLEAR_WARFARE // NightFalcon101
{ 4,false,false,false,{0x100, 0x80, 0x90, 0x40, 0x40}}, // WARHEAD_HOLLOW_POINT2 Sniper Bullet Type 2
#endif // NUCLEAR_WARFARE
5.See BTWTTD05.jpg
6)Add your initial project definition in DEFINES.H file, (although its not needed it helps organize your entries).
/*
** NightFalcon101 NUCLEAR_WARFARE MOD With Nuclear Aircraft, Building, Infantry, & Unit Added.
*/
#define NUCLEAR_WARFARE // NightFalcon101 NUCLEAR_WARFARE MOD With Nuclear Aircraft, Building, Infantry, & Unit Added.
#ifdef NUCLEAR_WARFARE // NightFalcon101
#endif // NUCLEAR_WARFARE
6.See BTWTTD06.jpg
7)Now we will scroll down the DEFINES.H file to the WarheadType enumerated list this will be placed on the bottom.
#ifdef NUCLEAR_WARFARE // NightFalcon101
WEAPON_RIFLE2,
#endif // NUCLEAR_WARFARE
7.See BTWTTD07.jpg
8)Right underneath where we were just at in DEFINES.H file go to WeaponType enumerated list this will be placed on the bottom.
#ifdef NUCLEAR_WARFARE // NightFalcon101
WEAPON_RIFLE2,
#endif // NUCLEAR_WARFARE
8.See BTWTTD08.jpg
9)This step isn’t but is needed since we need to attach the weapon to the unit, its easier to look at the picture.
#ifdef NUCLEAR_WARFARE // NightFalcon101
// Nuclear Commando
int NuclearCommandoDos[DO_COUNT][3] = {
0, 1, 1, // DO_STAND_READY
8, 1, 1, // DO_STAND_GUARD
160, 1, 4, // DO_PRONE
16, 6, 6, // DO_WALK
64, 4, 4, // DO_FIRE_WEAPON
96, 2, 2, // DO_LIE_DOWN
112, 4, 4, // DO_CRAWL
144, 2, 2, // DO_GET_UP
160, 4, 4, // DO_FIRE_PRONE
192, 16, 0, // DO_IDLE1
208, 16, 0, // DO_IDLE2
224, 13, 0, // DO_ON_GUARD
228, 9, 0, // DO_FIGHT_READY
237, 2, 0, // DO_PUNCH
239, 6, 0, // DO_KICK
245, 2, 0, // DO_PUNCH_HIT1
247, 4, 0, // DO_PUNCH_HIT2
251, 4, 0, // DO_PUNCH_DEATH
255, 2, 0, // DO_KICK_HIT1
257, 4, 0, // DO_KICK_HIT2
261, 5, 0, // DO_KICK_DEATH
266, 5, 0, // DO_READY_WEAPON
318, 8, 0, // DO_GUN_DEATH
334, 8, 0, // DO_EXPLOSION_DEATH
334, 8, 0, // DO_EXPLOSION2_DEATH
342, 12, 0, // DO_GRENADE_DEATH
354, 18, 0, // DO_FIRE_DEATH
372, 3, 3, // DO_GESTURE1
396, 3, 3, // DO_SALUTE1
420, 3, 3, // DO_GESTURE2
444, 3, 3, // DO_SALUTE2
0, 1, 1, // DO_PULL_GUN // N/A
0, 1, 1, // DO_PLEAD // N/A
0, 1, 1 // DO_PLEAD_DEATH // N/A
};
static InfantryTypeClass const NuclearCommando(
INFANTRY_NCMD, // Infantry type number.
TXT_NCMD, // Translate name number for infantry type.
“NCMD”, // INI name for infantry.
7, // Build level.
STRUCTF_REPAIR, // Building prerequisite.
false, // Is this a female type?
true, // Is a leader type?
true, // Has crawling animation frames?
false, // Is this a civlian?
false, // Always use the given name for the infantry?
false, // Is this a “fraidycat” run-away type infantry?
false, // Can this infantry type capture a building?
false, // Theater specific graphic image?
-1, // Number of shots it has (default).
&NuclearCommandoDos[0][0], // ptr to DO table
2, // Frame of projectile launch.
2, // Frame of projectile launch while prone.
180, // Strength of infantry (in damage points).
10, // Sight range.
2000, // Cost of infantry (in credits).
1, // Scenario when they first appear.
80, 75, // Risk/Reward of this infantry unit.
HOUSEF_MULTI1 |
HOUSEF_MULTI2 |
HOUSEF_MULTI3 |
HOUSEF_MULTI4 |
HOUSEF_MULTI5 |
HOUSEF_MULTI6 |
HOUSEF_JP |
HOUSEF_GOOD |
HOUSEF_BAD, // Who can own this infantry unit.
WEAPON_RIFLE2, WEAPON_NONE, // <– ADD WEAPON IN THIS SECTION.
MPH_SLOW_ISH // Maximum speed of infantry.
);
#endif // NUCLEAR_WARFARE
9.See BTWTTD09.jpg
And that wraps up our share on Command & Conquer™ Remastered Collection: C&C REMASTERED – TD – ADDING NEW BULLET & NEW WEAPON TYPES. If you have any additional insights or tips to contribute, don’t hesitate to drop a comment below. For a more in-depth read, you can refer to the original article here by NightFalcon101, who deserves all the credit. Happy gaming!