Game.getplayer().UnequipWeapon() ?

Post » Tue Jun 19, 2012 12:35 am

I'm trying to add a line into a script that will force the PC to unequip any weapon they're holding, but keep all of their equiped armor on. I can't find or figure out the function to use and I've been referencing this:http://www.creationkit.com/Actor_Script

Game.GetPlayer().UnequipAll()

Obviously that unequips everything, whereas

Game.GetPlayer().UnequipItem(**misc item here***)

Will unequip a specific item. Is there anyway to only unquip any and all weapons?
User avatar
Epul Kedah
 
Posts: 3545
Joined: Tue Oct 09, 2007 3:35 am

Post » Mon Jun 18, 2012 7:19 pm

http://www.creationkit.com/GetEquippedWeapon_-_Actor

You may be able to pass the returned "WEAPON" to the following function:

http://www.creationkit.com/UnequipItem_-_Actor

Dunno if you have to cast it as "FORM" type first though...
User avatar
Jesus Sanchez
 
Posts: 3455
Joined: Sun Oct 21, 2007 11:15 am

Post » Mon Jun 18, 2012 10:32 pm

Game.GetPlayer().GetEquippedWeapon()
Gets the weapon Equipped in the righthand

Game.GetPlayer().GetEquippedWeapon(true)
Gets the weapon in the lefthand

Game.GetPlayer().GetEquippedSpell(0)
Gets the Spell in the lefthand

Game.GetPlayer().GetEquippedSpell(1)
Gets the Spell in the righthand

property.GetFormID()
Gets the formID of the specified property

Combine them all to get what's equipped in the hands, then use with UnequipItem()
User avatar
DAVId MArtInez
 
Posts: 3410
Joined: Fri Aug 10, 2007 1:16 am

Post » Tue Jun 19, 2012 1:14 am

Another approach you could try would be to equip a dummy weapon, which will displace the player's current weapon, then unequip your dummy weapon.

Cipscis
User avatar
Dominic Vaughan
 
Posts: 3531
Joined: Mon May 14, 2007 1:47 pm

Post » Mon Jun 18, 2012 12:36 pm

property.GetFormID()
Gets the formID of the specified property
A good list in general, but I can't think of any reason why GetFormID would be necessary here.
User avatar
Genevieve
 
Posts: 3424
Joined: Sun Aug 13, 2006 4:22 pm

Post » Mon Jun 18, 2012 9:17 am

A good list in general, but I can't think of any reason why GetFormID would be necessary here.

Ah, yeah. Kept thinking of EquipItem, which in that regard I'm still not sure if a formID is explictly required since I assume it's possible to pass it an item property that is fetched with a Get function?
User avatar
JD bernal
 
Posts: 3450
Joined: Sun Sep 02, 2007 8:10 am

Post » Mon Jun 18, 2012 8:27 pm

Ah, yeah. Kept thinking of EquipItem, which in that regard I'm still not sure if a formID is explictly required since I assume it's possible to pass it an item property that is fetched with a Get function?
You could use a property or a variable as an intermediate or, if you're confident it won't return None, you could put the call to the Get function within the parameter list of the call to EquipItem or whatever other function you're using.

Cipscis
User avatar
sw1ss
 
Posts: 3461
Joined: Wed Nov 28, 2007 8:02 pm


Return to V - Skyrim