Jump to content

OnEquipped not being called


zogthemighty

Recommended Posts

Scriptname MyScript extends ObjectReference
 
Event OnActivate(ObjectReference akActionRef)
    Debug.Notification("You've activated me")
EndEvent
 
Event OnEquipped(Actor akActor)
    Debug.Notification("You've equipped me")
EndEvent

We're getting the notification when activating but not when equipping. What have we done wrong?

Link to comment
Share on other sites

The Script seams to be correct, you could try debug.messagebox() to make sure you don't just missed the Notification, and the Object it's attached to should off cause be equipable.

But I guess your real Script is a bit more complex than this.

If it's not a ObjectReference Script but e.g. a ReferenceAlias on you should write "import ObjectReference" to receive ObjectReference Event

If you don't need any Variables you should make the Script Const to block Papyrus for storing data about it in the Save.

Edited by ubuntufreakdragon
Link to comment
Share on other sites

The Script seams to be correct, you could try debug.messagebox() to make sure you don't just missed the Notification, and the Object it's attached to should off cause be equipable.

But I guess your real Script is a bit more complex than this.

If it's not a ObjectReference Script but e.g. a ReferenceAlias on you should write "import ObjectReference" to receive ObjectReference Event

If you don't need any Variables you should make the Script Const to block Papyrus for storing data about it in the Save.

That's the full script, all I changed when posting it (typing it all by hand, since Paste isn't working on this forum) was the script name. It's kinda a my-first-script thing. The end goal is to do a lot more in the OnEquipped event, the message was just a test. Dunno why it doesn't work.

 

Do we maybe need to import Actor?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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