Forum posts

Posted 5 months ago2023-12-04 19:54:42 UTC
in Make curved Hallways in Source / Hammer++ Post #348149
Just set hammer++ up with bms, and it seems to work fine, gotta make some maps first then i can give a more accurate answer
Tarek TarekA literal dumbass who uses Hammer++
Just to make it clear i am posting this because the last thread is too old so i cant respond there.
To remove the Training room button from your Half-Life mod , go in your mod folder , make a new folder called resource.
then go in your half life files folder and then in valve\rscource and search for the file "NewGameDialog.res" and copy than inyour modfolder\resources.
Now open the file and scroll down until you see :
"TrainingButton"
{
...
}
now delete that part, save your file and launch the game. When you press new Game the Training room button wont be there.
If you dont trust yourself deleting files i will copy paste the code here and then just delete everything in NewGameDialouge.res and paste this in:

"Resource\NewGameDialog.res"
{
"NewGameDialog"
{
"ControlName" "Frame"
"fieldName" "NewGameDialog"
"xpos" "390"
"ypos" "254"
"wide" "280"
"tall" "302"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"tabPosition" "0"
}
"Label4"
{
"ControlName" "Label"
"fieldName" "Label4"
"xpos" "40"
"ypos" "40"
"wide" "220"
"tall" "24"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"tabPosition" "0"
"labelText" "#GameUI_Difficulty"
"textAlignment" "west"
"associate" "Difficulty"
"dulltext" "0"
"brighttext" "0"
}
"Difficulty"
{
"ControlName" "ComboBox"
"fieldName" "Difficulty"
"xpos" "40"
"ypos" "68"
"wide" "200"
"tall" "24"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"tabPosition" "1"
"textHidden" "0"
"editable" "0"
"maxchars" "-1"
"default" "1"
}

"PlayGame"
{
"ControlName" "Button"
"fieldName" "PlayGame"
"xpos" "40"
"ypos" "180"
"wide" "200"
"tall" "24"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"tabPosition" "3"
"labelText" "#GameUI_PlayGame"
"textAlignment" "center"
"dulltext" "0"
"command" "Play"
"default" "0"
}

"PlayGame_Alt"
{
"ControlName" "Button"
"fieldName" "PlayGame_Alt"
"xpos" "40"
"ypos" "216"
"wide" "200"
"tall" "24"
"autoResize" "0"
"pinCorner" "0"
"visible" "0"
"enabled" "1"
"tabPosition" "4"
"labelText" "#GameUI_PlayGame_Alt"
"textAlignment" "center"
"dulltext" "0"
"command" "PlayGameAlt"
"default" "0"
}


"Cancel"
{
"ControlName" "Button"
"fieldName" "Cancel"
"xpos" "166"
"ypos" "264"
"wide" "72"
"tall" "24"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"tabPosition" "5"
"labelText" "#GameUI_Cancel"
"textAlignment" "west"
"dulltext" "0"
"command" "Close"
"default" "0"
}
"BuildDialog"
{
"ControlName" "BuildModeDialog"
"fieldName" "BuildDialog"
"xpos" "87"
"ypos" "250"
"wide" "285"
"tall" "665"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"tabPosition" "0"
}
}
Posted 5 months ago2023-12-04 17:01:04 UTC
in How to lower the difficulty to YAPB bots? Post #348146
Bumping it sorry, important question
REBELVODKA REBELVODKASemper fidelis
Posted 5 months ago2023-12-04 12:57:41 UTC
in Errorless funnels Post #348145
Damn, that's some useful info, I had no idea you could scale verticies! Thanks!
Posted 5 months ago2023-12-04 10:04:59 UTC
in Make curved Hallways in Source / Hammer++ Post #348144
I havent started with bms yet, I only used it with half life 2, and its episodes, but im gonna try and use it with bms, ill post an update if its good or not
Tarek TarekA literal dumbass who uses Hammer++
Posted 5 months ago2023-12-04 09:46:19 UTC
in Make curved Hallways in Source / Hammer++ Post #348143
Hello

I learned it with this guide: https://developer.valvesoftware.com/wiki/Creating_a_Curved_Hallway

I know im just kinda throwing a you a google result. Some pointers i found on my own was that the result gets better if you stick to grid, and moved the vertices a bit after so you have nice snapping.

