Game Development Community

Stock 1.2 Cheetah/Turret Errors

by Gibby · in Torque 3D Professional · 07/03/2012 (9:09 am) · 4 replies

Greets All:

I am hard at work on a vehicle AI package I'm collaborating on with Sean Rice. Last night I encountered what I thought was script error of mine, yet after an hour, tried a stock install of 1.2 and found it there too. After the Cheetah's Turret is fired, this error is in the console:

Quote:

scripts/server/inventory.cs (158): Unable to find object: 'BulletAmmo' attempting to call function 'getName'
scripts/server/inventory.cs (158): Unable to find object: 'BulletAmmo' attempting to call function 'getName'


Anyone know of a way around this?

#1
07/03/2012 (10:44 am)
That's because the TurretImage, the weapon, for the Cheetah is actually bypassing the need for ammo, yet is still using the default onFire() method that says to subtract from ammo for each shot. Shapebase inventory code sees this and looks up the ammo name for the image (BulletAmmo), which of course doesn't exist.

Options are to either make the cheetah turret use and track ammo, or create a custom onFire() method for it that doesn't try to decrement ammo.
#2
07/03/2012 (7:59 pm)
The correct way, while keeping the original system, would be to set the infiniteAmmo = true; on the TurretImage so that is bypasses the the ammo decrements.

An error is an error, every one should be corrected.
#3
07/04/2012 (7:04 am)
Yep, that's an option as well. Having written the default onFire() method I tend to forgot that the inifiniteAmmo check is in there since it was added after the fact. It would certainly be a simpler change if the object is just to get rid of the error message.

Another alternative is to make the TurretImage an energy based weapon.
#4
07/04/2012 (8:38 am)
@Michael - ooooh, energy based... time to pull our the eneryprojectile code :)