Jump to content

Unable to run script on player actor events


Dutchj

Recommended Posts

I'm attempting to run some code whenever the player equips or unequips a weapon, but I can't seem to make any events that the player actor emits actually do anything. For example, I have the following script attached to a reference alias pointing to the player:

Scriptname PlayerEventScript extends ReferenceAlias  

Event OnInit()
	Debug.Notification("Script initiated")
EndEvent

Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
	Debug.Notification("Equipped Something.")
	if akBaseObject as Weapon
		Debug.MessageBox("This actor just equipped a weapon!")
 	endIf
EndEvent

The notification inside the OnInit event shows up as expected when the quest is initialized, but no matter what I do in terms of equipping/unequipping items, I never get any of the notifications or messageboxes I have defined in the OnObjectEquipped event. All of the tutorials and discussions I've found seem to tell me that this is the way it's supposed to work. I've tried other actor events as well, but none of them seem to function. Any ideas as to what could be the problem?

Link to comment
Share on other sites

I've managed to fix the problem. The issue was caused by an incorrect configuration in the quest that I had attached the player alias to. I had another reference alias setup with a specific reference set to NONE, but I hadn't set the optional flag on this alias. This apparently caused the quest script to not run properly.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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