View Single Post
Author Message
Timiditas
Senior Member
Join Date: Apr 2009
Old 06-01-2010 , 10:22   Ace Bot Taunt:SM (v1.2.1) with renaming and quota manager
Reply With Quote #1

_
This is a SourceMod-conversion of the EventScripts addon ace_botchat with kind permission from Phil Pendlebury,
using part of es_ace_fakebots

Original scripts (botchat, fakebots) and replies written by Phil Pendlebury - aka - Ace Rimmer and is available at: http://www.pendlebury.biz/acerimmer/

Faked Chatmessages code (stock PrintGameChatMessage) taken from
'DeadChat' -> http://forums.alliedmods.net/showthread.php?p=651748
with kind permission from Greyscale

What it does:

Basically it will force BOTs to speak randomly when certain events happen,
and it renames bots when they join, using a list of names that you provide.

(deadchat cvar added, rcon_lock incompatibility fixed)

Put
sm_bot_replies_db.txt
sm_bot_fakebotnames_db.txt
to cstrike/addons/sourcemod/configs/
botchat.phrases.txt
to translations

Plugin will create sm_ace_botchat.cfg in cstrike/cfg/sourcemod on first run
which has:
Code:
// Block bot connected message
// -
// Default: "0"
sm_ace_botchat_block_connect "0"

// Block bot disconnected message
// -
// Default: "0"
sm_ace_botchat_block_disconnect "0"

// Block bot changed name message
// -
// Default: "1"
sm_ace_botchat_block_namechange "1"

// Block bot/unconnected changed team message
// -
// Default: "1"
sm_ace_botchat_block_team "1"

// Living players see dead bots chat
// -
// Default: "1"
sm_ace_botchat_bot_deadchat "1"

// BOTS WILL ALSO RESPOND TO PLAYER CHAT?
// -
// Default: "1"
sm_ace_botchat_bot_say_replies "1"

// Chance of bots commenting events. Set to 1 to make them respond every kill etc. or higher number for less responses. Use default(-1) to have it set to double the bot count automatically
// -
// Default: "-1"
sm_ace_botchat_chance_of_chat "-1"


// sm_ace_botchat_enable REMOVED
// just unload the plugin if you don't need it


// Use name list to rename bots
// -
// Default: "1"
sm_ace_botchat_rename_bots "1"

// Manage bot quota in running rounds/neverending rounds
// (Experimental. Might not work as you expect/work at all)
// Default: "0"
sm_ace_botchat_deathmatch_control "0"
At the moment the events are:

Code:
Player Death (various different types  of death) -
 headshot
 knife
 TK
 grenade
 suicide

Bomb  Exploded
Bomb Defused
Hostage Killed (chat from killing bot)
Hostage Killed (chat from other bots)

Item Pickup (only starts 5 seconds after spawn) <-- blocking this for 5secs should work now

Blinded
  Bomb Planted
 Bomb Pickup
 Hostage Follows
 Hostage Stops  Following

On connect -
 greeting from BOT when join
  greeting to new players from BOT

Player chat (you can add any  word)
I might add more events if they are requested.

Editing the replies.db
For examples, take a look at the included replies file.
Code:
//Original script and replies written by Phil Pendlebury - aka - Ace Rimmer and is available at: http://www.pendlebury.biz/acerimmer/
//
//Use a texteditor that supports UTF-8 encoding
//Instead of using ES 'event_var()', use '{tags}'.

//Supported {tags} :
// supported NAME tags are currently: {attacker} {victim}
// {section} will replace the tag by the section name. see example near end of this file

// if a tag is not supported in a specific event (e.g. {victim} in bomb planted) it is simply deleted from the reply

// add "teamonly" "1" or "0" below "count" for a generic setting for that section
// if you omit the "teamonly" entry, the whole section is considered to be alltalk
// add {talkteam} or {talkall} in front of a specific reply to override a generic section setting

