Open main menu

UESPWiki β

Activate

                Activate, [player]

        Where:  player = Optional player ID which forces the object to be activated by the
                         player no matter where the object/player is. Undocumented.

        Type:   Object

     Returns:   none

     Example:   If ( OnActivate == 1 )
                        Activate
                endif

     Scripts:   Dagoth_doors
                Bittercup

This function tells the object to do its default activation.

           Object Type          Activation
                NPC               Dialogue      Works
                Container         Opens         Works
                Door              Opens         Doesn't Work?
                Book/Scroll       Reads         Works
                Weapon            Picks Up      Works
                Armor             Picks Up      Works
                Misc, etc...      Picks Up      Works

There is an undocumented feature in the Activate function by specifying the player after the function, for example:

begin RemoteContainer
   short OnPCEquip

   if ( OnPCEquip == 1 )
      set OnPCEquip to 0
      "dh_remote_chest_01"->Activate, player
   endif

end

If the container is persistent (references persist) this script should open the container wherever the player is. This is a great way to create 'carryable' containers by attaching a script similar to the above to a ring or similar item.

Note: This only works if the container is flagged as persistent AND the container is currently loaded in memory (i.e., you've activated it or somehow forced it to load within the last 72 game hours).