Jump to content

Do shields exist in FO4?


PJMail

Recommended Posts

Specifically the slot 59 (shield) and the papyrus function "GetEquippedShield()". I have created and equipped an item in that slot, but getequippedshield() returns nothing. Shields in Skyrim are slot 39 (used for something else in FO4).
Are shields un-implemented in FO4?

Link to comment
Share on other sites

Not that I'm aware of. (<- which doesn't mean much :P )

That goes for the electronic sci-fi kind as well.

Note that FO4 is just Skyrim with new objects, textures & quests. (& a handfull changes to make 'm somewhat incompatible (like .nif's being slightly different))

Under the hood, there's magic & spells ... (for your 'potions' ;) )

 

You can't create metal stairs (collision) but there is an option to create on of ice.

 

So on, so forth.

Link to comment
Share on other sites

Do you mean a modern assault shield? The shield itself, like nif for the clothing slot, is easy to implement. You can also make the appropriate havok animation for it. But I don't know how to insert this animation into the game. To make the animation run along with the clothing element. The difficulty is that the character must use a weapon and a shield at the same time. Those, it turns out, are animations for some kind of weapon that is used exclusively with a shield.
Link to comment
Share on other sites

You can try making a shield armor (with keeping the "armor slot precedence" in mind), then call this function on the actor that wears it. I used this script before for debugging purposes but I don't remember if Actor.GetEquippedShield() was working. SlotIndex for Biped Slot 59 is 29. It requires F4SE.

Function LoopSlotsFor(Actor theActor)
	If !theActor
		Return None
	EndIf
	Int SlotIndex
	While 43 >= SlotIndex
		Actor:WornItem wornItem = theActor.GetWornItem(SlotIndex)
		Debug.OpenUserLog("MyLog")
		Debug.TraceUser("MyLog", "---------------------------------------------------------------")
		Debug.TraceUser("MyLog", "SlotIndex: " + SlotIndex)
		Debug.TraceUser("MyLog", "Item: " + wornItem.Item)
		Debug.TraceUser("MyLog", "Model: " + wornItem.Model)
		Debug.TraceUser("MyLog", "ModelName: " + wornItem.ModelName)
		Debug.TraceUser("MyLog", "MaterialSwap: " + wornItem.MaterialSwap)
		Debug.TraceUser("MyLog", "Texture: " + wornItem.Texture)
		Debug.TraceUser("MyLog", "---------------------------------------------------------------")
		SlotIndex = SlotIndex + 1
	EndWhile
EndFunction
Edited by LarannKiar
Link to comment
Share on other sites

I was trying to avoid requiring F4SE (I know and have used GetWornItem). GetEquippedShield seemed the perfect function but just doesn't work for me.

 

I don't want to go through the 'unequipitemslot' + 'event onitemunequipped' mess if I could help it.

Link to comment
Share on other sites

Okay I found the note I made for these "equippable items"... Well, GetEquippedShield() was working.

 

To make a valid Shield armor that can be returned by GetEquippedShield(),

 

- create an Armor:

- Equip Type: Shield

- Biped Object: Shield (and only this)

- the Armor Addon of the Armor:

- Biped Object: Shield (and only this)

 

I have never used GetEquippedShield() in any of my mods though (I rather chose F4SE) because there's no armor in Fallout 4 that this function can actually return.

 

More info:

 

- GetEquippedItemType() works too:

 

- Actor.GetEquippedItemType(1) == 25 (Shield) if Actor worns a valid Shield armor.

 

- Actor.GetWornItem(29) can really return the Shield armor. (SlotIndex 29 is for Biped Slot 59).

Edited by LarannKiar
Link to comment
Share on other sites

Thanks LarannKiar - I had everything but the equip Type set, I will give that a try and see if getequippedshield now works. It would be simpler than what I have...

 

I had moved to a workaround already as I found UnequipItemSlot(29) did not work (why?!), so just relied on the initial OnItemEquipped event to tell me the Armor to look for.

Then just used equipitem/unequipitem with isEquipped and getitemcount tests.

 

These work (as I am avoiding GetWornItem).

 

And the reason I am doing all this?

 

If you do Actor.RemoveAllItems(destination) their equipped armor is removed but some of the buffs from the imbedded object mods stay!

So I need to unequip this Armor first...

Link to comment
Share on other sites

I had moved to a workaround already as I found UnequipItemSlot(29) did not work (why?!)

 

Maybe due to the "armor slot precedence". When you equip an armor, that armor ("inventory item") usually lives in multiple Biped Slots and Biped Slot Indexes (Biped Slot Index = Biped Slot - 30 as the first Biped Slot ("Hair top") is 30. Biped Slot Index starts at 0). If an armor occipes more Biped Slots, the "relevant one" is the one with the lowest Biped Slot Index.

 

Many armors (I guess Shields too) occupies Biped Slot Index 3 because Biped Slot 33 is the "BODY" slot. (Dressed up actors always have an armor in Biped Slot 33). So try Actor.UnequipItemSlot(3) (because UnequipItemSlot() actually accepts Biped Slot Index not Biped Slot despite its argument is named "aiSlot"). The Body Slot Index of a Shield armor is 29 so 3 is the "relevant one", in case the Shield armor occupies Biped Slot Index 3 too.

 

The debugger script I posted above may help with finding the right slot. Problem is that without F4SE, UnequipItemSlot() is a bit like DropFirstObject(), which item gets unequipped or dropped is unknown in most cases.

Edited by LarannKiar
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...