Forum posts

Posted 1 week ago2025-02-07 22:03:49 UTC
in Broken lighting in J.A.C.K editor! Post #349523
You can read the How to fix those leaks guide. The map editor should be able to load a line that ends up going through the leak. The info_player_start is merely the first entity that "saw" the leak, so to speak. You'll find more details in the guide.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 1 week ago2025-02-07 00:01:05 UTC
in Error message keeps on bugging me! Post #349516
This happens in one of two cases:
1. Your texture scales have a huge ratio (e.g. X scale is 4 when Y scale is 0.1). Texture scale should have an aspect ratio of 1:1, avoid extremes like 10:1
2. The texture projection axis is perpendicular to the face

In other words, a texture gets suuuuuper stretched, like spaghetti. This causes issues with lightmapping.
The first one happens when you use Fit on an entire brush which is very thin (e.g. a door which is very thin, like 4 units) - several sides will become extremely stretched. When you use it, please only select the faces that actually need fitting, usually it's just one or two faces.

For the second one, you need to change the texture projection, tick either World or Face in the Texture Application tool. You can also read Error: Texture axis perpendicular to face for a more visual illustration of this problem.
Admer456 Admer456If it ain't broken, don't fox it!
I have my doubts, but okay. In either case, you should have a good idea of what to do now, i.e. declare that method.
Admer456 Admer456If it ain't broken, don't fox it!
I see issues like these a lot, where beginners try to add/edit NPC code, weapon code etc., but some basic error happens and they have no idea what they're doing nor how to fix it.

If you knew what the error meant, you would realise that this class here is declared as well as its methods like Spawn, Precache and others:
class CHEVScientist : public CSquadMonster
{
public:
void Spawn(void);
void Precache(void);
int iSpikes;
int Classify(void);
void SetYawSpeed(void);
};
However, you are defining or implementing a method down here:
//=========================================================
// HandleAnimEvent - catches the monster-specific messages
// that occur when tagged animation frames are played.
//=========================================================
void CHEVScientist::HandleAnimEvent(MonsterEvent_t* pEvent)
{
...
}
Which is not declared in your class above. If you don't understand what I'm saying (methods, implemented, declared), then:

Learn the basics of C++, learn what a function is, what classes are, what declaring is, what members are, spend a couple months experimenting with C++ writing console apps or maybe even using a simple framework like Raylib, write a mini Half-Life SDK for studying, learn how to read code and study it, and then come back to this. Do not learn C++ while simultaneously learning the HL SDK - you will have a really hard time otherwise.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 2 months ago2024-12-16 15:23:58 UTC
in Soulless Venture Thread Post #349411
Oa... this is so cool
Admer456 Admer456If it ain't broken, don't fox it!
Posted 2 months ago2024-12-15 18:26:20 UTC
in Good testing maps? Post #349405
Nothing to apologise over. You just need to take a mini break and try again later.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 2 months ago2024-12-08 22:53:09 UTC
in Odd green und red lines Post #349396
And don't forget our own guide:
Tutorial: How to fix those leaks
Admer456 Admer456If it ain't broken, don't fox it!
Posted 2 months ago2024-12-04 21:34:09 UTC
in Programming video tutorials Post #349383
He's a fox blob actually. A little boxy, sure, but mainly a blob!
Admer456 Admer456If it ain't broken, don't fox it!
Posted 2 months ago2024-11-30 22:08:53 UTC
in Programming video tutorials Post #349373
"Projectile weapons" has been released. It has a bit of a sawblade launcher, charging grenade launcher, poison dart and a funky concept of proximity grenades.
Projectile weapons
Admer456 Admer456If it ain't broken, don't fox it!
You'll have to program that (TriAPI, VGUI, or even ImGui or any other UI system you can integrate). There's no way to achieve that via mapping to my knowledge.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 3 months ago2024-11-06 02:21:32 UTC
in What does this tool do? Post #349321
Ah, You caught me, good prank?
Thanks for wasting my time I guess.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 3 months ago2024-11-05 18:36:11 UTC
in What does this tool do? Post #349317
I've never seen this before, and something tells me you're joking now.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 3 months ago2024-11-05 14:39:53 UTC
in What does this tool do? Post #349315
It is most likely another placeholder image. It is Valve's sense of humour.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 3 months ago2024-11-05 13:36:22 UTC
in What does this tool do? Post #349313
It's not an actual tool. It is just a placeholder image.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 3 months ago2024-10-31 19:40:08 UTC
in Coding problems. Post #349302
Have you tried copying the sprites over into your mod folder?
Admer456 Admer456If it ain't broken, don't fox it!
Yeah, C++ is quite the beast. I'd be willing to answer any other questions you'd have, whether here or on TWHL Discord, so feel free to ask.
Admer456 Admer456If it ain't broken, don't fox it!
Okay so generally speaking, avoid writing implementation code like this in headers.
class Class
{
public:
    void Method()
    {
       // Avoid doing this if possible
    }
};
// Class.h
class Class
{
public:
   void Method();
}

