Nah, "DropWhenKilled" is another story, he was speaking about Monster.Weapon >> Pawn.Weapon which is not the same thing with "DropWhenKilled" - these are 2 different things: Skaarj can drop weapon and... some armor if me, mapper, I want that. By example monsters spawned in my map doesn't use any DropWhenKilled but they do drop weaponry at death - non-bugged weapons. DropWhenKilled is actually working similar to "content" from decorations - dropped at destroying them and nothing else.
MrLoathsome wrote:
The pawns Weapon that they use NEVER actually gets dropped.
Skaarj by default drop weapon when dies. If we speak about Skaarjs from map, they do drop an invisible bugged weapon - happening all time (in servers) if you have failed old MH parties and where UTJ (called sauce-on-pizza by a "genius") was fixing nothing. All time I used Insta dropped by Skaarj in BirdBrainedResearch map, for cleaning the rest of areas. Even without to see it in HUD, it was fully operational.
I'm sorry to tell you people a small secret: I know these Skaarj types better than my pocket. The only thing miss-understood by me is timing deal: when does weapon spawn, which state, physics, etc. toward Skaarj Instigator which seems to change state or... weapon cannot do a touch that early or Skaarj is not colliding things yet, or... Once held a weapon, we can speak about P.Weapon, else LOG these if you don't believe me.
Edit:More hints. Pawn.uc - function died
Code: Select all
function Died(pawn Killer, name damageType, vector HitLocation)
{
local pawn OtherPawn;
local actor A;
// mutator hook to prevent deaths
// WARNING - don't prevent bot suicides - they suicide when really needed
if ( Level.Game.BaseMutator.PreventDeath(self, Killer, damageType, HitLocation) )
{
Health = max(Health, 1); //mutator should set this higher
return;
}
if ( bDeleteMe )
return; //already destroyed
Health = Min(0, Health);
for ( OtherPawn=Level.PawnList; OtherPawn!=None; OtherPawn=OtherPawn.nextPawn )
OtherPawn.Killed(Killer, self, damageType);
if ( CarriedDecoration != None )
DropDecoration();
level.game.Killed(Killer, self, damageType);
//log(class$" dying");
if( Event != '' )
foreach AllActors( class 'Actor', A, Event )
A.Trigger( Self, Killer );
Level.Game.DiscardInventory(self);
....
And then GameInfo.uc function DISCARDINVENTORY, check details:
Code: Select all
function DiscardInventory( Pawn Other )
{
local actor dropped;
local inventory Inv;
local weapon weap;
local float speed;
if( Other.DropWhenKilled != None ) //#1
{
dropped = Spawn(Other.DropWhenKilled,,,Other.Location);
Inv = Inventory(dropped);
if ( Inv != None )
{
Inv.RespawnTime = 0.0; //don't respawn
Inv.BecomePickup();
}
if ( dropped != None )
{
dropped.RemoteRole = ROLE_DumbProxy;
dropped.SetPhysics(PHYS_Falling);
dropped.bCollideWorld = true;
dropped.Velocity = Other.Velocity + VRand() * 280;
}
if ( Inv != None )
Inv.GotoState('PickUp', 'Dropped');
}
if( (Other.Weapon!=None) && (Other.Weapon.Class!=Level.Game.BaseMutator.MutatedDefaultWeapon()) //#2
&& Other.Weapon.bCanThrow )
{
speed = VSize(Other.Velocity);
weap = Other.Weapon;
if (speed != 0)
weap.Velocity = Normal(Other.Velocity/speed + 0.5 * VRand()) * (speed + 280);
else {
weap.Velocity.X = 0;
weap.Velocity.Y = 0;
weap.Velocity.Z = 0;
}
Other.TossWeapon();
if ( weap.PickupAmmoCount == 0 )
weap.PickupAmmoCount = 1;
}
Other.Weapon = None;
Other.SelectedItem = None;
for( Inv=Other.Inventory; Inv!=None; Inv=Inv.Inventory )
Inv.Destroy();
}
See BOTH #1 and #2 they are different things, else if you are well oriented you can take in account
Other.Weapon.bCanThrow if you really wanna write a good code. As long as weapon is "dropable" always Pawn holder will drop it doesn't matter if Pawn is monster or me, or you, or anybody.
If memory doesn't cheat me reinventing wheel might not be recommended, we might have a mutator for not dropping weapons which can be a bit loved.