Talk:GetEquippedObject

From the Oblivion ConstructionSet Wiki
Revision as of 18:42, 28 March 2010 by imported>Shademe (→‎Multi-slot items: Answered)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

I'll be running a test script to try and figure this out when I have time later today, but I'm wondering if anyone knows if all of these slots can actually have items equipped in them, and what the difference between a few of the slots is.

1	hair - can anything be equipped here?
9	weapon - 4 weapon slots...are these based on the weapon's anim type
10	back weapon - or whether it's currently equipped,
11	side weapon - and can only one be filled at a given moment?
12	quiver - is this different from ammo(17)?
16	weapon
17	ammo

If no one knows then I'll post my results later. Scruggs 09:15, 6 August 2006 (EDT)

Dragoon Wraith TALK 10:55, 6 August 2006 (EDT): Helms can be equipped on the Hair slot, for one. I don't know about the rest.
Okay, thanks. I did some testing, and I'm finding that 9, 10, 11, and 12 don't seem to be used, regardless of whether the equipped weapon is sheathed or readied. I'm hoping it's safe to assume they are never used by actual items. It seems more likely that they are used for whatever sheath or quiver is included with the equipped weapon. Scruggs 18:39, 6 August 2006 (EDT)


14 (Torch) also doesn't work. --JOG 21:52, 23 August 2006 (EDT)

Possible values

I think this will be of interest to someone. When no slots are selected this function returns 255. You can also set 255 for no slots to be selected. I've tested this in game with OBSE v16.

Also the although using weird(9-12 and 14, 255) values normally makes no sense, you can still get the reference to the equipped item on the slot using GetEquipmentSlot. Not sure which order multiple equipped items come at, probably some kind of weird internal order like oblivion inventory walk methods produce.

A snippet from the source file(from the same version)

Full code starts at line 50 in obse/src/GameForms.cpp

UInt32 TESBipedModelForm::GetSlot() const {
	switch (partMask) {
		    ---snip---
		// combinations
		case kSlot_UpperLower: return 18;
		case kSlot_UpperLowerFoot: return 19;
		case kSlot_UpperLowerHandFoot: return 20;
		case kSlot_None: return 255;
		default: return 0;
	}
}

void TESBipedModelForm::SetSlot(UInt32 slot)
{
	switch(slot) {
		    ---snip---
		case 18: partMask = kSlot_UpperLower; break;
		case 19: partMask = kSlot_UpperLowerFoot; break;
		case 20: partMask = kSlot_UpperLowerHandFoot; break;
		case 255: partMask = kSlot_None; break;
		default: break;
	}
}

I've added 255 to the Template: OBSE_SLotIDs template


--Irwiss 11:59, 26 December 2008 (EST)

Multi-slot items

Let's say I have a script like this:

Ref Object
Set Object to Player.GetEquippedObject 2
Player.UnequipItem Object


What would happen if the player was wearing a robe for example? Would the above script unequip the robe or do I have to use Player.GetEquippedObject 18 to get the reference for the robe? JdeRau 14:46, 25 March 2010 (EDT)

If the robe were to occupy slot #2, getEquippedObject will return its objectID, i.e, it will get unequipped.
shadeMe TALK 19:42, 28 March 2010 (EDT)