peace-maker/botmimic

Plugin not saving equipped grenades

moismailzai opened this issue · 2 comments

Great plugin and extremely useful for demonstrating or practicing against set smokes and flashes. That being said, the plugin does not save the grenades in player loadout and ignores mp_ct_default_grenades and mp_t_default_grenades values. This means that if I record myself throwing a specific smoke/flash/grenade/molly/decoy, all the movement data is saved, but when I try to get a bot to mimic my recorded movements, the bot is spawned without the appropriate grenades and is therefore unable to replicate my behaviour. The workaround I'm currently using is to drop the appropriate grenades in the bot's path: I select a spot on the ground before recording, this is the spot I will drop grenades on using 'give weapon_flashbang'. Next, I begin recording, walk over to my 'drop spot', then switch to the appropriate grenade, then execute my recording and save it. Once I begin playback, I watch the bot spawn, walk over to the area with the grenades I dropped, they are now loaded into the bot's inventory and the bot successfully switches to the appropriate grenade. This method is tedious and messy, however, as I need to spawn one grenade per bot cylce (each time the bot picks up a grenade, it is consumed). What's interesting is that when I set the mp_t_default_grenades or mp_ct_default_grenades values, I can visually see the bot spawn with a full set of grenades, but unless it picks up the necessary grenade for the recording, it is unable to use the ones it spawns with through the CVARs. So while the plugin is capable of elegantly executing grenade tosses, it does not save the player's grenade inventory to the recording and it ignores default inventory CVAR values. Since the hard part is already being done (recording the movements) I'm hoping this could be fixed with a few lines of code?

I haven't tested this extensively in CS:GO. The bot gets his grenade just fine in CS:S.
All weapons are stripped on spawn and only the one the player had active at the time is added. When a player changes his weapon while he's recording the bot is given that new weapon, if he doesn't have it already.

Just compiled the new files and installed - can confirm this is working perfectly on CSGO now. Thanks!