Jump to content

Getting biped objects through papyrus


BarbasTheDog

Recommended Posts

Through SkSE I can get the Slot Mask, which is the sum of the hex. indexes which the armour occupies, but I wanted to get each slot (biped object) individually.

 

E.g.:

 

INT[ ] BipedObjects = New INT[32]

BipedObjects = HelmetProperty.GetSlots()

 

 

Which could return as an array or anything like that which the index of each individual biped object.

Link to comment
Share on other sites

http://codepad.org/RTIiwAn2

I used this in a project Im working on. It runs through and finds all the armor your wearing and if it finds armor it runs through each of its armoraddons and swaps the firstperson mesh with the 3rd person. you can adapt it to yours needs if you want. The findallarmor function is expensive so I would try to optimize that.

Link to comment
Share on other sites

Thanks! So when the player equips the piece of armour I'll run GetWornForm() on each slot and if it returns the same form for two different slots, then this armour occupies them both!

 

Something Like:

 

Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)

INT Index = SlotList.Length - 1 ;<- Contains the hex. of each slot.
INT ResultIndex
INT[] Result = New INT[32] ;<- Hex. of which slots akBaseObject occupies.

While Index >= 0

If akReference.GetWornForm(SlotList[index]) == akBaseObject

Result[ResultIndex] = SlotList[index]
ResultIndex += 1
EndIf

Index -= 1

EndWhile
EndEvent

 

 

Thank you very much! :D Kudos!

Edited by BarbasTheDog
Link to comment
Share on other sites

  • Recently Browsing   0 members

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