I have been awake too many hours and cant seem to wrap my head around this or find any info on google.
So I have a pretty simple question.
Is there a line of code/function I can add to my custom weaponbase that extends UTWeapon that will check if the weapon has been fired and
increment up an integer variable that is stored in the Player Controller?
I know it seems silly, and I am feeling really silly for asking this question as it seems it must be very simple..
I.E. WeaponBase.uc
The purpose is for counting total shots with each weapon and keeping each BulletsFired integer variable unique to each weapon class to be used for stats tracking. Regardless if the player switched weapons and has equipped the weapon again to fire more shots.The effect will still increment the same "total" value over the entire game
PlayerController.uc
Is there a better way to do this?
Any help would be greatly appreciated.
-Chris
So I have a pretty simple question.
Is there a line of code/function I can add to my custom weaponbase that extends UTWeapon that will check if the weapon has been fired and
increment up an integer variable that is stored in the Player Controller?
I know it seems silly, and I am feeling really silly for asking this question as it seems it must be very simple..
I.E. WeaponBase.uc
Code:
//If player fired this weapon,increment M1911BulletsFired by 1 M1911BulletsFired++;
PlayerController.uc
Code:
var int M1911BulletsFired; var int AK47BulletsFired; var int ShotgunBulletsFired; `log("Number of M1911 Bullets Fired: " @ M1911BulletsFired); `log("Number of AK47 Bullets Fired: " @ AK47BulletsFired); `log("Number of Shotgun Bullets Fired: " @ ShotgunBulletsFired);
Any help would be greatly appreciated.
-Chris
Comment