HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- Zbot implementation in Half-Life 1 (https://hlfx.ru/forum/showthread.php?threadid=5938)
Отправлено Napoleon321 04-02-2023 в 13:56:
Zbot implementation in Half-Life 1
Hello Community.
I hope you're doing good. I have a question, that might sound stupid.. never the less... I'll ask.
Is it possible to implement the reverce engineered Zbot from CS to Half-Life 1?
Here's the repository:
https://github.com/s1lentq/ReGameDL...amedll/dlls/bot
Thanks in advanced.
__________________
FlatLine Arena | Tutorials
If you don't like something, MOD it!
Отправлено Ku2zoff 06-02-2023 в 12:09:
https://github.com/FWGS/hlsdk-porta...ee/hlzbot-clean
https://github.com/FWGS/hlsdk-porta...-random-weapons
Отправлено Napoleon321 07-02-2023 в 22:02:
Sweet. I was not aware this was done. Thanks, I hope I can pull it out. 
__________________
FlatLine Arena | Tutorials
If you don't like something, MOD it!
Отправлено Napoleon321 21-02-2023 в 22:03:
Ok, I managed to port them to the HL SDK 2.3, there were few stopping points as the bot code used deprecated functions since 2005... and until I figured out what was wrong with it.. It took me some time...
Now, I noticed that the bots are quite aggressive, but that's good. I see that I can use the BotProfile.db files from Condition Zero to manipulate the behavior of the bots... the question is how can I make the bots to use different skins?
At the moment they are all joining with "gordon" player model... and that's a bit odd... I opened the db file (it's text file) and I don't see anything that resembles the player model name or path...
Any help would be appreciated.
__________________
FlatLine Arena | Tutorials
If you don't like something, MOD it!
Отправлено Napoleon321 22-02-2023 в 10:06:
Here are a little more details:
So I was looking at the code for the bot profiles:
https://github.com/FWGS/hlsdk-porta...bot_profile.cpp
It should be able to use the player models in the models/player folder, if I understand correctly this piece of code:
C++ Source Code:
1 | const char *decoratedName = GetDecoratedSkinName(skinName, filename); |
2 | bool skinExists = GetCustomSkinIndex(decoratedName) > 0; |
3 | if (m_nextSkin < NumCustomSkins && !skinExists) |
6 | m_skins[ m_nextSkin ] = CloneString(decoratedName); |
8 | // construct the model filename |
9 | m_skinModelnames[ m_nextSkin ] = CloneString(token); |
10 | m_skinFilenames[ m_nextSkin ] = new char[ Q_strlen(token) * 2 + Q_strlen("models/player//.mdl") + 1 ]; |
11 | Q_sprintf(m_skinFilenames[ m_nextSkin ], "models/player/%s/%s.mdl", token, token); |
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 ?
Aditionally 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:
C++ Source Code:
2 | // All profiles begin with this data and overwrite their own |
10 | WeaponPreference = none |
17 | //---------------------------------------------------------------------------- |
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.__________________
FlatLine Arena | Tutorials
If you don't like something, MOD it!
Отправлено Napoleon321 22-02-2023 в 19:54:
Hello, This is fixed btw.
The bot didn't had logic for calling the change of the player models.
And the fix was trivial...
C++ Source Code:
3 | char *bot_skins[MAX_SKINS] = |
Then under:
C++ Source Code:
bool CHLBotManager::AddBot(const BotProfile *profile) |
This line to utilize the models we defined:
C++ Source Code:
SET_CLIENT_KEY_VALUE(pBot->entindex(), GET_INFO_BUFFER(pBot->edict()), "model", bot_skins[RANDOM_LONG(0, 9)]); |
Side note: I think the author of a post, should be allowed to edit his own post... Look at me for example... I have 3 posts that could have been just 1...__________________
FlatLine Arena | Tutorials
If you don't like something, MOD it!
Отправлено [CFR] B@N@N 25-02-2023 в 18:02:
Any videos how this bot works in HL?
Отправлено Napoleon321 08-03-2023 в 13:03:
Well here's a video of the bots in action on crossfire.
https://www.youtube.com/watch?v=g2tQuDFi7WM
Don't expect miracles, but still.
__________________
FlatLine Arena | Tutorials
If you don't like something, MOD it!