Talking bots

From MyGamingTalk
Omni-Bot_Map_Scripting Talking Bots


Before you make the bots talk

Be aware that bots talking too much can annoy players so please be sensible when using this command.

Forward

In previous versions of omni-bot the normal way to make the bots talk was to set up a random number & depending on the number the bots would talk.


In 0.81, a Three new commands were added to get rid of the old commands need to use a random number to define the number of bots that would talk.

 Util.BotSay
 ETUtil.WinningChat
 ETUtil.LosingChat

Usage

Util.BotChat

 
Util.BotChat (Team, msgType, Msg, NumBots)


Team:


"TEAM.ALLIES" / "TEAM.AXIS" / "0"


MsgTypes:


"say", "sayteam", "vsay"


Msg:


For say/sayteam this is just plain text. For vsay this must be one of the voicechat commands defined on the Voice page


NumBots :


The number of bots that will speak. Please do not set to a high number.

ETUtil.WinningChat

Team:


"TEAM.ALLIES" / "TEAM.AXIS" / "0"

Example :


ETUtil.WinningChat( TEAM.ALLIES );


ETUtil.LosingChat

Team:


"TEAM.ALLIES" / "TEAM.AXIS" / "0"

Example :


ETUtil.LosingChat( TEAM.AXIS );


Notes

There is no longer the need to add "Talk = true," remove this line if you are using the new command on an old script.


Wether or not the bots talk is defined in ~omni-bot\et\scripts\et_autoexec.gm Default is this global MAP_TALK = true; If this line is set to false the bots will not talk


Scripting

One Axis bot saying a plain text message to all players


global Map =
{
	Radar_Destroyed = function( trigger )
	{

		Util.BotChat(TEAM.AXIS, "say", "Pesky Allies", 1);

		Util.MapDebugPrint( "Radar_Destroyed" );
	},
};


One Allied bot saying a plain text message to team.


global Map =
{
	Radar_Destroyed = function( trigger )
	{

		Util.BotChat(TEAM.ALLIES, "sayteam", "ok lets get the doc's now", 1);

		Util.MapDebugPrint( "Radar_Destroyed" );
	},
};


Two bots for both teams saying a voicechat command.


global Map =
{
	Axis_Break_Something = function( trigger )
	{

		
                Util.BotChat(TEAM.AXIS, "vsay", VOICE.G_CHEER, 2);
                Util.BotChat(TEAM.ALLIES, "vsay", VOICE.G_NEGATIVE, 2);

		Util.MapDebugPrint( "Axis_Break_Something" );
	},
};


Example for end of a map where the bots Cheer/Say no

 
global Map =
{
	Allies_win = function( trigger )
	{

		
		ETUtil.WinningChat( TEAM.ALLIES );  
		ETUtil.LosingChat( TEAM.AXIS );  

		Util.MapDebugPrint( "Allies_win" );
	},
};