im working on a Armor Shard, and it should be able to pickup more than one at a time... heres my code, i cant figure out where it checks if the item is already present... (just using the armor2 code)
PHP:
//=============================================================================
// Armor Shard.
//=============================================================================
class AShard extends TournamentPickup;
#exec MESH IMPORT MESH=AShard ANIVFILE=MODELS\AShard_a.3d DATAFILE=MODELS\AShard_d.3d X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=AShard X=0 Y=0 Z=0
#exec MESH SEQUENCE MESH=AShard SEQ=All STARTFRAME=0 NUMFRAMES=30
//#exec MESH SEQUENCE MESH=AShard SEQ=??? STARTFRAME=0 NUMFRAMES=30
#exec MESHMAP NEW MESHMAP=AShard MESH=AShard
#exec MESHMAP SCALE MESHMAP=AShard X=0.1 Y=0.1 Z=0.2
#exec TEXTURE IMPORT NAME=JSHD1 FILE=AShardtex.pcx GROUP=Skins FLAGS=2
#exec TEXTURE IMPORT NAME=JSHD1 FILE=AShardtex.pcx GROUP=Skins PALETTE=JSHD1
#exec MESHMAP SETTEXTURE MESHMAP=AShard NUM=1 TEXTURE=JSHD1
function bool HandlePickupQuery( inventory Item )
{
local inventory S;
if ( item.class == class )
{
S = Pawn(Owner).FindInventoryType(class'UT_Shieldbelt');
if ( S==None )
{
if ( Charge<Item.Charge )
Charge = Item.Charge;
}
else
Charge = Clamp(S.Default.Charge - S.Charge, Charge, Item.Charge );
if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogPickup(Item, Pawn(Owner));
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogPickup(Item, Pawn(Owner));
if ( PickupMessageClass == None )
Pawn(Owner).ClientMessage(PickupMessage, 'Pickup');
else
Pawn(Owner).ReceiveLocalizedMessage( PickupMessageClass, 0, None, None, Self.Class );
Item.PlaySound (PickupSound,,2.0);
Item.SetReSpawn();
return true;
}
if ( Inventory == None )
return false;
return Inventory.HandlePickupQuery(Item);
}
function inventory SpawnCopy( pawn Other )
{
local inventory Copy, S;
Copy = Super.SpawnCopy(Other);
S = Other.FindInventoryType(class'UT_Shieldbelt');
if ( S != None )
{
Copy.Charge = Min(Copy.Charge, S.Default.Charge - S.Charge);
if ( Copy.Charge <= 0 )
{
S.Charge -= 1;
Copy.Charge = 1;
}
}
return Copy;
}
defaultproperties
{
bDisplayableInv=True
PickupMessage="You got an Armor Shard."
ItemName="Armor Shard"
RespawnTime=20.000000
Charge=5
PickupViewMesh=AShard
ArmorAbsorption=5
bIsAnArmor=True
AbsorptionPriority=7
MaxDesireability=1.000000
PickupSound=Sound'botpack.Pickups.ArmorUT'
Mesh=AShard
AmbientGlow=64
CollisionHeight=11.000000
}