FortyTwoFortyTwo / Randomizer

TF2 plugin that randomizes player loadout in any imaginable combinations
GNU General Public License v3.0
35 stars 15 forks source link

Add multiple weapons support #74

Closed FortyTwoFortyTwo closed 2 years ago

FortyTwoFortyTwo commented 2 years ago

Well this is a big change.

Added new convar randomizer_weaponscount that gives player amount of weapons regardless of slot, and updated randomizer_huds where 2 shows menu for list of weapons, recommended to use this along with randomizer_weaponscount.

Added new commands sm_rndsetweapon, sm_rndsetslotweapon and sm_rndgiveweapon which allows giving multiple weapons in 1 commands and support using weapon's name instead of just needing def index.

There is a lot of weapons that share same client netrop (#7), this is resolved by having properties.sp storing values for each weapons, update from whatever function hooks, and having client's netprop value as active weapon. Currently m_iAmmo (replaces ammo.sp), m_flRageMeter (replaces ragemeter.sp), m_iDecapitations, m_iRevengeCrits and m_flItemChargeMeter uses this system and more properties can be used on this.

huds.cfg is updated to have new entity value client-seperate that obtains value from properties.sp. weapons.cfg is updated to only have section AllClass and DefaultClass instead of each slots. AllClass lists weapons that can be selected randomly, DefaultClass lists weapons that can only be selected by default class (only PDA weapons use this).

This change will open a lot of bugs on specific weapons not working when there multiple weapons, but main gameplay should work fine. Small bugs can be fixed later on.