Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Calc_subvelocity entity - A Tutorial for Spirit of Half-Life.

This entity lets you determine the facing or the movement of other entities. In the field "Entity to use[LE]" enter the name of the entity you want to observe. "Value to calculate from": - Movement velocity: Find out how fast and in what direction another entity is moving. If a scientist is running east with a speed of 50 units/second this vector will be 50 0 0(or something like that. I allway get confused with the axis). If the scientist ist running uphill with the same speed the vector might be something like 50 10 0. The 10 represents the upward movement. - View angle: Find out what direction the player is looking. Enter *player in the "Entity to use[LE]" field. You might use this to make a laserpoint for the player. Create a env_laser and in the "Fire towards" field enter the name of a calc_subvelocity that checks the players view angle. That laser will now aim in the same direction as the player. You still have to make some adjustments to make it look correct and actually move with the player. After reading all my tutorials about calc and motion entites you should know how. - Angle: The same but for all other entities. Find out what direction a tracktrain, a func_tank or a monster is facing("looking"). - Attachment points: Im not sure what these do with a subvelocity. If you know then write about it in this thread. The value calculated by the calc_subvelocity is allways a vector. You can alter it with the fields "Scale factor[LR] "(multiply) and "Add offset[LV]". In the flags you can tick "Discard X", "Discard Y" and "Discard Z" which will nullify these axis in the vector. "Flip vertical" makes -Z out of Z. The flag "Normalize" makes the vectors lenth equal 1 but wont change its direction. (The gun in this picture is supposed to be a func_tank, but it could be any other entity)