source-sdk-2013
source-sdk-2013 copied to clipboard
Expose NextBotVisionInterface to VScript
The VScript API has a few functions for getting various bot interfaces, however only GetLocomotionInterface was actually correctly exposed, and ILocomotion is the only class that exists in the root table with any existing functions. This means GetVisionInterface, GetIntentionInterface, and GetBodyInterface are currently useless.
While it would be nice to have all of the other interfaces exposed, IVision is, in my opinion, the most valuable one to have.
I've also attached an example vscript file to test all of the vision interface functions:
- save file to tf/scripts/vscripts and change the extension from .txt to .nut
- load any mvm map (mvm_decoy has no delay before bots start spawning)
- uncomment a bot.GetScriptScope().ThreatThink function, change values as necessary to test
-
script_execute visiontestin console - start the wave (can skip the 10s timer with
mp_restartgame_immediate 1) -
tf_mvm_jump_to_wave 1; ent_fire "player" "TerminateScriptScope"to reset and kill the think function on the bots - comment out the confirmed working think function and uncomment another one
- repeat