Talking bots: Difference between revisions

From MyGamingTalk
m (1 revision imported)
 
 
(One intermediate revision by the same user not shown)
Line 104: Line 104:
global Map =
global Map =
{
{
Radar_Destroyed = function( trigger )
Radar_Destroyed = function()
{
{
Util.BotChat(TEAM.AXIS, "say", "Pesky Allies", 1);
Util.BotChat(TEAM.AXIS, "say", "Pesky Allies", 1);


Line 121: Line 120:
global Map =
global Map =
{
{
Radar_Destroyed = function( trigger )
Radar_Destroyed = function()
{
{
Util.BotChat(TEAM.ALLIES, "sayteam", "ok lets get the doc's now", 1);
Util.BotChat(TEAM.ALLIES, "sayteam", "ok lets get the doc's now", 1);


Line 138: Line 136:
global Map =
global Map =
{
{
Axis_Break_Something = function( trigger )
Axis_Break_Something = function()
{
{
 
Util.BotChat(TEAM.AXIS, "vsay", VOICE.G_CHEER, 2);
Util.BotChat(TEAM.ALLIES, "vsay", VOICE.G_NEGATIVE, 2);
                Util.BotChat(TEAM.AXIS, "vsay", VOICE.G_CHEER, 2);
                Util.BotChat(TEAM.ALLIES, "vsay", VOICE.G_NEGATIVE, 2);


Util.MapDebugPrint( "Axis_Break_Something" );
Util.MapDebugPrint( "Axis_Break_Something" );
Line 157: Line 153:
global Map =
global Map =
{
{
Allies_win = function( trigger )
Allies_win = function()
{
{
ETUtil.WinningChat( TEAM.ALLIES );   
ETUtil.WinningChat( TEAM.ALLIES );   
ETUtil.LosingChat( TEAM.AXIS );   
ETUtil.LosingChat( TEAM.AXIS );   

Latest revision as of 14:18, 16 May 2025

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()
	{
		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()
	{
		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()
	{
		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()
	{
		ETUtil.WinningChat( TEAM.ALLIES );  
		ETUtil.LosingChat( TEAM.AXIS );  

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