News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - nategherkin

#1
I'm trying to figure out how to give a player a weapon after they reach a certain amount of kills. And once the custom frag limit has been reached, the game is done.

After looking at the source code, I found 2 Give functions that seem to give the player the weapons (in Player.cpp),

This give:
     bool idInventory::Give( idPlayer *owner, const idDict &spawnArgs, const char *statname, const char *value, int *idealWeapon, bool updateHud, bool dropped, bool checkOnly )

and
     bool idPlayer::Give( const char *statname, const char *value, bool dropped )

And I also found fragCount in MultiplayerGame.cpp, but I'm not sure that this is even the variable used to count kills.

Questions
*How do I use the fragCount variable when it's in a different cpp file and it's a typedef struct? I tried #include "MultiPlayer.h" which gave me a plethora of errors.
*Once I figure that I out, what parameters should I be passing? The first Give makes more sense since there is a pointer to the player, but there are other parameters I am not sure about.
*Lastly, is there a way to modify the frag limit without user input? The default is 10 but I want to change it to a higher number.

Thanks.