Im also playing with a mod for BM:S but using their included Hammer. I read there were some issues with Hammer++, is it worth it?
Posted 5 months ago2023-12-04 09:30:44 UTC
in Make curved Hallways in Source / Hammer++ Post #348142
Hey there, I want to make a curved hallway in Source, im using hammer++ and the game I want to map for is Black Mesa Definitive Edition. Thats about it.
Tarek TarekA literal dumbass who uses Hammer++
Posted 5 months ago2023-12-04 08:03:50 UTC
in Errorless funnels Post #348141
First you'll want to make a hollow cylinder using the Arch Primitive
User posted image
and make some duplicates of it (or use Clip Mode to subdivide it)
User posted image
then in Vertex Manipulation Mode select all except the top layer of vertices and right-click and hit Scale Vertices (Alt+E)
Here I'm locking the Z axis so vertices aren't displaced verticallyHere I'm locking the Z axis so vertices aren't displaced vertically
and repeat that previous step leaving out the next uppermost layer of vertices and so on until you have your funnel
User posted image
Posted 5 months ago2023-12-04 04:00:10 UTC
in Coding help needed for PMPreCache plugin Post #348140
I'm thinking that maybe I should create an entity and define a Think() callback for it with a sufficient delay set for nextthink. Now I'm wondering if this is the elegant way of delaying actions in a plugin or is there a more straightforward way.
Posted 5 months ago2023-12-03 19:58:08 UTC
in Errorless funnels Post #348139
Hello, I would like to know if there is a way to create a funnel out of a hollow cylinder without any errors with the vertex tool.
In my new map I want the middle to be a funnel, like the one from star wars in cloud city. I just can't figure out how I can create something like that without breaking the laws of goldsrc. Any ideas?
Posted 5 months ago2023-12-02 22:48:22 UTC
in MESS 1.2 has been released! Post #348138
MESS 1.2.1 is now available!

This is a hotfix that fixes a problem with the configuration system that prevented template entities and behaviors from being loaded. :roll:

It also adds a 'template_entities\custom' directory where custom template entities and behaviors can be stored without the risk of being overwritten by a future update.
Posted 5 months ago2023-12-02 21:40:38 UTC
in Bug with the "Pollen Sprites" around the entity Post #348137
Nvm, just added trigger_once, that will trigger my headcrab with trigger condition set "See player, Mad at player", and it worked! (but thanks anyway)
Where exactly are you trying to place your headcrabs that this fix is necessary? The pollen sprite means an NPC is too close to the level geometry. The fix is to move them away from the surface they're stuck in.

That guide (I only scan read it) seems to suggest using a scripted_sequence to move them into position for scripted events. That's fine if you want the NPC to remain in that position, but not for the sake of them acting like normal enemies. They will remain looping in their idle animation until triggered to leave their idle state.
monster_urby monster_urbyGoldsourcerer
Posted 5 months ago2023-12-02 20:02:06 UTC
in Bug with the "Pollen Sprites" around the entity Post #348134
Could you send the map, please?
Posted 5 months ago2023-12-02 19:45:18 UTC
in Bug with the "Pollen Sprites" around the entity Post #348133
I was using this guide to fix that annoying "Monster stuck in the wall" error with yellow sprites around them. But, when using the fix to my headcrabs, they don't attack (and move) until player does damage to them. I even tried to place info_node's below the headcrab and scripted_sequence, but it didn't help.
Posted 5 months ago2023-12-01 17:58:42 UTC
in Multiple Game modes Post #348132
Alright, alright, alright!
Me again...

I'm looking for a way to build multiple game modes within the same mod. That's it for now!
I'm currently blocked and lost. Let's start with what I can see with other mods (from basic UI to code).

Half-Life Pre-25th vs. 25th
  • (25th) In the NewGameDialog.res file, there is a "PlayGameAlt" command that launches Uplink. With SDK, Uplink doesn't appear, so this command might be associated with something in the code??
  • (Pre-25th) In the same file, there is a "Play" command, but you can add engine commands. (i.e. "command" "engine map c1a0")
  • skills are not associated with any sort of command in this file (Easy, Medium, Hard). How does the game know?
  • I can modify the UI, but I CAN'T change how it operates. (Wouldn't be able to remove the Skills and just add a button with a command that redirects to a map and a skill. I absolutely need to select a skill to execute a "command".
