Author Topic: Giving the player weapons after certain amount of kills. And modify frag limit.  (Read 1227 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
  • Doom Newbie
    • View Profile
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 )

     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.

*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.



  • Hero Member
  • *****
  • Posts: 1,094
  • Karma: +78/-134
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Ideally, you need to implement monsters killed counter (unless already implemented) and expose it to script. The rest is easy.