Player Movement Style like HL1 Created 2 months ago2019-08-21 12:02:47 UTC by sprodmusic sprodmusic

Created 2 months ago2019-08-21 12:02:47 UTC by sprodmusic sprodmusic

Posted 2 months ago2019-08-21 12:02:47 UTC Post #343058
Hello guys and thanks for having the time to read my post.

I'm new here and also new in game modding, I've learned a lot of things here and elsewhere to how to make a mod with source SDK base.

I want now to make a movement, jumping, strafring, air accel, speed style in Hl2(SDK 2013) Mod exactly the same way of Half-life 1 (goldsrc)

I've tried a lot of experiences like modifying some .CPP files gamemovement.cpp and others, but I failed with some errors in my visual studio 2013

because I don't have knowledge of how to use it xD, just try to change some same code values.

I also tried to explore some .dlls but i don't have the permission or it's impossible to explore the dlls in bin file ( client.dll server.dll)

can you please help to make this idea or show me what code I need to edit for the character movement.

Thank you in advance
Posted 2 months ago2019-08-21 13:47:09 UTC Post #343060
In Half-Life 1, you'll find the player movement code in sources prefixed with pm_, as it stands for "player movement".
For example, pm_shared.cpp. There, you will see player movement for GoldSrc, which you'd have to adapt for your Source mod.

Also, what exact errors are you getting? Are you opening a single .cpp file then trying to compile it, or do you open the appropriate .sln (solution) file and then compile?

As for DLLs, you can't "explore" them, because they're compiled. For a beginner, let's just say they're executable, just like .exe, but you can't execute them directly. The SDK code is meant to compile new DLL files (client and server), so if you wanna know how some entities work, you would look at the source code in the Source SDK.
Alternatively, you can disassemble a DLL with some programs, but for someone who's new to programming and modding in general, let's not talk about them.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 2 months ago2019-08-21 14:56:54 UTC Post #343061
Hello Admer456, thank you so much for your time and your answer

So yes I'm using a .sln (solution) with a visual studio 2013, for a multiplayer mod

I got a lot of error, for example, I took some codes from this :

void PM_WalkMove ()
{
int clip;
int oldonground;
int i;

vec3_t wishvel;
float spd;
float fmove, smove;
vec3_t wishdir;
float wishspeed;

vec3_t dest, start;
vec3_t original, originalvel;
vec3_t down, downvel;
float downdist, updist;

pmtrace_t trace;

// Copy movement amounts
fmove = pmove->cmd.forwardmove;
smove = pmove->cmd.sidemove;

TO THIS :

void CGameMovement::WalkMove( void )
{
int i;

Vector wishvel;
float spd;
float fmove, smove;
Vector wishdir;
float wishspeed;

Vector dest;
trace_t pm;
Vector forward, right, up;

AngleVectors (mv->m_vecViewAngles, &forward, &right, &up); // Determine movement angles

CHandle< CBaseEntity > oldground;
oldground = player->GetGroundEntity();

// Copy movement amounts
fmove = mv->m_flForwardMove;
smove = mv->m_flSideMove;

i would like to know what I should change in my gamemovement.cpp from pm_shared.cpp to have the result i want.

you should know about kreedz Climbing mod (a mod using cs 1.6 model and movement in source) I want to make something similar but with half-life 1 instead

thank you in advance
Posted 2 months ago2019-08-21 17:42:51 UTC Post #343063
Well, it's a bit complicated.

You'd have to analyse the maths behind Half-Life 1 player movement, then analyse the maths behind HL2's player movement. Then you compare them, to see where they differ. Then, you just copy the changes from HL1 movement to your source code.

Sadly, I haven't worked with any player movement codes myself, so I can't help much here. I suggest you to learn a bit of Source SDK like how to create a new entity class, in order to understand how things generally work in it. Then player movement will be easier to understand, and in the end, easier to edit because you'll know where to look for things to edit.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 2 months ago2019-08-21 23:47:57 UTC Post #343064
thank you so much, well i will try
You must be logged in to post a response.