Editing OnActivate

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
'''Syntax:'''
Link to TES4 Construction Set Wiki: [http://cs.elderscrolls.com/constwiki/index.php/OnActivate OnActivate].
  begin OnActivate  


This block will be run once when the scripted reference is activated.
[[Category:Blocktypes]]
 
==Notes==
*Using OnActivate will prevent normal activation of the object. To use the object's default activation you must call [[Activate]] on it.
 
*Animations on activators are carried out using [[PlayGroup]]. This is helpful if your activator has an animation associated with it.
 
*If you want to do something specific depending on what activated the object, use [[IsActionRef]] or [[GetActionRef]] inside the OnActivate block. They won't return the correct ActionRef in any other block.
 
*The activator type of object has NO default activation.
 
*Locked doors, containers and books are activated a second time automatically when you open the lock or take the book. To find out when a door was unlocked, for example, you can wait for '''[[GetLocked]] == 0''' in 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 it's 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.
 
*''OnActivate player'' will compile but act as ''OnActivate'' - meaning when an NPC activates the object its normal activation will be prevented. A common mistake.
 
*If the player activates any object while sitting, then any failure to call Activate in the OnActivate block of that object will force the player to stand up. There is currently no way to allow the player to remain seated while activating an object that overrides the default activation.
 
==See Also==
*[[Begin]]
*[[IsActionRef]]
*[[GetActionRef]]
*[[PlayGroup]]
 
[[Category: Blocktypes]]

Please note that all contributions to the Fallout3 GECK Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see GECK:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)