Difference between revisions of "OnActivate"
Jump to navigation
Jump to search
→Notes: Fixed a grammatical error, and added a precautionary note about recursive Activate calls.
imported>Bruneauinfo m |
imported>Syscrusher (→Notes: Fixed a grammatical error, and added a precautionary note about recursive Activate calls.) |
||
Line 5: | Line 5: | ||
==Notes== | ==Notes== | ||
*Using OnActivate will prevent normal activation of the object. To use the object's default activation you must call [[Activate]] on it. | *Using OnActivate will prevent normal activation of the object. To use the object's default activation you must call [[Activate]] on it. If the second argument to this [[Activate]] call (whether or not to run the OnActivate block) is true, you will call this same block recursively, which can cause a game hang or crash to desktop. | ||
*Animations on activators are carried out using [[PlayGroup]]. This is helpful if your activator has an animation associated with it. | *Animations on activators are carried out using [[PlayGroup]]. This is helpful if your activator has an animation associated with it. | ||
Line 16: | Line 16: | ||
*Clicking on items in inventory causes the [[onEquip]] block to run, not the '''onActivate''' block. | *Clicking on items in inventory causes the [[onEquip]] block to run, not the '''onActivate''' block. | ||
**However, you can make an item run | **However, you can make an item run its own onActivate block in the inventory menu (MenuMode 1008, MenuMode, onEquip, etc.) with '''''Activate player, 1'''''. | ||
*If you create an object and activate it in the same frame, its OnActivate block may not run. See [[PlaceAtMe#Usage_in_same_frame_as_creation|PlaceAtMe]] more info. | *If you create an object and activate it in the same frame, its OnActivate block may not run. See [[PlaceAtMe#Usage_in_same_frame_as_creation|PlaceAtMe]] more info. |