Talking bots
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
<syntaxhighlight lang="java"> Util.BotChat (Team, msgType, Msg, NumBots)</syntaxhighlight>
Team:
<syntaxhighlight lang="java">"TEAM.ALLIES" / "TEAM.AXIS" / "0" </syntaxhighlight>
MsgTypes:
<syntaxhighlight lang="java">"say", "sayteam", "vsay"</syntaxhighlight>
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:
<syntaxhighlight lang="java">"TEAM.ALLIES" / "TEAM.AXIS" / "0" </syntaxhighlight>
Example :
<syntaxhighlight lang="java">ETUtil.WinningChat( TEAM.ALLIES );</syntaxhighlight>
ETUtil.LosingChat
Team:
<syntaxhighlight lang="java">"TEAM.ALLIES" / "TEAM.AXIS" / "0" </syntaxhighlight>
Example :
<syntaxhighlight lang="java">ETUtil.LosingChat( TEAM.AXIS );</syntaxhighlight>
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
<syntaxhighlight lang="java">
global Map =
{
Radar_Destroyed = function( trigger )
{
Util.BotChat(TEAM.AXIS, "say", "Pesky Allies", 1);
Util.MapDebugPrint( "Radar_Destroyed" ); }, }; </syntaxhighlight>
One Allied bot saying a plain text message to team.
<syntaxhighlight lang="java">
global Map =
{
Radar_Destroyed = function( trigger )
{
Util.BotChat(TEAM.ALLIES, "sayteam", "ok lets get the doc's now", 1);
Util.MapDebugPrint( "Radar_Destroyed" ); }, }; </syntaxhighlight>
Two bots for both teams saying a voicechat command.
<syntaxhighlight lang="java">
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" ); }, }; </syntaxhighlight>
Example for end of a map where the bots Cheer/Say no
<syntaxhighlight lang="java"> global Map = { Allies_win = function( trigger ) {
ETUtil.WinningChat( TEAM.ALLIES );
ETUtil.LosingChat( TEAM.AXIS );
Util.MapDebugPrint( "Allies_win" ); }, }; </syntaxhighlight>