Game Development Community

WTH? Where is "BulletAmmo" defined?

by Vince Gee · in Torque 3D Professional · 04/09/2013 (7:22 pm) · 7 replies

Ok, so I'm working through the code and since DNT checks objects and stuff, the Cheetah has

className = "WeaponImage";
   class = "WeaponImage";

   // Projectile and Ammo
   [b]ammo = BulletAmmo;[/b]

   projectile = TurretProjectile;
   projectileType = Projectile;
   projectileSpread = "0.01";

Where is this object defined? More importantly, how does the engine work w/out it defined?

Vince

#1
04/09/2013 (7:56 pm)
And while we are at it shouldn't the turretImage be set to infinitammo?
datablock ShapeBaseImageData(TurretImage)
{
   // Basic Item properties
   shapeFile = "art/shapes/Cheetah/Cheetah_Turret.DAE";
   emap = true;
   infiniteAmmo=true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 1;
#2
04/09/2013 (8:52 pm)
...
#3
04/09/2013 (10:39 pm)
Well Vince in my copy of T3D BulletAmmo is defined in art/datablocks/weapons/Soldier_gun.cs. It helps to know which release or commit hash of T3D you're using these days since there's so many versions now.
#4
04/10/2013 (10:31 am)
BulletAmmo is defined nowhere in the current Github repository (dev or master branches - or even the FPS Tutorial project). So Nathan, what version of T3D are you using?

As for why the cheetah turret weapon still works, look at the onMount() callback for it. The use of setImageAmmo(%slot, true) sets a flag that lets the Image know that it has ammo, circumventing the check for named ammo altogether. But still, we should probably get that cleaned up at some point in order to get rid of the warnings/errors in the console that it can cause as well as to avoid this confusion .
#5
04/10/2013 (11:36 am)
Perhaps a standard that asks us to define our weapon's base ammunition datablocks in the same file as the weapon so that the base ammo is always defined and available when the weapon is?

Or note it somewhere under Best Practices?
#6
04/10/2013 (11:40 am)
Yeah Richard that's pretty much an unspoken standard already... Personally I'm ready to end-of-life the current templates and create new ones from the ground up, then it would easier to enforce such a standard.
#7
04/10/2013 (2:32 pm)
Well, that was sort of where I was going with that - it's been an unspoken standard, but perhaps it's time to speak it....