Difference between revisions of "Talk:OnUpdate - Form"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Cipscis
imported>HawkFest
 
Line 2: Line 2:
I have attached a script to a weapon that says somthing like this,
I have attached a script to a weapon that says somthing like this,


 
<source lang="papyrus">
Event OnEquipped()
Event OnEquipped()
 
RegisterForUpdate(5)
RegisterForUpdate(5)
Debug.Notification("Registered")
 
Debug.Notification("Registered")
 
EndEvent
EndEvent


Event OnUpdate()
Event OnUpdate()
 
Debug.Notification("Updating")
Debug.Notification("Updating")
 
EndEvent
EndEvent
 
</source>


When I Equip the Weapon I get the "Registered" message but i never get the "Updating" message.
When I Equip the Weapon I get the "Registered" message but i never get the "Updating" message.

Latest revision as of 01:38, 21 November 2012

OnUpdate event not running on weapon[edit source]

I have attached a script to a weapon that says somthing like this,

Event OnEquipped()
	RegisterForUpdate(5)
	Debug.Notification("Registered")
EndEvent

Event OnUpdate()
	Debug.Notification("Updating")
EndEvent

When I Equip the Weapon I get the "Registered" message but i never get the "Updating" message.

Anyone have any idea why?

Oss133

I've heard reports of this behaviour before. If I remember correctly, it can be fixed by dropping the weapon then picking it back up again. The issue is likely due to the fact that inventory objects are not treated in the same way as "real" references.
It would be nice to get this confirmed so the information could be added to this page.
P.S. Please wrap any code you post in <source> tags like this:<source lang="papyrus">Here is my code</source>
That will maintain formatting such as indentation, as well as using a fixed-width font and adding appropriate syntax highlighting.
-- Cipscis 15:40, 6 March 2012 (EST)