Disarming or dropping a weapon, consumables maybe...

Started by skullywag, January 06, 2015, 03:29:54 AM

Previous topic - Next topic

skullywag

So im trying to make a pawn "throw a weapon" and it be consumed but am having issues. Currently im detecting when the projectile impacts and then trying to remove the "launchers" primary weapon but its not having it. Anyone have any tips in this area. Should i be doing this somewhere else? In something else?
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Rikiki

Is it a one-use weapon like the new rocket launcher?

You could also try to make your own Verb_Shoot class like that:

public class Verb_ShootAndDrop : Verb_Shoot
{
protected override bool TryShotSpecialEffect()
{
if (base.TryShotSpecialEffect())
{
                Equipment weapon = base.CasterPawn.equipment.Primary;
                Equipment droppedWeapon;
                base.CasterPawn.equipment.TryDropEquipment(weapon, out droppedWeapon, this.CasterPawn.Position, false);
return true;
}
return false;
}
}


Code is untested... ::)

skullywag

Ahh the rocket launcher...totally forgot that even existed....thanks Rikiki.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?