Unequip Any Weapon

Post » Tue May 17, 2011 9:10 am

What script do I use to make the player unequip his weapon, without knowing which one it is? I tried player.UnequipItem Weapon, but while the GECK accepted it, it didn't do anything in game...
User avatar
Tammie Flint
 
Posts: 3336
Joined: Mon Aug 14, 2006 12:12 am

Post » Tue May 17, 2011 1:26 am

What script do I use to make the player unequip his weapon, without knowing which one it is? I tried player.UnequipItem Weapon, but while the GECK accepted it, it didn't do anything in game...
You could use http://geck.gamesas.com/index.php/EquipItem with the "NoUnEquip" flag using an invisible weapon and whatever was equipped will be unequipped, remove it later and the NPC should then equip something else. I've gotten this to work with an invisible helmet in an experiment where checking a Form List or scripting the unequipping of individual items was undesireable, so it will probably work for a weapon as well.

You might want to script the invisible weapon with something like the below though so they'll lose it if in combat and equip a real weapon, just in case.

scn InvisibleWeaponSCPTRef rNPCBegin OnAdd	Set rNPC to GetContainerEndBegin GameMode	If rNPC.IsInCombat		RemoveMe	EndIfEnd

User avatar
Cccurly
 
Posts: 3381
Joined: Mon Apr 09, 2007 8:18 pm

Post » Mon May 16, 2011 11:39 pm

You could use http://geck.gamesas.com/index.php/EquipItem with the "NoUnEquip" flag using an invisible weapon and whatever was equipped will be unequipped, remove it later and the NPC should then equip something else. I've gotten this to work with an invisible helmet, so it will probably work for a weapon as well.

So you're saying I should just make a blank weapon and equip it (I want the player to still be able to equip weapons)? That's genius! I'll try it, thanks!
User avatar
lucile davignon
 
Posts: 3375
Joined: Thu Mar 22, 2007 10:40 pm

Post » Tue May 17, 2011 7:29 am

So you're saying I should just make a blank weapon and equip it (I want the player to still be able to equip weapons)? That's genius! I'll try it, thanks!
It works for a helmet, so here's hoping it can work for a weapon too in the event you want to unilaterally unequip whatever's equipped. :) Something like the unreferenced Fists [WEAP:000001F4] might suffice for this or a copy with that IsInCombat/RemoveMe script attached.
User avatar
Samantha hulme
 
Posts: 3373
Joined: Wed Jun 21, 2006 4:22 pm


Return to Fallout 3