// "link", "teamonly", {section}, {talkteam} and {talkall} is supported in every section
// use "link" "sectionname" to use the same replies for multiple keywords. see example at the end of this file
// {section} will use the LINKING sections name if used in links (see example near end of this file)
// *************************************EVENTLIST************************************************************************************
// [EventName]                  -    Supported name tags    -    Description (Name of ?)
// -------------------------------------------------------------------------------------------------
// blinded                      -                     - none
// hostagekilled                - {attacker}          - the talking bot that killed the hostage
// hostagekilledother           - {attacker} {victim} - attacker = the PLAYER/BOT that killed the hostage, victim = the talking bot
// hostagestops                 -                     - none
// hostagefollows               -                     - none
// bombdefused                  -                     - none
// bombplanted                  -                     - none
// bombexploded                 -                     - none
// bombpickup                   -                     - none
// itempickup                   -                     - none
// normaldeath                  - {attacker} {victim} -
// headshotdeath                - {attacker} {victim} -
// knifedeath                   - {attacker} {victim} -
// nadedeath                    - {attacker} {victim} -
// tkdeath                      - {attacker} {victim} -
// suicidedeath                 - {attacker} {victim} -
// normalkill                   - {attacker} {victim} -
// headshotkill                 - {attacker} {victim} -
// knifekill                    - {attacker} {victim} -
// nadekill                     - {attacker} {victim} -
// tkkill                       - {attacker} {victim} -
// greetings                    - {attacker}          - bot will say this when he joins - attacker = his own name
// playerconnect                - {attacker} {victim} - bots will say this to a new player - attacker = talking bot - victim = joining player

// any additional chat keyword  - {victim} {attacker} - victim = chatting player/bot - attacker = answering bot

// you could theoretically simply take your original replies.db from the ES-plugin
// and run a search&replace in your favourite utf-8 capable text editor for:
// event_var(es_username) ----to----> {victim}
// event_var(es_attackername) ----to----> {attacker}
Added "links" and an additional {tag} called {section}.
Code:
   "hacker"
   {
      "count" "19"
      "1" "I never hack"
      "2" "It's part of the game"
   }
  
  "haxor"
   {
            //if someone types "haxor", bot will use the same replies as in 'hacker'. additional replies in THIS (haxor) section are ignored
            //"teamonly" in linked sections is always completely ignored, which means if you link to a teamonly section and want it to stay
            //that way, you have to specify teamonly 1 in the linking section as well
      "link"    "hacker"
   }
  
    "rank"
    {
    "count" "18"
    "1" "{section}, {section} always {section}..."
    "2" "Stop typing {section} and play the game ffs!"
    "3" "{victim} your RANK is still CRAP no matter how many times you check it"
    }
    "top"
    {
        "link"    "rank"
    }
    //see how top is linked to rank. look at the first reply. when someone types rank, the bot says: "rank, rank always rank..."
    //when someone types "top" instead, the bot would say: "top, top always top..."
    //the need for the {section} tag arose after introducing the links which wouldn't have made any sense without them

Servertime tag example:


It is {servertime}. I am severly tired!
Result: It is 225. I am severly tired!

You can add different formats by adding a colon and a time format string:

Shit, I LOVE {servertime:%As! %I%p} and drunk already...
Result: Shit, I LOVE Tuesdays! 06PM and drunk already...
Shit, I LOVE {servertime:%A}s! {servertime:%I%p} and drunk already...
would yield the same result.

See this URL for valid parameters: http://cplusplus.com/reference/clibr.../strftime.html

Map tags:
{mapminutesleft}, {mapname}
Example (given the current maps name is gg_aim_simpsons_green_v2):
THANK GOD! Only {mapminutesleft} minutes left! I freaking HATE {mapname}!
Result: THANK GOD! Only 2 minutes left! I freaking HATE simpsons_green!

(As you can see, any substring smaller than four chars is stripped out of the mapname.)



There is also an additional admin command -
botchat_say
which can be triggered through console or also by chat if you use
the preceding forward slash /botchat_say
Usage:
botchat_say "quoted text if contains whitespace" <botname/id> (if you omit botname/id, a random bot is selected to say your text)
if you type !botchat_say or /botchat_say into the chat, omitting all arguments, it will
open a menu listing all bot names. select one (closing menu) THEN then next thing you type into the chat will be said by
the selected bot. this function supports the {talkteam} tag to make the bot use teamchat instead allchat.
you can also type {botchat_cancel} to abort

Using Bot-Namelist
You can either use your namelist from ace_fakebots eventscripts addon directly by putting it in sourcemod/configs and rename it to:
sm_bot_fakebotnames_db.txt
Or if you want to create one from scratch, you can also use a simple list with every name line by line instead of a KV-file.
In that case, use the filename: sm_bot_fakebotnames_db_plain.txt

If there are not enough names on the list, newly spawned bots will start to use vanilla names again until some bots with new names leave.


v1.2.1 fixed sourceTV fakeclient talking randomly
Attached Files
File Type: txt botchat.phrases.txt (741 Bytes, 1548 views)
File Type: txt sm_bot_fakebotnames_db.txt (797 Bytes, 1597 views)
File Type: txt sm_bot_replies_db.txt (23.9 KB, 1573 views)
File Type: sp Get Plugin or Get Source (ace_botchat.sp - 2920 views - 39.9 KB)
__________________


Last edited by Timiditas; 07-03-2010 at 06:00.
Timiditas is offline