Forum posts

Posted 1 year ago2023-02-23 18:32:45 UTC
in ZBot implementation for Half-Life 1 Post #347369
Well, my goal was to make it work... and I guess that was the easiest way. I might at some point try to get the bot to read the models from the .db file, but for now that's good enough for me.

I'll focus on adapting the bots to work properly with teamplay and to get the correct colors (temp colors).

Other than that, I think I'm quite happy with them, and I might release them as dll for the original Half-Life. It will not impair you joining other servers and the bots are only server side, and there are no changes on the client, furthermore the singleplayer works with no issues, unlike some of the other bots that outright disable the singleplayer...
Posted 1 year ago2023-02-22 19:25:20 UTC
in ZBot implementation for Half-Life 1 Post #347367
That last suggestion actually worked. Now all the bots use gina.mdl. :)

So the next step is to make them to use random player models. :)

Edit:

Here's the final solution:

#define MAX_SKINS 10

char *bot_skins[MAX_SKINS] =
{
"barney",
"gina",
"gman",
"gordon",
"helmet",
"hgrunt",
"recon",
"robo",
"scientist",
"zombie"
};


bool CHLBotManager::AddBot(const BotProfile *profile)
{
CHLBot *pBot = CreateBot<CHLBot>(profile);
if (pBot == NULL)
{
return false;
}

//int nJoinedTeam;
ClientPutInServer(pBot->edict());
SET_CLIENT_KEY_VALUE(pBot->entindex(), GET_INFO_BUFFER(pBot->edict()), "*bot", "1");

SET_CLIENT_KEY_VALUE(pBot->entindex(), GET_INFO_BUFFER(pBot->edict()), "model", bot_skins[RANDOM_LONG(0, 9)]);

ALERT( at_console, "Added bot %s to server\n", STRING(pBot->pev->netname));
return true;
}

Thanks for your help. :)
Posted 1 year ago2023-02-22 19:17:04 UTC
in ZBot implementation for Half-Life 1 Post #347366
I'll try that. If you find me on Discord, we can continue the chat there, and I can also give you access to the private repository with the compiled code on GitHub (basically I need a Git handle to do that).

You can find me on Discord @ Napoleon#3089
Posted 1 year ago2023-02-22 17:46:24 UTC
in ZBot implementation for Half-Life 1 Post #347364
Hello,

Thank you for replying to this thread.

I already tried to put the value for the player model in the .db file with no success.

If I put this line:

SetModel(TheBotProfiles->GetCustomSkinModelname(profile->GetSkin()));

under 'bool CHLBot::Initialize(const BotProfile *profile)" the game just crashes when I try to add a bot, and there's no error in the logs an in the debugger.

I also tried this suggestion:
SET_CLIENT_KEY_VALUE(<entityindex>, GET_INFO_BUFFER(<edict()>), "model", <modelname>);

I tried it like this:
SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "models/player/gina/gina.mdl");

and this:
SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "gina");
And it did not changed anything, yes the game did not crashed (this time) but the model is still gordon...

Any other ideas?
Posted 1 year ago2023-02-22 10:23:30 UTC
in ZBot implementation for Half-Life 1 Post #347361
Hello Community,

I hope you're doing good.
I've been trying to port the Zbots from the reversed engineered CS DS from here:

https://github.com/FWGS/hlsdk-portable/tree/hlzbot-clean

to Half-Life 1.

I successfully ported the bots to SDK 2.3 (the one from GitHub, note the link above is for Android/Xash). The bots work fine, they don't crash, the waypoints are also generating fine
The main pros for porting them is that the bots are way better of what we already have and they use the weapons, strife, gather items, claimb on ladders... they will actively hunt you... and many more... I even got the bot to fire the nuke on crossfire...

I however have 1 problem, it more of an inconvenience... that a real problems, but still, I taught some of you, or maybe Solokiller... can help me out with this one...

So here's description of the problem that I would like to find solution to:

The bots use just 1 player model: gordon, and I can't make them to use any other model...

So I was looking at the code for the bot profiles:

https://github.com/FWGS/hlsdk-portable/blob/hlzbot-random-weapons/dlls/bot/manager/bot_profile.cpp

It should be able to use the player models in the models/player/ foldesr, if I understand correctly this piece of code:

const char *decoratedName = GetDecoratedSkinName(skinName, filename);
bool skinExists = GetCustomSkinIndex(decoratedName) > 0;
if (m_nextSkin < NumCustomSkins && !skinExists)
{
// decorate the name
m_skins[ m_nextSkin ] = CloneString(decoratedName);

// construct the model filename
m_skinModelnames[ m_nextSkin ] = CloneString(token);
m_skinFilenames[ m_nextSkin ] = new char[ Q_strlen(token) * 2 + Q_strlen("models/player//.mdl") + 1 ];
Q_sprintf(m_skinFilenames[ m_nextSkin ], "models/player/%s/%s.mdl", token, token);
++m_nextSkin;
}

What I don't completely understand is this:

"models/player/%s/%s.mdl"

Does it suppose to load models/player/ <model fodler> / <model_name>.mdl ?

Additionally I have attached the BotProfile.db (as .txt file, it's a simple renamed .txt to .db file). If you look there you can see this:

Link to BotProfile.db: https://www.dropbox.com/s/7fjnxpdatjqtgow/BotProfile.db?dl=0
Link to BotProfile.txt (renamed .db to .txt): https://www.dropbox.com/s/j4qsibu2nmwt7kj/BotProfile.txt?dl=0

//
// All profiles begin with this data and overwrite their own
//
Default
Skill = 50
Aggression = 50
ReactionTime = 0.3
AttackDelay = 0
Teamwork = 75
WeaponPreference = none
Cost = 0
Difficulty = NORMAL
VoicePitch = 100
Skin = 0
End

//----------------------------------------------------------------------------

This is supposed to be responsible for the Default bot profile, and the others are created as derivates from it... but the question is... How to specify the player model?

Any help on this one would be greatly appreciated.

Thanks.
Posted 2 years ago2022-07-02 08:04:00 UTC
in Transparent .tga files for Half-Life 1? Post #346694
Hello community!

I hope you're doing good. I have a question that I can not find the solution to... and maybe you can help me out, or maybe there is already a tutorial about that I have missed?

I'm trying to make transparent (see trough) .tga file for Half-Life mod's UI, you know the files located under "resource" folder called "game_menu.tga" and "game_menu_mouseover.tga" those are used for showing your mod's logo, and the same logo when you mouse over it.

The question is how to achieve the same effect with the files...

Any help would be greatly appreciated.
Posted 2 years ago2022-05-26 08:36:41 UTC
in Submodels change when monster performs action Post #346552
I have seen this in Half-Life Extended SDK located here:

https://github.com/bacontsu/halflife-extended/tree/main/source-code
I have no idea how to do this using Blender... however you can do it using MilkShape 3D... I even wrote a tutorial about it.

https://www.moddb.com/mods/flatlinea/tutorials/skeleton-hacking-swapping-for-half-life

There is an even easier way to do it, it's combination of MilkShape3d and notepad++ (but even taught it's easier, it requires more explaining; but I think you can figure it out by checking the link I gave).
Any chance this can compile under Linux?