Half-Life MMod
  • They modified GameMenu.res instead, adding a bunch of commands.
  • They allowed view for Custom Games and redirect the user to other mods (.dll) that operate differently. It doesn't seem efficient IMO, am I right?
SDK (coding)
  • gamerules files - seem only to be a if else command via InstallGameRules. Redirect to singleplayer_gamerules or multiplayer_gamerules.

My questions
  • What's the best practice to create multiple single-player gamerules that modify mainly weapons, models, player, etc? Should I create a mode1_gamerules file and mode1_weapon, mode1_player, etc. files that override some elements of the regular files? (For example, I know there's a player.cpp and CSplayer.cpp file in CS SDK)
  • Which file would I have to change/duplicate for each game mode (world?)
  • How do I connect those game mode to the UI? (obviously, I don't think it could work with a simple "engine" command in the .res, or even an associated .cfg file).
The main goal right now is to :
1. Create those modes and their triggers in the code.
2. Create an ALERT print in the console during Precache to test that these modes are correctly triggered when loaded.
3. Connect those modes with UI buttons (Ideally through a NewGameDialogue window, but I don't mind via the GameMenu

... If you made it that far, thank you!
Posted 5 months ago2023-12-01 14:28:57 UTC
in Half-Life Updated (custom SDK) Post #348131

Map Decompiler RC 1 released

Map Decompiler RC 1 has been released. See this thread for more information: https://twhl.info/thread/view/20625?page=1#post-348130

Further updates will be posted there from now on.
Posted 5 months ago2023-12-01 14:27:57 UTC
in Half-Life Unified SDK Map Decompiler Post #348130
The Half-Life Unified SDK Map Decompiler is a cross-platform map decompiler based on Quake 3's BSPC map decompiler tool.

Designed to decompile Half-Life 1 maps only (including Half-Life Alpha maps) this decompiler fixes bugs, adds support for maps produced by the latest compilers and introduces new features to produce the most accurate decompiled map sources possible.

Note that decompilers cannot produce perfectly accurate map sources due to limitations involving the Half-Life 1 BSP format. You will always need to fix up decompiled maps to get them working properly.

Release Candidate 1 is now available: https://github.com/SamVanheer/HalfLife.UnifiedSdk.MapDecompiler/releases/tag/V1.0.0.0-RC001

Changes in Release Candidate 1:
  • Fixed description text color not updating when changing the theme between Light and Dark
  • Reworked command line interface to use verbs to select the decompiler strategy instead of an option to make it easier to see which options apply to which strategy. See README.md for more information
  • Added more information about some features to README.md

I tried to add support for decompiling clip brushes but it seems to be impossible due to how clip brushes are handled by the compiler:
// clip brushes don't stay in the drawing hull
if (contents == CONTENTS_CLIP)
{
    b->hulls[0].faces = NULL;
    b->contents = CONTENTS_SOLID;
}
This makes clip brushes invisible but also removes them from the point hull, used for things like hitscan ray traces which is why you can shoot through them.

The tree-based algorithm uses the point hull so clip brushes can't be reconstructed by that, and the face-to-brush algorithm uses the visual mesh (aka drawing hull) so they don't exist there either.
This release will also be the full release if there are no problems. That will have to wait until the SDK projects have been moved so as to ensure the links contained in this project are updated to point to the twhl-community organization on Github.
Posted 5 months ago2023-11-30 22:54:51 UTC
in How to lower the difficulty to YAPB bots? Post #348128
I want they be more human about reaction time to shoot you, not be terminators, I mean that.
Because I spend almost rounds dead. And sorry posting again.
REBELVODKA REBELVODKASemper fidelis
Posted 5 months ago2023-11-30 19:14:11 UTC
in Better bots than Zbot Post #348127
Im trying yapd... which looks an enhanced version of podbot... Best of it they kill me everytime.
REBELVODKA REBELVODKASemper fidelis
Posted 5 months ago2023-11-30 17:27:32 UTC
in Better bots than Zbot Post #348126
What bots do you know that can use buttons and doors?
I see I can modify (i.e.) the weapon behavior per "Game mode".
As an example, the crossbow arrow explode on hit MP vs. regular hit in SP

Code: https://github.com/SamVanheer/halflife-updated/blob/fae5e0180a3caaba53b0c2ae7ad2f1218367817e/dlls/crossbow.cpp#L96

For weapon behavior for specific modes, I was thinking about adding the same pattern for each weapons.
For pickup restriction (i.e. crowbar-only mode), I guess I can do the same thing, instead of creating new entities.

Tweaking those isn't that much of a problem.
But I'm a bit lost at adding gamerules associated to this.

Should I copy the code of singleplay_gamerules.cpp and create a new crowbar_gamerules, glock_gamerules, lowhealth_gamerules.cpp files and tweak it accordingly. (Then point in different files with/ IsCrowbarmode, IsGlockmode/, etc.)

If so, how do I add those mode to the UI afterward.
A bit like the new 25th anniversary. You have your skills (1,2,3) and you can select regular or uplink with those skills.
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 5 months ago2023-11-30 12:45:46 UTC
in Coding help needed for PMPreCache plugin Post #348123
I decided to hook ClientPutInServer which runs when the player enters the game, but unfortunately it is too early to send messages from here.
void ClientPutInServer( edict_t *pEntity ) {
    const char* playername = STRING(pEntity->v.netname);
    char* modelname = g_engfuncs.pfnInfoKeyValue( g_engfuncs.pfnGetInfoKeyBuffer( pEntity ), "model" );
    char modelfile[256];
    snprintf(modelfile, sizeof(modelfile), "models/player/%s/%s.mdl", modelname, modelname);
    LOG_MESSAGE(PLID, "Player %s is using model %s", playername, modelname);
    if (fileExists( modelfile )) {
        LOG_MESSAGE(PLID, "Model %s is present on server", modelname);
        SAY(pEntity, "Your model is present on the server, it will be precached for the next round!");
        if (addPrecacheEntry( playername, modelname ))
            LOG_MESSAGE(PLID, "Added model %s to precache list", modelname);
        else
            LOG_MESSAGE(PLID, "Model %s will not be precached - reduntant or precache list is full", modelname);
    }
    else {
        LOG_MESSAGE(PLID, "Unable to precache due to FILE MISSING: %s!", modelfile);
        SAY(pEntity, "Your model is not present on the server, can't distribute for other players!");
    }
    RETURN_META(MRES_IGNORED);
}
If I send a message to other players who are already in game, or all players, they receive the message, so it's not that SAY() doesn't work. I think somehow I should add some timing, so the message would be sent several seconds later when they are already playing. (Just an irrelevant sidenote: the log message "Model %s will not be precached - reduntant or precache list is full" is confusing, because if the model is already added to the list, it WILL be precached for the next round, but won't if the list is full.)

SAY() is a macro I defined to send raw messages – I remember there are other methods I tried, but all of them effectively do this at their core.
#define SAY(pEntity, text) {\
    MESSAGE_BEGIN( MSG_ONE, GET_USER_MSG_ID(PLID, "SayText", NULL), NULL, pEntity );\
        WRITE_BYTE( ENTINDEX(pEntity) );\
        WRITE_STRING( text );\
    MESSAGE_END();\
}
And fileExists() here is just a wrapper for calling access() (this is the other thing I have problem with):
bool fileExists(const char* path) {
    char fullpath[256];
    snprintf(fullpath, sizeof(fullpath), "%s/%s", &gGamedir[0], path);
    return access(fullpath, R_OK) == 0;
}
I highly doubt that LoadFileForMe() would mmap() the file – it would be somewhat better because it's faster and the kernel could at least unload it if it's not used, but it would still be better to not load files in the middle of a game when they are not needed in memory.

IFileSystem in public/FileSystem.h is interesting, I think it would do what I need but I have no idea what it links to.
Posted 5 months ago2023-11-30 11:31:11 UTC
in Coding help needed for PMPreCache plugin Post #348122
I'm not sure how hard it is to load VFileSystem009 from a plugin but IFileSystem in public/FileSystem.h has a FileExists method. I'm not sure how LoadFileForMe works but I imagine the buffer has a long life, and I believe it memory maps the file.

I think there are callbacks for when a player connects in the engine? Which one are you using to check? ClientConnect or something else in DLL_FUNCTIONS should hopefully let you hook the player joining a game.

I think strings allocated by ALLOC_STRING last as long as the engine is running but I don't believe it's smart enough to check for already allocated strings.
Maybe use a cvar that selects the game rules.
Posted 5 months ago2023-11-30 11:23:00 UTC
in Better bots than Zbot Post #348120
I've only used zbot myself but podbot is an option - there are probably others. Check out Bots United as it has a few options.
Posted 5 months ago2023-11-30 11:22:05 UTC
in LoadBlob.cpp NULL!=hmoduleT Post #348119
Yeah it was still happening with the latest update, but I figured it out.

I hadn't quite disabled all the external .dll files - I was still linking steam_api.lib which seems to run some code automatically, and apparently Half-Life updated the version of the Steamworks SDK it was using. Previously it was using 1.42 but as of the these recent changes, it's now using 1.53a (which is still somewhat old).
Okay I figured it out - the engine ran the game at the same resolution as my screen which obscured the border - so it was windowed, just huge.
Posted 5 months ago2023-11-30 00:26:27 UTC
in MESS 1.2 has been released! Post #348117
MESS 1.2 has been released! :)

Besides a lot of small improvements and bugfixes, this update introduces a set of template entities and behaviors that are useful for advanced and novice mappers alike. There's an entity for triggering random targets, a multi-target variant of game_counter, an entity that can periodically trigger a target, a Counter-Strike specific entity that triggers its target when a new round starts, and so on. There's also a target pattern system that lets you write +door1 and train -> newpos instead of having to manually create a trigger_relay or trigger_changetarget. Advanced users can even make their own template entities and behaviors, and share them with others via .zip files.

Macro entities have also been improved: templates can now be given multiple names and macro entities can reference multiple templates, with custom weights, making it easier to create sets of related templates. Macro entities can also reference templates inside other maps, and macro_insert can now create multiple instances.

And if you're using TrenchBroom, you can add {_tb_group} to entity names and targetnames inside linked groups to produce unique names per group.
User posted image
User posted image
User posted image
Download links: Documentation: Notable changes & bugfixes:
  • Added a template entity library (mtl_trigger_random, mtl_trigger_counter, cs_trigger_roundstart, and more).
  • Added several template behaviors (target patterns, automatic multi_manager expansion, env_sprite angles fix, _tb_group support).
  • Templates can now have multiple names, and macro entities can reference multiple templates.
  • Macro entities can reference templates inside other maps.
  • Geometry scaling along individual axis.
  • Template properties now act as local variables.
  • macro_brush now also copies point entities from the selected template.
  • Several attribute-related scripting improvements (empty key removal, array keys, accessing parent entity attributes).
  • Automatic merging of brush entities.
  • Linux support (untested!).
  • MScript has been improved - it now supports functional programming.
  • Fixed that map files could not be read on certain systems, depending on culture settings.
  • Fixed incorrect handling of jmf worldspawn entities, and unwanted origin attributes.
  • Fixed that TrenchBroom map files could not be read (and vice versa).
Or go to the download page for a full list of changes and bugfixes.
Special thanks to Windawz, Loulimi and kimilil for their feedback, and all the others that contacted me about MESS during the past 3 years.
Nope, you're fine just using the fgd that came with JACK. There were some limits increased with the 25th Anniversary update but they weren't directly mapping-related limits for the most part.
Posted 5 months ago2023-11-29 22:46:29 UTC
in Help with custom buttons in goldsrc Post #348115
Trying to make a mod based on TFC. I added a menu item that runs "toggleconsole" and this text apears upon manually opening the console. (The button does nothing). Any ideas why it's doing this?

Unknown command from unsafe location. Ignoring.
I use JACK to do my mapping. Is there anything I need to do to allow it to work with the updated limits, like a new .fgd file? If there is, how can I find and install it?
Posted 5 months ago2023-11-29 14:38:09 UTC
in Better bots than Zbot Post #348113
Bumping it because is an important question for me.
REBELVODKA REBELVODKASemper fidelis
Posted 5 months ago2023-11-29 14:31:46 UTC
in Half-Life Asset Manager Post #348112
There is no Linux version yet, but you can try to build it yourself by using the Continuous Integration configuration as a starting point:
https://github.com/SamVanheer/HalfLifeAssetManager/blob/b6999b647c9439a2e8e2481c9672d9b6442fee2e/.github/workflows/ci-cd.yml#L19-L43

Some of these steps are only for CI, just make sure to clone the repository using recursive clone so vcpkg is also cloned. You'll need to set up CMake to use the toolchain file provided by vcpkg as shown in the CI configuration.

You'll need to install these packages as well:
  • libopenal1
  • qtbase5-dev
Run CMake to set up the Makefiles, then make and make install to install the resulting executable. Note that i haven't set up the install rules for Linux yet, the Windows version includes some third party libraries so it will probably be incorrect.

You can also download Linux artifacts produced by the CI pipeline on Github by going to the Actions tab and then the latest successful run, like this one: https://github.com/SamVanheer/HalfLifeAssetManager/actions/runs/6997951607

CI builds are release builds and are almost identical to release builds made using the above steps.

My goal is to get the Linux version fully operational for version 3 including proper installation rules and a simple guide for compiling, but that's not going to happen for a while.
Understood. I'll use those 2 points as guidelines when I get to the real painful entities that are a bit more involved.
Thanks for the help big fella! :)
I have a plan I have a planDeleted Scenes is the best CS!
Posted 5 months ago2023-11-29 10:58:49 UTC
in Better bots than Zbot Post #348110
I would like know if exist better bots than zbot for Counter Strike 1.6
I ask this because I see zbot sometimes moves with nosense or get stuck in some areas.
Thanks
REBELVODKA REBELVODKASemper fidelis
We don't really have a standard way to do it - it would be best to keep all the games on the same page unless they are significantly different for some reason. So I would say...
  • Same entity with only slightly different game-specific stuff -> add info box with the game-specific info
  • Same entity with very different game-specific stuff -> create new page with the game-specific info (new page called "entity_name (Game Name)")
