louisthird Posted August 11, 2020 Share Posted August 11, 2020 Hope you're all doing well out there in the Wasteland... Pretty simple question: how to test for a particular type of item given a 'Form' or 'ObjectReference' like a Stimpak? Probably has a pretty simple answer that is eluding me right now. For Stimpak I tried: form.HasKeyword(ObjectTypeStimpak) which didn't work. Seems awkward, but maybe I need to do something like: form.GetFormID() == Stimpak.GetFormID() ? I'll let the experts chime in. -louisthird Link to comment Share on other sites More sharing options...
SKKmods Posted August 11, 2020 Share Posted August 11, 2020 For a specific base object test the condition system offers GetIsID, but in script you have to provide a property for each base object: Potion Property pStimpak Auto Const Mandatory Function IsStimpak(ObjectReference ThisREF) If (ThisREF.GetBaseObject() == pStimpak) ; yes Else ;no EndIf EndFunction Form type logical "IS" tests are built in; Function IsPotion(ObjectReference ThisREF) If (ThisREF.GetBaseObject() is Potion) ; yes Else ;no EndIf EndFunction Link to comment Share on other sites More sharing options...
louisthird Posted August 11, 2020 Author Share Posted August 11, 2020 Thanks SKK. Excellent answer. Impressed with your knowledge of the inner workings of the game. Link to comment Share on other sites More sharing options...
Evangela Posted August 18, 2020 Share Posted August 18, 2020 You could extend that to further test multiple object types. Link to comment Share on other sites More sharing options...
Recommended Posts