How to apply TF2 Conditions to bots in MvM

team-fortress-2tf2-mann-vs-machine

I'm creating a custom population (.pop) file for Mann vs Machine, and want to be able to apply condition codes (like the TF2_AddCondition function, or the addcond cheat command) to a specific bot when it arrives.

Some examples of what I'm trying to accomplish:

  • Upon arrival, a bot has 100% Critical Hit chance for 30 seconds. (TFCond_CritOnDamage)
  • Or: Upon spawning, coat this bot in Mad Milk (TFCond_Milked) for infinite duration. (That would mean that all attacks against this bot return health to the attacker.)

The .pop files have support for event triggers eg StartWaveOutput, but the documentation is virtually nonexistent.

Does anyone know how I can apply TF2 Conditions to bots in MvM?

Best Answer

You can't do this with population files alone on a vanilla (unmodded) TF2 server.

If you are open to hosting a dedicated server on a Linux machine, you can achieve this using sigsegv's SourceMod extensions. You will, of course, first need to install SourceMod. Then, you can use sigsegv's addcond syntax to do exactly what you want:

TFBot
{
    // ...
    AddCond [$SIGSEGV]
    {
        Index 27 // Mad Milk
        // No Duration = lasts forever
    }

    AddCond [$SIGSEGV]
    {
        Index 56 // Misc. Crit Boost
        Duration 30.0
    }
}

While parts of sigsegv's extensions work on Windows, I don't believe the TFBot extensions do, so you're out of luck in case you can't use Linux.