Basically if the info box has a lot of text in it, put it in a different page. And then optionally on the page for the base entity, you can add an info box with a link to the other page for the CSDS users.
Penguinboy PenguinboyHaha, I died again!
Heyo,

What would be the best way to update pre-existing pages with new information that is specific to only one game?

Should I just add an information panel and add the category to add it into CSDS or is there another, better way similar to inheritance?
I have a plan I have a planDeleted Scenes is the best CS!
Posted 5 months ago2023-11-29 03:15:15 UTC
in Half-Life Asset Manager Post #348107
Can you provide the build instructions for Linux?
Here's the place to discuss, ask questions, or show off your work-in-progress screenshots for the Vanilla HLDM Competition celebrating Half-Life's 25th Anniversary!

The prizes are serious this time, it's my last available copy of Raising the Bar that'll be shipped to the winner. Good luck, I can't wait to see what you come up with!
Posted 5 months ago2023-11-29 01:45:00 UTC
in Issues with copy-pasted entity code Post #348105
Instead of copy-pasting, consider extending the CBarney class and overriding the methods those are different for your CCustom class.
Posted 5 months ago2023-11-28 23:20:44 UTC
in Issues with copy-pasted entity code Post #348104
I'm making a simple monster for my mod which is basically a copy of the Barney entity. I copied barney.cpp from the source code, then renamed everything to the name of my custom monster. I took care to make sure that everything was using the right case (i.e. CBarney vs. BARNEY_AE_DRAW vs. monster_barney), that the file paths were correct, and that the code still made sense. Even though it compiles fine and I can't see what I did wrong, I get the error message Can't init monster_custom in the console. This is the code I used (you can see at this point I've just replaced "barney" with the name of the monster):
https://pastebin.com/gicA49DR (using pastebin because the code was too long)

