Running an OnLoad block on a disabled item

From GECK
Jump to: navigation, search

OnLoad blocks won't run on Disabled items, but they can be useful for tasks like initialising variables. If you want to disable an item, but still run an OnLoad block on it, you can use the following code:

RefID.MoveTo player
RefID.SetScale 0

This will cause the item to disappear, as if it had been disabled, but its OnLoad block will still run.

Notes

  • If you intend to use this on an Actor or Quest Objective, make sure to disable them in their OnLoad block. This will prevent them from showing up on the player's compass, as well as prevent Actors from interacting with the player in any way.

See Also