// Class.cpp
void Class::Method()
{
   // Do prefer doing this in .cpp files - sometimes it may not be possible
}
This is because of how declarations work in C and C++. When a header is #include -ed into a .cpp file, it is literally copy-pasted there, together with other headers. If a datatype is declared above some code, then that code is quite simply "aware" that it exists.

In other words, when writing code in header files, be aware of other headers that may be included, in the .cpp files that include that header.

In this case, chances are CBasePlayer wasn't declared in one of these situations. So you gotta move that code into a .cpp and include player.h to get the CBasePlayer declaration. Or, if you absolutely have to do it in a header, you can use forward-declaration:
class CBasePlayer; // this class is more fully declared elsewhere
Admer456 Admer456If it ain't broken, don't fox it!
Post your code (preferably a good chunk of the .cpp) please. Something doesn't sound right.
Admer456 Admer456If it ain't broken, don't fox it!
Check the datatype of pOther. It's probably an entvars_t* which you first must convert into a CBaseEntity* via some utility.
Admer456 Admer456If it ain't broken, don't fox it!
Yeah, after a few days working with SDK, I'm starting to think that guys from Valve didn't know about any good coding practices or principles back in 1998.
They knew about good principles, they just didn't really have the time to apply em. Between 1996 and 1998, the game spec changed so rapidly and so much, nobody could really keep up. Game code is very patchy, very volatile, and rapidly evolves. It's simply like that by nature.
but I also want to ask how to get CBasePlayer from CBaseEntity
if ( pEntity->IsPlayer() )
{
   CBasePlayer* player = static_cast<CBasePlayer*>( pEntity );
   ...
}
It is possible you were getting errors because you were casting to CBasePlayer and not CBasePlayer*. This is just C++'s value and reference semantics. In C#, a value type is a struct. In C++, a value type is anything that isn't a pointer. So you were trying to, essentially, convert a reference type into a value type there. Possibly, I'm just guessing.

Rule of thumb: if you know an object is of a certain class (e.g. via IsPlayer or checking pev->classname), you use static_cast. static_cast will throw if the cast fails.
If you don't know what object a class is, and you wish to "ask" it, you use dynamic_cast (a bit like the is keyword in C# but simultaneously it's an as)

You may then write a few utility methods into CBaseEntity too, as an example:
template<class T>
T* As()
{
    return static_cast<T*>( this );
}

template<class T>
T* TryAs()
{
    if ( Is<T>() )
    {
       return As<T>();
    }

   return nullptr;
}

template<class T>
bool Is()
{
    return dynamic_cast<T*>( this ) != nullptr;
}
Usage:
if ( pEntity->Is<CBasePlayer>() )
{
   pEntity->As<CBasePlayer>()->DoPlayerSpecificStuff();
   // or
   CBasePlayer* player = pEntity->As<CBasePlayer>();
}
Admer456 Admer456If it ain't broken, don't fox it!
As for flTime and others, that is the absolute time (in seconds) since the client started... something, I am not 100% sure if it's since joining the server or starting up the game altogether, but it's likely the latter.

And yes, gHUD is the HUD singleton. It represents the clientside as a whole, almost a bit of a god object I'm afraid..

Also, the HUD is redrawn every frame no matter what, it's an immediate-mode GUI as opposed to a retained one. So if you changed some colour variables, and they are being referenced in the HUD code, no worries, it'll auto-apply.
Admer456 Admer456If it ain't broken, don't fox it!
Yeah, HL already does this in plenty of places, e.g. to send damage information to clients. What you're describing is a Remote Procedure Call / RPC, and Half-Life implements it exactly via "user messages".

It's a manual, tedious process, but fairly simple to follow:
Serverside: declare a global message ID (inline int gmsgMyMessage) and register it, i.e. link it to a name: gmsgMyMessage = REGISTER_USER_MSG( "MyMessage", -1 ), the last number saying how many bytes are sent in this message, -1 if unknown
Clientside: declare a HUD function and glue it to said message name with some macros, like DECLARE_MESSAGE and HOOK_MESSAGE

Here's a guide for that.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 months ago2024-09-16 16:51:56 UTC
in Half-Life DM x Counter Strike Post #349169
In one of the comments, they say they will make a more technical follow-up video. So, we might find out.

My guess is that it's maybe a particular combination of Half-Life SDK and reverse-engineered CS 1.6 code.

