Jump to content

compile error: EquipItem is not a function, apparently


Syntia13

Recommended Posts

Hello All.

I've been on hiatus from Skyrim for some time, so I'm a bit rusty and might be missing something obvious.

I'm still on Skyrim LE, using notepad++ for scripting, except it won't compile.


Here's my script:


ObjectReference Property climbingring Auto

Event OnTriggerEnter(ObjectReference akTriggerRef)
akTriggerRef.AddItem(climbingring, 1, true)
akTriggerRef.EquipItem(climbingring, false, true)
Endevent
Event OnTriggerleave(ObjectReference akTriggerRef)
akTriggerRef.removeitem(climbingring, 1, 1)
Endevent




If I remove the line

akTriggerRef.EquipItem(climbingring, false, true)

it compiles, if I add it back, it won't. The message is that 'equipitem' is not a function or doesn't exist.

I do have vanilla scripts/source unpacked in Data folder, and I unpacked it again just to be sure.

 

What else could be the problem?

Thanks.



Edited by Syntia13
Link to comment
Share on other sites

 

EquipItem is on the Actor script rather than the ObjectReference script. Thus even if akTriggerRef is utlimately an actor, Papyrus cannot compile without casting into Actor. Try the following:

(akTriggerRef as Actor).EquipItem(climbingring, false, true)

YES! Success, thank you very much, have a lovely day (or night, whichever applicable in your part of the world). :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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