Difference between revisions of "OnAdd"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>SnakeChomp
(→‎Notes: items added when actors are first created won't execute onadd blocks)
imported>Illyism
(changed lay-out)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Link to TES4 Construction Set Wiki: [http://cs.elderscrolls.com/constwiki/index.php/OnAdd OnAdd].
__NOTOC__
 
This block will be run once when the scripted object is added to the Container's inventory. If no parameter is used, the block will be run whenever the object is added to anything's inventory.
 
'''Syntax:'''
 
begin OnAdd ContainerRefID
 
'''Example''':
 
begin OnAdd  
begin OnAdd player


==Notes==
==Notes==
*When the target container isn't in the current cell (or within the 5x5 exterior-cell square), the OnAdd block doesn't run until you enter the cell with the container. However, the onAdd block won't run if you've saved and reloaded before entering the remote cell.
*The item must remain in the new container for at least one frame after it is added in order for the block to trigger.
*This block won't run when Death Items, including items added via "Add Leveled List On Death" Entry point perks, are first placed in the dead Actor's inventory.
*This block won't run when Death Items, including items added via "Add Leveled List On Death" Entry point perks, are first placed in the dead Actor's inventory.
*This block won't run when items are initially placed into an actor's inventory when they are first spawned into their cell or when they are resurrected either, only when an item is added to an existing actor.
*This block won't initially run on items that are listed in the actor's inventory tab in the GECK, even when a new instance of an actor is placed in the world.  OnAdd blocks trigger on ''changes'' to an actor's inventory, but not when objects are created along with the container they are placed in (and so the same applies for Container objects placed in the world).
 
===See Also===
* [[OnDrop]]


[[Category: Blocktypes]]
[[Category: Blocktypes]]

Latest revision as of 12:33, 20 January 2009


This block will be run once when the scripted object is added to the Container's inventory. If no parameter is used, the block will be run whenever the object is added to anything's inventory.

Syntax:

begin OnAdd ContainerRefID

Example:

begin OnAdd 
begin OnAdd player 

Notes[edit | edit source]

  • When the target container isn't in the current cell (or within the 5x5 exterior-cell square), the OnAdd block doesn't run until you enter the cell with the container. However, the onAdd block won't run if you've saved and reloaded before entering the remote cell.
  • The item must remain in the new container for at least one frame after it is added in order for the block to trigger.
  • This block won't run when Death Items, including items added via "Add Leveled List On Death" Entry point perks, are first placed in the dead Actor's inventory.
  • This block won't initially run on items that are listed in the actor's inventory tab in the GECK, even when a new instance of an actor is placed in the world. OnAdd blocks trigger on changes to an actor's inventory, but not when objects are created along with the container they are placed in (and so the same applies for Container objects placed in the world).

See Also[edit | edit source]