Teleporting entities: Difference between revisions
m minor format |
update |
||
Line 1: | Line 1: | ||
Often | Often you want to teleport one or more entities to a specific place and orientation. In Doom3, this is very easy, you need just to set the origin and angles of the object inside a script and it will appear where it should. | ||
However, to make this even easier and possible without writing scripts, a new '''atdm:teleport''' entity has been added. | |||
== | == Basic example == | ||
* Create the atdm:teleport entity '''{{RMB}} -> Create Entity -> darkmod -> | * Create the atdm:teleport entity '''{{RMB}} -> Create Entity -> darkmod -> Targets -> atdm:teleport''' | ||
* Move it to the position and orient it the way that the teleported entity/entities should appear | * Move it to the position and orient it the way that the teleported entity/entities should appear | ||
* Link the atdm:teleport to any entities you want to be teleported ( | * Link the atdm:teleport to any entities you want to be teleported (Select it, select another entity, then press {{key|CTRL}} + {{key|K}}) | ||
* Create a trigger and link it to the atdm:teleport. Once the trigger activates atdm:teleport, the teleport will happen. | * Create a trigger and link it to the atdm:teleport. Once the trigger activates atdm:teleport, the teleport will happen. | ||
Note: Triggers have a lot of useful spawnargs that can insert delays, make it trigger only once etc. | Note: Triggers have a lot of useful spawnargs that can insert delays, make it trigger only once etc. | ||
=== Screenshot === | |||
-- | [[Image:Trigger teleport.jpg]] | ||
== Teleporting multiple entities == | |||
To teleport more than one entity, you can target them all from the same teleport entity. The targets will be teleported in the order of the target spawnargs, e.g. "target0" first, "target1" second and so on. | |||
However, this would also mean that all targets get teleported to the same location and are thus stuck inside each other. | |||
To fix this, you can use the following spawnargs on each to be teleported entity: | |||
# '''teleport_offset''': Specifies an offset relative to the atdm:teleport entity | |||
# '''teleport_random_offset''': Specifies the magnitude of an random offset that will be added to the final location | |||
=== Example: === | |||
"teleport_offset" "-32 0 0" // 32 units to the left | |||
"teleport_random_offset" "5 5 0" // -2.5 .. 2.5 units in X and Y direction from that | |||
== Delays == | |||
The '''atdm:teleport''' entity has two spawnargs that influence the time that the teleport happens: | |||
# '''delay''' - the initial delay in seconds before the first teleport happens | |||
# '''wait''' - the delay between each subsequent teleport | |||
=== Example: === | |||
"delay" "1" | |||
"wait" "0.5" | |||
would wait 1 second before the first teleport, and then teleport the second entity 0.5 seconds later (after 1.5 seconds from triggering), the third 0.5 seconds later (so after 2 seconds after triggering) and so on. | |||
{{editing}} | {{editing}} |
Revision as of 11:03, 23 July 2009
Often you want to teleport one or more entities to a specific place and orientation. In Doom3, this is very easy, you need just to set the origin and angles of the object inside a script and it will appear where it should.
However, to make this even easier and possible without writing scripts, a new atdm:teleport entity has been added.
Basic example
- Create the atdm:teleport entity -> Create Entity -> darkmod -> Targets -> atdm:teleport
- Move it to the position and orient it the way that the teleported entity/entities should appear
- Link the atdm:teleport to any entities you want to be teleported (Select it, select another entity, then press CTRL + K)
- Create a trigger and link it to the atdm:teleport. Once the trigger activates atdm:teleport, the teleport will happen.
Note: Triggers have a lot of useful spawnargs that can insert delays, make it trigger only once etc.
Screenshot
Teleporting multiple entities
To teleport more than one entity, you can target them all from the same teleport entity. The targets will be teleported in the order of the target spawnargs, e.g. "target0" first, "target1" second and so on.
However, this would also mean that all targets get teleported to the same location and are thus stuck inside each other.
To fix this, you can use the following spawnargs on each to be teleported entity:
- teleport_offset: Specifies an offset relative to the atdm:teleport entity
- teleport_random_offset: Specifies the magnitude of an random offset that will be added to the final location
Example:
"teleport_offset" "-32 0 0" // 32 units to the left "teleport_random_offset" "5 5 0" // -2.5 .. 2.5 units in X and Y direction from that
Delays
The atdm:teleport entity has two spawnargs that influence the time that the teleport happens:
- delay - the initial delay in seconds before the first teleport happens
- wait - the delay between each subsequent teleport
Example:
"delay" "1" "wait" "0.5"
would wait 1 second before the first teleport, and then teleport the second entity 0.5 seconds later (after 1.5 seconds from triggering), the third 0.5 seconds later (so after 2 seconds after triggering) and so on.