Welcome to the GoldsrcPhysics source code repository!
GoldsrcPhysics is a physics engine written in csharp for goldsrc which implemented ragdoll. The engine provides a set of APIs for mod developers to make ragdoll effect in their games.
- React with entity brush dynamically.
- Auto generate ragdoll's key bone.
- Collider editor.
NOTE: The project is still under development, but spare time is short.
For developers who want to use this library on their game.
- You have gold source game mod dev experience.
- Since it based on .NET Framework, you must install .NET 4.6 first.
- type .NET Framework in search engine and download on official site.
- or run on first time, it will ask you if you would like to install .NET (may not work).
- Import GoldsrcPhysics SDK.
- Write some codes on goldsrc client side to call the API. It looks like (pseudo code):
#include<physics.h>
//Represent GoldsrcPhysics API
physicsAPI_t g_physics;
void GameInit(){
g_physics.Init();
}
void OnMapLoad(){
g_physics.LoadScene(mapName);
}
void OnPlayerDie(int entityId){
g_physics.StartRagdoll(entityId);
}
void OnPlayerRespawn(int entityId){
g_physics.StopRagdoll(entityId);
}
...
- Add some data to describe the bones of each part of your player model.
- Have fun!
Learn more in the detailed tutorial
For developers who want to contribute to this project.
- Clone this repository to your computer.
- VS2019 + .NET4.6.1 SDK
If you just want to build your own binary release, follow this guide.
- Open \src\GoldsrcPhysics.sln with your VS2019.
- Change build option to Release mode.
- Right click your project on
Solution Resources Manager
and click build.
You will see the \bin
folder on your repo root.
- Goldsrc game which uses this library (GoldsrcPhysics) is needed.
- Open project properties window.
- edit the post build event on build event pannel for copying GoldsrcPhysics.dll to
"path\to\your\game\gsphysics\bin"
- select debug pannel, edit the path Launch external program to your game executable file. Usually named hl.exe or cstrick.exe.
- maybe need some program arguments to specify your mod. eg
-dev -debug -console
- Press F5, you'll see the game launched by VS2019.
- If you set a break point, VS2019 will tell you the break point is available.
If you found issues, don't hesitate to submit a new issue here. Also, pull request is welcomed!