Difference between revisions of "AddBot"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "<onlyinclude> Adds a bot to the game, with the given name. Returns a reference to the bot's CPlayer object. </onlyinclude> <syntaxhighlight lang="cpp"> CPlayer@ AddBot( const...")
 
(No difference)

Latest revision as of 17:06, 10 September 2012

Adds a bot to the game, with the given name. Returns a reference to the bot's CPlayer object.

CPlayer@ AddBot( const string &name )

Usage example, in which saying '!bot' in the chat will cause a bot called Henry to be created:

void ProcessChat( CRules@ this, string text, CPlayer@ player ) 
if (text == "!bot")
{
  CPlayer@ bot = AddBot( "Henry" );
}