Jump to content

Actor object error "GetNumItems is not a function or does not exist"


Recommended Posts

Posted

Trying to create an activemagiceffect that will work with the total amount of gold value held by the target, but it doesn't appear to see, or will not caste, the Actor into a ObjectReference.

https://ck.uesp.net/wiki/ObjectReference_Script "(Container only) Returns the number of forms in the container. (Actor ObjectReferences are containers)"

Quote
Scriptname XX_temp extends activemagiceffect  
 
Event OnEffectStart(Actor akTarget, Actor akCaster)
    Int iFormIndex = akTarget.GetNumItems()
    Int total = 0
    While iFormIndex > 0
        iFormIndex -= 1
        Form kForm = akTarget.GetNthForm(iFormIndex)
        total += kForm.GetGoldValue() * akTarget.GetItemCount(kForm)
    EndWhile
     Debug.MessageBox(total)
endEvent
 
XX_temp.psc(4,27😞 GetNumItems is not a function or does not exist
XX_temp.psc(4,5😞 type mismatch while assigning to a int (cast missing or types unrelated)
XX_temp.psc(8,24😞 GetNthForm is not a function or does not exist

 

  • Community Manager
Posted

Both of those function calls require SKSE. Make sure you have the PSC files from SKSE extracted. 

  • Recently Browsing   0 members

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