how would i make a specific weaon have infinate ammo?
by Ace · in General Discussion · 03/22/2002 (7:06 pm) · 3 replies
im hoping theres an esy way to do this (i just aint found it yet)most "good" games have a start weapon that dont use up ammo and id like to put with the following code if i could:
//ace
%weapon = new Item()
{
// Let this point to the type of weapon
// (Rifle and Crossbow being the defalt)
dataBlock = Crossbow;
};
%ammo = new Item()
{
dataBlock = CrossbowAmmo;
};
MissionCleanup.add(%weapon);
MissionCleanup.add(%ammo);
%player.pickup(%weapon, 1);
%player.pickup(%ammo, 1);
//endace
//ace
%weapon = new Item()
{
// Let this point to the type of weapon
// (Rifle and Crossbow being the defalt)
dataBlock = Crossbow;
};
%ammo = new Item()
{
dataBlock = CrossbowAmmo;
};
MissionCleanup.add(%weapon);
MissionCleanup.add(%ammo);
%player.pickup(%weapon, 1);
%player.pickup(%ammo, 1);
//endace
About the author
Ace Owner of NoESCape.sytes.net starting from the beginning on 3d torque
Torque Owner Ace
in crosbow.cs the last function
function CrossbowImage::onFire(%this, %obj, %slot)
{
%projectile = %this.projectile;
// Decrement inventory ammo. The image's ammo state is update
// automatically by the ammo inventory hooks.
%obj.decInventory(%this.ammo,0);
i just changed
%obj.decInventory(%this.ammo,1);
to a value of 0
[edit] im not going to use the cbow for it ,its just everyone has one [/edit]