Very nice! I like the details & lighting.
Having it in the TWHL Map Vault would also be pretty cool.
dlls
folder in the SDK, here's the crowbar for example:CHalfLifeMultiplay::FPlayerCanTakeDamage
.
//=========================================================
//=========================================================
bool CHalfLifeMultiplay::FPlayerCanTakeDamage(CBasePlayer* pPlayer, CBaseEntity* pAttacker)
{
return true;
}
Simply replace return true;
with this:
return !pAttacker->IsPlayer();
This will affect the deathmatch gamemode.AddToFullPack
. You'll need to additionally determine if the env_sky can see the other entities, and if so, transmit them. At least I think.On that note: to use the CMake version of Half-Life Updated you currently have to build the INSTALL target to deploy the libraries, which might be a bit cumbersome and annoying.Not a problem for me, though I imagine it'd be a bit confusing/frustrating to beginners.
?
symbol is an inline if.result = condition ? a : b;
...is the same as:
if ( condition )
result = a;
else
result = b;
UTIL_FindEntityByTargetname
.VectorAdd
should work fine with vectors.
#define VectorAdd(a,b,c) \
{ \
(c)[0]=(a)[0]+(b)[0]; \
(c)[1]=(a)[1]+(b)[1]; \
(c)[2]=(a)[2]+(b)[2]; \
}
Since the Vector
class has the operator [ ], you can access its XYZ components with [0], [1] and [2] respectively, thus, VectorAdd will work perfectly fine.
Vector myVector = Vector( 20, 40, 50 );
// Alternatively: Vector myVector{ 20, 40, 50 };
VectorAdd( pparams->viewangles, myVector, pparams->viewangles );
The only reason you'd use *
and (float*)&
might be due to something like this:
void MyFunction( Vector* someParam )
{
someParam->z += 20.0f;
}
...
Vector myVector{ 0, 0, 0 };
MyFunction( &myVector );
But I'd rather not do that. I'd rather pass the vector by reference instead of passing a pointer to it:
void MyFunction( Vector& someParam )
{
someParam.z += 20.0f;
}
...
Vector myVector{ 0, 0, 0 };
MyFunction( myVector );
That way, you don't need to use pointer syntax. ^^"unfamiliar with C++"It's less about knowing the language, more about knowing HL SDK. I think it's an okay solution, given the messy nature of the SDK.
*ev_permpunchangle
and (float*)&ev_permpunchangle
. You're not using a pointer to ev_permpunchangle
, are you? The code would be cleaner if you did it differently, such as using a reference in the function parameters (Vector&
) or something like that.V_CalcRefdef
is the function you might wanna look at)m_pPlayer->pev->fixangle
to 1 if you wanna force view angles with pev->v_angle
.string_t
and UTIL_FindEntityByTargetname
.lighting.plightvec = dir;
// After StudioDynamicLight is called, lighting is initialised
IEngineStudio.StudioDynamicLight(m_pCurrentEntity, &lighting );
// We can then begin changing it around
lighting.ambientlight = 0;
lighting.shadelight = 0;
// The rest will apply the lighting onto the model
IEngineStudio.StudioEntityLight( &lighting );
I believe you could, maybe, somehow modify lighting
to get fullbright...ambientlight
to 255 and shadelight
to 0. So yea, the code just becomes:
lighting.plightvec = dir;
IEngineStudio.StudioDynamicLight(m_pCurrentEntity, &lighting );
// Fullbright
lighting.color = Vector( 1.0f, 1.0f, 1.0f );
lighting.ambientlight = 255;
lighting.shadelight = 0;
IEngineStudio.StudioEntityLight( &lighting );
Now, the only thing left to do is to check whether it's a specific entity or not. I guess you can check if m_pCurrentEntity->index
is a certain number or something like that. Or, even better, add a special render FX value for that. halflife-updated
, these are converted to C++)PM_Move
function. PM_Move
calls PM_PlayerMove
which contains all the pseudo-physics code for player movement, so you can modify all the "formulas" there, so to speak. PM_WalkMove
, perhaps around this part:"I somehow couldn't find a link to it."Here be the invite: https://discord.gg/hDSrpCDXhD (and if that's expired: https://discord.gg/8VhuRpNt)
"the spawned func_train didn't do what you think spawned func_trains are supposed to do – to immediately teleport to its first stop target"Solokiller explained it pretty well. In the HL SDK at least, func_train doesn't do anything special in Spawn: Only after all entities have spawned, Activate() is called, which does the actual first path corner logic: This here is what effectively "ignores" origin brushes.
"it's already started..."'w'
-game mymodfolder
, where mymodfolder
is, in fact, your mod folder as it appears in the Half-Life folder.