Friday, December 20, 2013

How to disable gravity in Source Engine

For this snippet, we will be modifying the CPhysicsHook class. Open up server/physics.cpp and edit the LevelInitPreEntity function. Find the physenv->SetGravity( Vector( 0, 0, -GetCurrentGravity() ) ); line. Change the setting GetCurrentGravity to zero.

Then you need to create any map and put it prop_physics objects. The objects will be able to rest or will move infinitely in the direction in which they push.

Also, read an article about the gravity on https://developer.valvesoftware.com/wiki/Gravity.

Thursday, December 19, 2013

Another way to trace line

In addition to the method of official documentation, there is a method taken from the code Source SDK 2013. The code is intended for the console command "surfaceprop".

Code displays all the information about the surface (entities), model, texture, as well as the distance to the point of impact trace.

Sunday, December 8, 2013

Disorientation player when bullets hit

For greater realism disorientation occurs player (similar to how it happens when fired from a "weapon 357"), when it misses an enemy bullet. If the health of at least 10 points, disorientation increases.