HLFX.Ru Forum
Показать все 1 сообщений этой темы на одной странице

HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- How to properly add new ammo type? (https://hlfx.ru/forum/showthread.php?threadid=5966)


Отправлено Napoleon321 29-03-2023 в 20:31:

Talking How to properly add new ammo type?

Hello Team,

I have a question, that you might be able to help with...

I'm trying to add new ammo type to a weapon. All compiles fine with no errors. However when I load the game the weapon in question does not render the ammo in the HUD...

Do we have a limit of how many ammo types we can have in Half-Life? It turns out the answer is yes... sort of

Code wise I have added the ammo in client.cpp under "if ( sendweapons )" and in hl_weapons.cpp on two places:

player.ammo_newammo = (int)from->client.vuser3[0];

and

to->client.vuser3[0] = player.ammo_newammo;

Under player.cpp under "void CBasePlayer::TabulateAmmo()"

I also have it added:

ammo_newammo = AmmoInventory( GetAmmoIndex( "newammo" ) );

And in weapon_name.txt I have a line for the sprite to be used... but no luck on this...

So after some digging around and a nudge from a friend, I got it figured out...
Somehow, I got above the limit defined of 32 ammo types... I counted and counted and I for sure has 23 defined... but that's another story I guess...

dlls\cdll_dll.h

change this:

code:
#define MAX_AMMO_TYPES 32 // ??? #define MAX_AMMO_SLOTS 32 // not really slots


to this

code:
#define MAX_AMMO_TYPES 64 // ??? #define MAX_AMMO_SLOTS 64 // not really slots


Maybe you can go with bigger number here, but still, not sure how the weapon prediction system will handle it...

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!


Временная зона GMT. Текущее время 07:04.
Показать все 1 сообщений этой темы на одной странице

На основе vBulletin версии 2.3.0
Авторское право © Jelsoft Enterprises Limited 2000 - 2002.
Дизайн и программирование: Crystice Softworks © 2005 - 2024