nosoop / rcbot2

A Metamod:Source plugin that provides customizable bot players.
http://rcbot.bots-united.com
GNU Affero General Public License v3.0
5 stars 0 forks source link

Call BotPutInServer instead of invoking the bot CCommand #2

Closed nosoop closed 5 years ago

nosoop commented 5 years ago

This is what the bot command calls internally, and returns an CSDKPlayer*. Avoids hacking around with invoking server commands.

Implementations are mod-specific; TF2 uses the following prototype:

CTFPlayer *
BotPutInServer(bool bTargetDummy,bool bFrozen,int desiredTeam,int desiredClass,char *name);

Other games might have similar functions, which may be worth looking into.

nosoop commented 5 years ago

Turns out g_pBotManager is already a supported thing; probably just had to get the plugin built against the game-specific SDK for it to work.