models/custom.mdl and sound/custom/... are real files and directories and have the expected contents.

EDIT: I am a moron. The solution was to actually compile the DLL and fix all the errors. I forgot I didn't even try to recompile first.
Posted 5 months ago2023-11-28 22:15:30 UTC
in Coding help needed for PMPreCache plugin Post #348103
Previously I announced my simple Metamod plugin which helps to spread player models. I've been using it ever since then and it works, but it has certain aspects that I'm dissatisfied with, and I'm not an experienced plugin author yet to fix them.
  1. On Linux, file names are case-sensitive, and if the user provides the model with a different case, my plugin doesn't find it. Not sure if the engine is prepared to look up files case-insensitively, but it leads to another problem: I use the access() system call to check for the existence of files and it is obviously not a good idea. Once, it completely bypasses the engine, so even if the engine has a solution to look up files case-insensitively, I don't utilize that. Moreover, it makes the code platform-dependent, as it won't compile on Windows. I know there is an engine callback, LoadFileForMe, but I don't want to load the model files at that point, just check for their existence. I also don't know the lifetime of the buffer returned by this function, is the engine smart enough to not load this file again when it is precached the next round, or would I waste memory, how to ask the engine to free it if I need to.
  2. The plugin is supposed to inform players whether the server has their player model. The problem is that the message is sent when the player has not yet fully entered the game, so it's not shown to them. When I was experimenting with this feature, I found like 3 methods to send messages to the player, and the maximum I could achieve is that the message appeared on the console, which is easy to miss. I somehow need to delay the sending of the message, but I don't know how to approach this problem. Somehow I should set up a timer.
  3. Currently I allocate my own buffer for storing strings because I'm afraid ALLOC_STRING() would redundantly allocate the same strings for the same player models over time and I don't know when these strings get freed. So I felt like this is the only way to control the lifetimes of these strings, but I'm curious for better ideas.
