ineedbots / iw5_bot_warfare

The Bot Warfare mod for MW3
https://www.moddb.com/mods/bot-warfare
114 stars 29 forks source link

Set bots difficulty based on the bots name. #87

Closed TheOreoSlayer closed 1 year ago

TheOreoSlayer commented 1 year ago

I was wondering for any feedback if you think this code would work for assigning a case difficulty to a bot depending on the bots name. Any feed back would be appreciated.

main() { level thread botDifficultySetter(); }

botDifficultySetter() { while(1) { level waittill("connected", player); if(player.bot) { if(player.bot.name == "LessMellow") { player.bot.difficulty = 4; } else if(player.bot.name == "VeganLettuce") { player.bot.difficulty = 5; } else if(player.bot.name == "Mattererla") { player.bot.difficulty = 6; } else if(player.bot.name == "SuckKallis") { player.bot.difficulty = 7; } else { player.bot.difficulty = randomIntRange(4, 7); } } } }

        // update bot's skill cvar
        self setClientDvar( "bot_skill", self.pers["bots"]["skill"]["base"] );
    }

    wait 0.1;
}

}