Jump to content

OnEquip/OnUnEquip Armor Script to ADD/Remove AnimFlavor


Recommended Posts

Well, me and papyrus have never had much of a love affair but back when I knew how to script Bethesda games I used OnEquip & OnUnEquip blocks to make magic happen with rings and things. What I want to do is attach a script to a playable armor piece that a Workshop NPC who already has the "holding a baby" animflavor AND is wearing the baby as an armor piece, which whenever "unequipped" by the player, will change their current AnimFlavor to another. THEN, if the player re-Equips the same Armor piece on the NPC it will give them back the "holding a baby" AnimFlavor that was removed. Sounds simple right?

 

Anyone in the mood to give me a clue?

 

https://www.mediafire.com/view/oa4saaulicg03km/Fallout4_Paradies_68.jpg.f9bbbc0753ffab293c7abee06354af5c.jpg/file

 

 

 

 

 

 

Link to comment
Share on other sites

Here ya go (from an active SKK solution). Give it a proper name, compile and attach to your base armor form:

Scriptname myObjectScript extends ObjectReference Const

Keyword Property pAnimFlavorHoldingBaby Auto Const Mandatory

Event OnEquipped(Actor akActor) 
	ObjectReference myWearer = Self.GetContainer()
	(myWearer as Actor).ChangeAnimFlavor(pAnimFlavorHoldingBaby)
	Debug.Trace("myObjectScript.OnEquipped " + myWearer)
EndEvent

Event OnUnequipped(Actor akActor)
	ObjectReference myWearer = Self.GetContainer()
	(myWearer as Actor).ChangeAnimFlavor()
	Debug.Trace("myObjectScript.OnUnequipped " + myWearer)
EndEvent
Link to comment
Share on other sites

 

Here ya go (from an active SKK solution). Give it a proper name, compile and attach to your base armor form:

Scriptname myObjectScript extends ObjectReference Const

Keyword Property pAnimFlavorHoldingBaby Auto Const Mandatory

Event OnEquipped(Actor akActor) 
	ObjectReference myWearer = Self.GetContainer()
	(myWearer as Actor).ChangeAnimFlavor(pAnimFlavorHoldingBaby)
	Debug.Trace("myObjectScript.OnEquipped " + myWearer)
EndEvent

Event OnUnequipped(Actor akActor)
	ObjectReference myWearer = Self.GetContainer()
	(myWearer as Actor).ChangeAnimFlavor()
	Debug.Trace("myObjectScript.OnUnequipped " + myWearer)
EndEvent

Awesomesauce! Thank you SO much! I think I actually understood what you did there. LOL! I'll be sure to credit you whenever I use it!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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