I really hope some HLSDK gods are around to help me out with this; thanks in advance! :D
Hey folks,

I'm building a challenge mod as a part of Half-Life's 25th Anniversary.
I have previous experience with C# .Net (school experience, 15 years ago), but I am new to C++, so I might not have all the right reflexes.

In a nutshell. I'm building a mod with different scenarios:
  • Crowbar only (with a few map iterations to remove the impossibility of making it happen - i.e. removing the mines in c2a4c and c2a4e and removing the explosive crates in c2a4g).
  • 9mm only (with iterations at c1a1 to make the doors open without having to break the glass)
  • 1hp mode (with iteration to c1a0d to remove the HEV suit, easy since .rmf is included in SDK)
  • Adding Hardcore skill (4th skill - realistic damage to player/monsters + slow when injured).
  • Realistic mode (counter-strike mechanism for weapons (1 side, 1 main, 1 melee, 1 explosive, with G to drop/change) + hardcore skill)
  • Permadeath mode (no save allowed, exit when dead, default skills + hardcore)
So far, I've programmed the crowbar & 9mm mechanism, and it works (created a new FallThinkProp and FallInitProp entity and removed Materialize() from them to create real pickable and prop unpickable weapons and avoid sound (weapon drop) looping issues.)

But now, it works for the entire game, no matter the skill I select.