Edit:
Author says in one of the comments:
It is a hybrid server that runs both mods so both HL and CS clients can connect.
This is gonna be interesting.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 months ago2024-09-12 20:16:01 UTC
in HELP!My HLBSP is died again Post #349148
I didn't notice. I will look at your RMF file soon.

By the way, it's over here on TWHL's tools section:
https://twhl.info/wiki/page/Tools_and_Resources#Compile_Tools
Look for "Vluzacn's ZHLT v34".
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 months ago2024-09-12 18:49:17 UTC
in HELP!My HLBSP is died again Post #349144
It is crashing at some point. It's hard to guess what the cause is, with just a compile log and no screenshots of the map or any further information.

I see that you are using some compilers from 2012? Have you tried using Vluzacn's HL Tools a.k.a. VHLT?
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 months ago2024-09-03 19:25:37 UTC
in Post your screenshots! WIP thread Post #349128
That's a beautiful beam, Windawz :heart:
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 months ago2024-09-02 15:47:45 UTC
in cry of fear embedded bsp textures modification Post #349119
It's going to be very tedious, I'd advise to not bother. If you change the resolution of a texture, you'll have to change so many other things in the BSP as well, i.e. scale down the UVs, which leads to more world polygons (they're subdivided every 240x240 texture pixels), and you never know if you're gonna run into lightmap limitations.

There is no such thing as an "accurate decompilation" because the BSP simply doesn't have much data. It has processed faces, but not whole brushes, best decompilers can do is guess. This means no clip brushes, sometimes no triggers either. If a face is optimised away and removed by the compiler, you cannot get it back. There's just not enough data in the .bsp, simple as that.
Admer456 Admer456If it ain't broken, don't fox it!
In my 10 years of modding, I think I've earned up to 400€, most of which was programming, a small percentage of it being mapping. And keep in mind, this was GoldSRC.

On the other hand, I got way more by getting involved in a couple commercial projects, Source and idTech-related.
So it's definitely possible and it definitely happens, but very rarely so, plus you gotta be exceptional and timely. After all, it is professional work you'd be offering.
Admer456 Admer456If it ain't broken, don't fox it!
I remember being 14 and trying to figure out this specific thing, almost a decade ago. I remember I did some stupid nonsense thing to get it to compile, and then it crashed whenever the monster looked at me. I've come a long way since and, even though this would be super easy for me now, it gives me a unique kind of satisfaction, justice almost, to see someone publish a solution. Thank you.

I sure wonder why they returned null in GetScheduleOfType, probably an SDK difference of some sort? In either case you can also edit the tutorial itself.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 months ago2024-08-26 21:39:29 UTC
in Everybody talking about Half-Life 3 again Post #349088
Personally, i strongly believe they are developing something
I'm sure they're always developing something. I'm guessing that, right now, the gamedev work is mainly distributed across Deadlock (production and testing) and Counter-Strike 2 (maintenance and hopefully content updates), with maybe, maybe just a little bit of wiggle room? For an unannounced game in an early prototyping stage?

But then again, that's just a guess. I might be forgetting to take plenty of things into account.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 months ago2024-08-26 21:18:53 UTC
in code modding counter strike? Post #349087
Hello! In order to mod CS the way you're thinking, you need to have its whole source code. All of the weapons, gamemode rules etc. Unfortunately, there's only an official SDK for Half-Life, and an unofficial OpFor SDK, nothing for CS.

So, the best thing you can do is to replicate CS 1.6 in a HL mod, which is a respectable amount of work, annnd yeah, stuff like adding new weapons requires a good bit of C++ and HL SDK experience.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 months ago2024-08-26 14:12:53 UTC
in Everybody talking about Half-Life 3 again Post #349079
Valve leaves traces of game prototypes and does other stuff out of practical reasons, which some people misinterpret as them secretly working on something. I honestly really doubt they're working on anything Half-Life-related on a meaningful scale.
(one or two people could be developing some mini prototype at any point, but for it to have any meaning, it needs to be in actual production)

The "White Sands" stuff isn't really telling of anything, the Black Mesa biotech company very much looks like a fan-made thing, and everything else is just a whole bunch of nothingburger, nothing to get excited about, really.

There's also the possibility that Valve is intentionally trolling us. If I worked at Valve, I'd do the same just to spite the community. Waiting for HL3 has been a meme for such a long time, it makes perfect sense to make fun of it and people's never-ending hope for the game. It's almost a bit like, uhh, Minecraft removing Herobrine every update.

