Jojash Posted January 21, 2018 Share Posted January 21, 2018 (edited) Would anyone be able to explain to me how InstanceData, Owners and DamageTypeInfo works? My best understanding currently is that I want to fill an owner with an instance of a weapon (for the purposes of use with GetDamageTypes). The best way to do this (I think) is to use GetInstanceOwner(35) with whatever actor I'm using (or possibly to use GetWornItem?) - I'm trying to use this within an onHit block, so I've been using "akAggressor" as my actor. Theoretically, I'll fill the Owner with whatever is in the aggressor's right hand. Now I'm pretty sure it doesn't work that way since when trying to do that I cannot compile. Anyway, here are my problem lines, InstanceData:Owner thisInstance = new InstanceData:Owner thisInstance.Owner = (akAggressor as actor).GetInstanceOwner(35) DamageTypeInfo[] DamageTypes = GetDamageTypes(thisInstance) fDamage = DamageTypes[0].damage as float Thanks in advance! :smile: Edited January 21, 2018 by Jojash Link to comment Share on other sites More sharing options...
Evangela Posted January 21, 2018 Share Posted January 21, 2018 (edited) Try reading this: https://www.creationkit.com/fallout4/index.php?title=Structs_(Papyrus) Because it seems you need to know how to use structs. It borrows stuff from C++ structs.. which aren't difficult to understand, but that's C++. Papyrus structs.. don't know what's going on there. Edited January 21, 2018 by Rasikko Link to comment Share on other sites More sharing options...
Jojash Posted January 21, 2018 Author Share Posted January 21, 2018 Thank you very much for that article, it was extremely helpful! I've managed to fill up the owner struct correctly now (I think my inital hypothesis was actually returning a glove, rather than a weapon, switched to using aksource as the owner instead of the actor). Additionally I'm using GetAttackDamage, rather than GetDamageTypes, since the types aren't relevant for my purpose and everything seems to be working now! :) Link to comment Share on other sites More sharing options...
Recommended Posts