If I want to incorporate everything under the same mod, what would be the best practice? How would I achieve that? Should I just create different .dlls and point the right ones depending on the mod selected with the in-game menu?

Open for collaboration as well :)
Posted 5 months ago2023-11-26 21:09:08 UTC
in Half-Life Asset Manager Post #348100

Half-Life Asset Manager V2 Release Candidate 1 released

Half-Life Asset Manager V2 Release Candidate 1 has been released: https://github.com/SamVanheer/HalfLifeAssetManager/releases/tag/HLAM-V2.0.0-RC001

Changes:
  • Added OpenGL debug logging (debug builds only)
  • Removed obsolete sequence group filename correction and saving behavior (no longer used)
  • Replaced stringstream uses with fmtlib
  • Updated vcpkg to latest version, updated dependencies to latest versions:
    • fmtlib: 9.0.0 => 10.1.1
    • spdlog: 1.11.0 => 1.12.0
    • OpenAL-Soft: 1.22.2 => 1.23.1
  • Reworked filesystem absolute path resolution to no longer search relative to the program install location
  • Implemented case-insensitive filesystem lookup to allow files to be loaded even if the filename case differs on Linux
  • Rewrote model loading to make error messages more accurate
  • Added option to mute program when it is in the background
  • Fixed minor issue in Options dialog page remembering behavior
  • Moved Take Screenshot action to Video menu, now usable using F10 shortcut
  • Reworked fullscreen mode to use the main window instead of a separate window
  • Ensured keyboard shortcuts still work in fullscreen mode
  • Escape no longer closes fullscreen mode, F11 now toggles the mode
