Atdm:target postscriptevent

From The DarkMod Wiki
Jump to navigationJump to search


The entity atdm::target_postscriptevent is a useful entity to call one script function (aka "post the script event to the entity") on multiple entities.

The entity is used for instance by atdm:teleport to teleport one or more entities.


The following spawnargs can be used on this entity:


The event spawnarg gives the name of the script event. Examples of events with pass_self false ("0"):

  • "Off", "On" (for lights)
  • "remove" (deletes that entity)
  • "activate" (activate that entity)
  • "activateTargets"

Examples of events with pass_self true ("1"):

  • "teleportTo"

and so on. A full list of available events can be found in the files script/doom_events.script and script/tdm_events.script.

delay (float, default: 0)

The delay spawnarg specifies an initial delay in seconds, before the first event will be fired.

wait (float, default: 0)

The wait spawnarg specifies the delay in seconds between each subsequent event (e.g. between one and the next target).

pass_self (bool, default: false)

For certain events that require as parameter an entity, you can set pass_self to true. The event will then get the trigger entity passed along as first parameter. Useful and mandatory for instance for teleportTo.

propagate_to_team (bool, default: false)

If propagate_to_team is set to true ("1"), then the event will also be posted to any bound children of the targeted entities. This is important if you target combined light entities, like a candle holder. Instead of sending Off() to the holder, you want it to arrive at the flame, but cannot target the flame in your map because it does not exist yet.

Events that are not suited for one type of entity (like Off() for non-lights) will be safely filtered out, so you can target them without worry at the base entity.

Note: Turning of lights on combined entities does not yet work, I am working on it.


How to delete entities


On the right is a screenshot with a trigger, that when triggered, will use the shown atdm:target_postscriptevent entity to delete the linked torch after 1 second delay:

See also