calc_position

A calc_position works out a position from another entity, such as where that entity is, where its eyes are or the
middle of its body, adds an offset if you give one, and hands the result to the entity that asks for it.
Triggering it does nothing. Instead, you put its name in a key that takes a position, marked [LP] in the editor,
such as the Position of an env_explosion, and each time that key needs a position, the
calc_position works it out again at that moment. See the Locus guide for more details and
some setups.
Attributes
targetnameSets the name you put in another entity's position key so it reads this one. See Common keys.
netnameNames the entity to take the position from. With *locus or !activator, it uses the entity that started the chain of triggers, such as the player who pressed a button.
If you leave this key empty, it works like *locus.
*locusimpulsePicks which point of that entity the position is.The 12 choices
calc_position or read the position a locus_variable stored
Origin (0)messageAdds a vector to the point, such as 0 0 50 to go 50 units up. It takes a locus vector, so it can also name a calc_ entity.
Notes
- If the entity named in Entity to use doesn't exist, the
calc_positiongives no position, so the entity that asked does nothing that time, and withdeveloper 1set in the console, the console names thecalc_position - Attachment points only exist on studio models, the
.mdlfiles, that have them, and asking for one that the model doesn't have gives no position - Maps made with Spirit of Half-Life 1.8 may call this entity
calc_posfroment, and SBO accepts that name too
See also
- Locus guide - how entities pass positions and values to each other
- calc_ entities guide - setups that chain
calc_entities - Locus system - every locus rule, and the keys that take a position
calc_subvelocity- an entity's velocity or the direction it facescalc_velocity_path- the vector from one position to anotherlocus_variable- records a position so you can use it later
Changes since 1.38
calc_positionis new in SBO 2.0.0

