Running an OnLoad block on a disabled item

From the Fallout3 GECK Wiki
Revision as of 00:42, 23 December 2008 by imported>Cipscis (New page: 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 i...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to 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

  • This shouldn't be used on Actors or quest targets, as Actors will still be able to attack the player (although they won't be able to move), and the compass will still show Actors and quest targets with a scale of 0.