Me personally, I couldn't care less at the very moment. If it turned out that I was way too sceptical and Half-Life 3 actually got a trailer one day, great, I'll probably get very excited for a brief moment. If it never happens, no big deal, I never expected it anyway.
Admer456 Admer456If it ain't broken, don't fox it!
This post was made on a thread that has been deleted.
Posted 6 months ago2024-08-02 15:06:40 UTC
in HELP! Map crashes while making new mod. Post #349029
You seem to have custom DLLs. Did you build both hl.dll and client.dll? In fact, tell us how exactly you made the mod i.e. what you've put into the mod folder.
Admer456 Admer456If it ain't broken, don't fox it!
My guess is that the 25th anniversary has custom HUD rendering code right in the client DLL. However, it is possible to do the sprite drawing yourself using the Triangle API (you manually submit triangles to the renderer), and I'm pretty sure some folks have already done stuff like that. I don't recall any GitHub repositories off the bat, I'll let you know though
Admer456 Admer456If it ain't broken, don't fox it!
Make sure you've installed Visual Studio 2022 properly, with a Windows SDK. Then make sure to upgrade the solution to the latest MSVC (in VS2022 it's v143, in VS2019 it's v142 etc.)
Admer456 Admer456If it ain't broken, don't fox it!
Posted 9 months ago2024-05-14 17:30:50 UTC
in How to change HUD color in HL1/Goldsrc games Post #348800
Nope. HUD colour is hardcoded, and changing it requires code changes.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 9 months ago2024-05-08 21:00:11 UTC
in Car™️ Post #348784
Remember: the more stuff you make, the faster you'll get at it, and it will be less of a chore to make it in the future
Admer456 Admer456If it ain't broken, don't fox it!
Posted 10 months ago2024-04-17 18:31:19 UTC
in Game crashes when using impulse 101 Post #348722
Or remove the line that gives the MP5 grenades to the player.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 1 year ago2024-02-06 17:40:23 UTC
in Assertion Error in jack editor Post #348563
Could you provide a screenshot of the error?
Admer456 Admer456If it ain't broken, don't fox it!
Posted 1 year ago2024-02-06 14:14:49 UTC
in Wiki enhancment thread Post #348561
TrenchBroom stuff is in my plans. Hammertime will be interesting to see.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 1 year ago2024-02-04 15:52:54 UTC
in Issue with modding particular sequences Post #348547
That's quite odd. I don't suppose there are any cue points or anything in there, GoldSRC tends to be very picky about those.
This will need some testing in an isolated map t.b.h.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 1 year ago2024-02-03 20:29:32 UTC
in Issue with modding particular sequences Post #348540
If I recall correctly, voicelines should be up to 11 kHz, mono, unsigned 8-bit PCM, so that the engine can perform crude lip sync.
Other sounds (ambience, gunshots etc.) can be up to 22 kHz, mono, unsigned 16-bit PCM.

Oh by the way, for future reference, technical questions go here:
https://twhl.info/forum/view/goldsource
The "Maps and Mods" category is more for showing off map/mod projects... not that it has been enforced much lately x3
Admer456 Admer456If it ain't broken, don't fox it!
Posted 1 year ago2024-02-02 13:32:07 UTC
in Forum dead? Post #348521
Upload to the TWHL Vault and then everybody can rip it apart!
Admer456 Admer456If it ain't broken, don't fox it!
Posted 1 year ago2024-01-16 22:17:31 UTC
in Programming video tutorials Post #348451
It's that time of the year again.
Hitscan weapons
Admer456 Admer456If it ain't broken, don't fox it!
Probably means flickering.
Admer456 Admer456If it ain't broken, don't fox it!
New tutorials are always appreciated, so much so we have a special place for them: the TWHL wiki
Admer456 Admer456If it ain't broken, don't fox it!
Hello!
You should definitely look into CGameRules and the code around it.

The class: https://github.com/SamVanheer/halflife-updated/blob/master/dlls/gamerules.h#L61
HL deathmatch gamemode: https://github.com/SamVanheer/halflife-updated/blob/master/dlls/gamerules.h#L260
Gamemode factory: https://github.com/SamVanheer/halflife-updated/blob/master/dlls/gamerules.cpp#L371

You can basically select your different scenarios in InstallGameRules (assuming they'd be implemented as gamerules) instead of mangling with different DLLs. The latter could be pretty messy.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 1 year ago2023-11-15 00:55:56 UTC
in Wiki enhancment thread Post #348042
I'm down for writing a number of beginner tutorials. I could allocate some time to write them all by New Year, just need a bit of a plan first.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 1 year ago2023-11-09 22:02:08 UTC
in trigger_changelevel @ c1a1d Post #348010
You get to the next map via an elevator I think? This is just before Office Complex yeah.

What ends up happening is you're going between 2 maps that depict basically the same area, you just kinda do a "U-turn" in terms of levelchanges to get to the other side of the (destroyed) bridge in map 1.
Admer456 Admer456If it ain't broken, don't fox it!