This adds all features that were planned for V3 aside from the graphics overhaul. The Linux version is working pretty well aside from the graphical issue mentioned in a previous update so once V3's graphics overhaul is complete the Linux version should also work properly.
Posted 5 months ago2023-11-26 20:22:28 UTC
in How do I override engine (*pfn...) funcs? Post #348099
I don't think you understand how this entire messaging system works. The structure in eiface.h defines the server-engine API, which is a set of functions provided by the engine to the server in a struct when the dll is loaded. This means, you can't modify these function calls, otherwise you'll break the entire API and your mod will be non-functional, possibly crash.

Also SVC_TEMPENTITY is a message that is handled inside the engine, so you cannot modify the contents of TE_TEXTMESSAGE to add your font size parameter: the engine will not understand how to process it. It'll still try to read the message contents as if that new WRITE_SHORT wasn't there.

Also I believe Half-Life's text renderer does not allow for custom font sizes. The font size used to display game texts is of fixed size, and cannot be altered. You'd need to add your own text rendering code to allow for custom font sizes, and you'll need your own client-side message function to send this info to the client.dll.
Posted 5 months ago2023-11-26 20:22:10 UTC
in How do I override engine (*pfn...) funcs? Post #348098
Even if you were able to - you probably shouldn't change pfnMessageBegin, that may break a lot of stuff to do with decals, blood, effects, etc
brannanz brannanzBUGBUG
Posted 5 months ago2023-11-26 19:16:35 UTC
in How do I override engine (*pfn...) funcs? Post #348097
I'm trying to modify the game_text entity to allow for custom font sizes. I implemented the custom parameter fontSize, but the next step is getting the HUD message system to display my text. I was able to find this cryptic-looking code which writes a message to be displayed on the HUD, and implemented my custom parameter:
void UTIL_HudMessage( CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage )
{
    if ( !pEntity || !pEntity->IsNetClient() )
        return;

    MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, pEntity->edict() );
        WRITE_BYTE( TE_TEXTMESSAGE );
        WRITE_BYTE( textparms.channel & 0xFF );

        WRITE_SHORT( FixedSigned16( textparms.x, 1<<13 ) );
        WRITE_SHORT( FixedSigned16( textparms.y, 1<<13 ) );
        WRITE_BYTE( textparms.effect );

        WRITE_BYTE( textparms.r1 );
        WRITE_BYTE( textparms.g1 );
        WRITE_BYTE( textparms.b1 );
        WRITE_BYTE( textparms.a1 );

        WRITE_BYTE( textparms.r2 );
        WRITE_BYTE( textparms.g2 );
        WRITE_BYTE( textparms.b2 );
        WRITE_BYTE( textparms.a2 );

        WRITE_SHORT( FixedUnsigned16( textparms.fadeinTime, 1<<8 ) );
        WRITE_SHORT( FixedUnsigned16( textparms.fadeoutTime, 1<<8 ) );
        WRITE_SHORT( FixedUnsigned16( textparms.holdTime, 1<<8 ) );

        WRITE_SHORT( textparms.fontSize ); // my code

        if ( textparms.effect == 2 )
            WRITE_SHORT( FixedUnsigned16( textparms.fxTime, 1<<8 ) );

        if ( strlen( pMessage ) < 512 )
        {
            WRITE_STRING( pMessage );
        }
        else
        {
            char tmp[512];
            strncpy( tmp, pMessage, 511 );
            tmp[511] = 0;
            WRITE_STRING( tmp );
        }
    MESSAGE_END();
}
I was able to trace the MESSAGE_BEGIN() macro to "enginecallback.h", where the macro is defined to call a function in "eiface.h", which is defined as this:
void (*pfnMessageBegin) (int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);

No matter how hard I looked, though, I couldn't seem to find the body of void pfnMessageBegin(int, int, float, edict_t) that the pfnMessageBegin pointer in "eiface.h" was referencing. How do I change this code to use my custom data?
Seems to be working fine for me. Maybe a config file is overriding the setting?