calc_subvelocity

A calc_subvelocity takes a vector from another entity, such as how fast it moves or the direction it faces, and
hands it to the entity that asks for it. It can change the vector's length and add an offset first.
Triggering it does nothing. Instead, you put its name in a key that takes a vector, marked [LV] in the editor, and
each time that key needs a vector, the calc_subvelocity 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 vector key so it reads this one. See Common keys.
netnameNames the entity to take the vector 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 vector of the entity it takes.
- Movement velocity (0) - How fast and in which direction the entity moves, in units per second
- Angles (1) - The direction the entity faces, as a vector 1 unit long
- View angles (2) - The direction a player looks, as a vector 1 unit long
- Calc Velocity of the entity (10) - Asks the named entity for its own vector, so you can chain this to another
calc_entity or read the vector alocus_variablestored. That entity works out its vector for itself, so*locusin its keys means that entity and not the activator
Movement velocity (0)noiseMultiplies the vector by a locus number. In this key, *locus and !activator stand for the Entity to use, not for the entity that started the chain.
If you leave this key empty, the factor is 1.
messageAdds a locus vector after the scaling. In this key too, *locus and !activator stand for the Entity to use.
Flags
1Normalize before scalingThe vector is made 1 unit long before Scale factor multiplies it, so the factor sets its exact length
2Flip verticalThe Z part of the result is turned around, so up becomes down
4Discard XThe X part of the result is 0
8Discard YThe Y part of the result is 0
16Discard ZThe Z part of the result is 0
Notes
- The flags work on the result after the offset is added
- If the entity named in Entity to use doesn't exist, the
calc_subvelocitygives no vector, so the entity that asked does nothing that time, and withdeveloper 1set in the console, the console reports it - Maps made with Spirit of Half-Life 1.8 may call this entity
calc_vecfroment, and SBO accepts that name too
See also
- Locus guide - how entities pass positions and numbers to each other
- calc_ entities guide - setups that chain
calc_entities calc_position- a position on an entitycalc_velocity_path- the vector from one position to anothercalc_velocity_polar- turns a vector and changes its length- Locus system - every locus rule, and the keys that take a vector
Changes since 1.38
calc_subvelocityis new in SBO 2.0.0

