IPB

Welcome Guest ( Log In | Register )

2 Pages V  1 2 >  
Reply to this topicStart new topic
> All bots are named RCBot, How can I rename my bots?
phenrol
post Jan 28 2014, 03:18 AM
Post #1


Newbie
*

Group: Members
Posts: 8
Joined: 28-January 14
Member No.: 2,322



Hello,

I have RCbot2 working on my DOD:S linux server and I can spawn functioning bots, however, all of them are named "RCBot", which is rather annoying.

I have tried messing with the profiles, and the server reads them in just fine as indicated by the startup output when the plugin is loading, however, anything I do with these does not seem to change anything.

I can individually set their name using sm_rename, but that is a pain.

can anyone help me with this issue?

Thanks
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
madmax2
post Jan 28 2014, 09:40 AM
Post #2


RCBot Guru
*****

Group: Waypointers
Posts: 957
Joined: 2-March 12
From: USA, WA state
Member No.: 2,162



Welcome to the RCbot forums...

When I rename my profiles folder to something else, thats exactly what I get, all bots have the same name, RCbot. rcbot program also makes an empty profiles folder in my rcbot2 folder which is in my \documents and settings\username folder (winXP). For some reason the rcbot program is not finding or loading your profiles. Make sure your profiles folder is inside the rcbot2 folder and the rcbot2 folder is in the correct location for the .SO that you are using. If this doesn't help, post a few more details about where you have the rcbot2 folder installed, and maybe which rcbot2 .SO you are using. I won't be much help on linux, but maybe someone can help? wink.gif

Tip: try searching your hard drive for an empty profiles folder, it will likely be in a mostly empty rcbot2 folder, a second rcbot2 folder, this is where it might be looking for the profiles?

madmax2
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
genmac
post Jan 28 2014, 09:43 AM
Post #3


RCBot Guru
*****

Group: Waypointers
Posts: 571
Joined: 11-November 11
Member No.: 2,098



probably a bug on the linux compile.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
phenrol
post Jan 29 2014, 05:28 AM
Post #4


Newbie
*

Group: Members
Posts: 8
Joined: 28-January 14
Member No.: 2,322



Thanks for the replies.

The profiles do in fact load when the plugin is instantiated. I see the output on the server console showing it loading each one. I have verified this by removing all but 8 profile files from the profiles directory within the rcbot2 folder housed in my home folder on the server (i.e. /home/[user]/rcbot2/profiles), then reloading rcbot2 in the server console and watching the output. It definitely changed from reading all 32 original profile files to only reading in the 8 I left in the folder.

What bug in the linux build could cause this? Is it a bug or just something about how the profiles are loaded (a configuration problem) perhaps?

Any and all help is appreciated.

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
madmax2
post Jan 29 2014, 10:19 PM
Post #5


RCBot Guru
*****

Group: Waypointers
Posts: 957
Joined: 2-March 12
From: USA, WA state
Member No.: 2,162



Seems to me this was posted someplace before, so I did some searching, couldn't find exactly what I was looking for, but I found this for TF2. Have you tried this? "rcbotd control" may help?

http://rcbot.bots-united.com/forums/index....post&p=8878

Maybe change blue/red to axis/allies

I'm not sure if this will work for dod:s, as "rcbot help control" returns no help info in the console, guess I should just try it & see what happens... I can't find any specifics on this command in the forums yet? unsure.gif

So if I understand correctly, the server output/console shows the correct bot names from the profiles? Does it show which bot ini's are loading, cause mine doesn't...

dedi may be different, but on listen, my console only shows this for bots joining:

when using min/max bots, I only get this info for bots joining...
#Game_connected
#Game_connected
#Game_connected
#Game_connected

when using rcbot addbot from the config.ini, i get this info...
[RCBot] Bot Command 'rcbot addbot 0 2
' executed
[RCBot] bot added
#Game_connected
[RCBot] Bot Command 'rcbot addbot 0 3
' executed
[RCBot] bot added
[RCBot] Bot Command 'rcbot addbot 1 2
' executed
#Game_connected
[RCBot] bot added
#Game_connected

No bot names in either case. but on my screen i get something like this...

player bot01 has joined the game
player bot01 changed name to joe

player bot02 has joined the game
player bot02 changed name to jeff

and so on, bot01 thru bot12, no connection to which bot ini is loading...


I'm not sure if this would make a difference, have you tried Ted's new .76 linux build?

http://rcbot.bots-united.com/forums/index....ost&p=12552

Yeah, genmac could be right, might be a bug in the linux build, and cheeseh depends on feedback from the community for dedi bugs...

Hope this helps,
max
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
phenrol
post Jan 31 2014, 04:48 AM
Post #6


Newbie
*

Group: Members
Posts: 8
Joined: 28-January 14
Member No.: 2,322



I have indeed tried Ted's new .76 linux build as you suggested. This was where I originally found the latest build out there, and I just downloaded it again to be sure (even though the size was exactly the same) with the same results.

Interestingly enough, with your advice about the "bot" command using arguments "-team" and "-name" to add the bot and then the "rcbot control [bot name]" command, I discovered that the "-name" argument is ignored (or at least I believe it is).

When I run "bot -team 3 -class 2 -name test1" (according to the manual - team 3 = axis; team 2 = allies | class 2 is assault) I get the following output:

QUOTE
L 01/30/2014 - 21:40:19: "Bot22<23><BOT><>" connected, address "none"
L 01/30/2014 - 21:40:19: "Bot22<23><BOT><>" entered the game
L 01/30/2014 - 21:40:19: "Bot22<23><BOT><Unassigned>" joined team "Axis"
L 01/30/2014 - 21:40:19: "Bot22<23><BOT><Axis>" changed role to "#class_axis_mp44


The "-class" and "-team" arguments are adhered to, however, the -name argument does not seem to do anything.

I get the same results when I use the "rcbotd" equivalent arguments.

So, is this indeed a bug with the linux build of the source dedicated server?


For grins, here is the output pertaining to [RCBOT] in the console output as the server loads up:
QUOTE

[RCBOT] Found interface INTERFACEVERSION_PLAYERINFOMANAGER IPlayerInfoManager pl
ayerinfomanager
[RCBOT] Found interface INTERFACEVERSION_VENGINESERVER IVEngineServer engine
Trying... VFileSystem022
[RCBOT] Found interface "VFileSystem" IFileSystem filesystem, ver = 022
[RCBot] Training DOD:S capture decision 'NN' ... hold on...
[RCBot] ... done!
[RCBOT] Found interface INTERFACEVERSION_ISERVERPLUGINHELPERS IServerPluginHelpe
rs helpers
[RCBOT] Found interface INTERFACEVERSION_ENGINETRACE_SERVER IEngineTrace enginet
race
[RCBOT] Found interface INTERFACEVERSION_SERVERGAMEENTS IServerGameEnts serverga
meents
[RCBOT] Found interface IEFFECTS_INTERFACE_VERSION IEffects g_pEffects
[RCBOT] Found interface INTERFACEVERSION_PLAYERBOTMANAGER IBotManager g_pBotMana
ger
[RCBOT] Found interface INTERFACEVERSION_GAMEEVENTSMANAGER2 IGameEventManager2 gameeventmanager
[RCBOT] Found interface INTERFACEVERSION_GAMEEVENTSMANAGER IGameEventManager gameeventmanager1
Trying... ServerGameDLL008
[RCBOT] Found interface "ServerGameDLL" IServerGameDLL servergamedll, ver = 008
Trying... ServerGameClients004
[RCBOT] Found interface "ServerGameClients" IServerGameClients gameclients, ver = 004
[RCBot] Reading bot profile "../rcbot2/profiles/1.ini"
[RCBot] Reading bot profile "../rcbot2/profiles/2.ini"
[RCBot] Reading bot profile "../rcbot2/profiles/3.ini"
[RCBot] Reading bot profile "../rcbot2/profiles/4.ini"
[RCBot] Reading bot profile "../rcbot2/profiles/5.ini"
[RCBot] Reading bot profile "../rcbot2/profiles/6.ini"
[RCBot] Reading bot profile "../rcbot2/profiles/7.ini"
[RCBot] Reading bot profile "../rcbot2/profiles/8.ini"
[RCBot] file not found/opening error '../rcbot2/profiles/9.ini' mode r
[RCBot] Trying to create folder '../' failed
[RCBot] Trying to create folder '../rcbot2/' failed
[RCBot] Trying to create folder '../rcbot2/profiles/' failed
[RCBot] failed to make folders for ../rcbot2/profiles/9.ini
[RCBot] Bot profile "../rcbot2/profiles/9.ini" not found
-----------------------------------------------------------------
RCBOT LICENSE
-----------------------------------------------------------------
RCBot by Paul Murphy adapted from Botman's HPB Bot 2 template.

RCBot is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at
your option) any later version.

RCBot is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with RCBot; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

In addition, as a special exception, the author gives permission to
link the code of this program with the Half-Life Game Engine ("HL"
Engine") and Modified Game Libraries ("MODs") developed by Valve,
L.L.C ("Valve"). You must obey the GNU General Public License in all
respects for all of the code used other than the HL Engine and MODs
from Valve. If you modify this file, you may extend this exception
to your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from your
version.
-----------------------------------------------------------------


Note that I only have 8 profile files (I removed a bunch of the original 32), so I assume this output looks ok.

After I enter the "rcbotd addbot" command, I get this output (I get this same output if I use the rcbot command in-game as well):

QUOTE

[RCBot] bot added
L 01/30/2014 - 20:42:51: "Bot01<2><BOT><>" connected, address "none"
L 01/30/2014 - 20:42:51: "Bot01<2><BOT><>" entered the game
[RCBot] Bot Command 'rcbot_defrate 0.19
' executed
L 01/30/2014 - 20:42:51: "Bot01<2><BOT><Unassigned>" changed name to "RCBot"
L 01/30/2014 - 20:42:51: "RCBot<2><BOT><Unassigned>" joined team "Allies"
L 01/30/2014 - 20:42:51: "RCBot<2><BOT><Allies>" changed role to "#class_allied_garand"
[RCBot] Bot Command 'rcbot_skill 0.60
' executed
[RCBot] Bot Command 'rcbot_anglespeed 0.25
' executed
[RCBot] Bot Command 'rcbot_avoid_radius 80
' executed
[RCBot] Bot Command 'rcbot_avoid_strength 100
' executed
[RCBot] Bot Command 'rcbot_aimsmooting 1
' executed
[RCBot] Bot Command 'rcbot_change_classes 1
' executed
[RCBot] Bot Command 'sv_cheats 1
' executed
[RCBot] Bot Command 'rcbot_sv_cheats_auto 1
' executed
[RCBot] Bot Command 'rcbot_taunt 1
' executed
[RCBot] Bot Command 'rcbot_messaround 1
' executed
[RCBot] Bot Command 'rcbot_meleeonly 0
' executed
Unknown command "rcbot_meleeonly"
[RCBot] Bot Command 'rcbot_move_obj 1
' executed
[RCBot] Bot Command 'rcbot_min_cc_time 60
' executed
[RCBot] Bot Command 'rcbot_max_cc_time 240
' executed
[RCBot] Bot Command 'rcbot_runplayer_hookonce 1
' executed
[RCBot] Bot Command 'rcbot_runplayer_cmd_dods 417
' executed
[RCBot] Bot Command 'rcbot_runplayer_cmd_tf2 417
' executed
[RCBot] Bot Command 'rcbot_scoutdj 0.5
' executed
[RCBot] Bot Command 'rcbot_voice_cmds 1
' executed
[RCBot] Bot Command 'rcbot_heavyaimoffset 0.1
' executed
[RCBot] Bot Command 'rcbot_move_sentry_time 120
' executed
[RCBot] Bot Command 'rcbot_move_sentry_kpm 1
' executed
[RCBot] Bot Command 'rcbot_move_disp_time 120
' executed
[RCBot] Bot Command 'rcbot_move_disp_healamount 100
' executed
[RCBot] Bot Command 'rcbot_move_tele_time 120
' executed
[RCBot] Bot Command 'rcbot_move_tele_tpm 1
' executed
[RCBot] Bot Command 'rcbot_move_dist 800
' executed


I think its interesting that rcbot2 changes the bots name to "RCBot". This implies (by the fact that it did successfully change its name) that rcbot2 has the ability to alter the name of the bot it just added. So, even if the source dedicated server itself has a bug with the "-name" argument, shouldn't rcbot2 be using its ability to alter the bots name?

Or...is there just some part of my config that is incorrectly setup perhaps?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
madmax2
post Jan 31 2014, 07:47 PM
Post #7


RCBot Guru
*****

Group: Waypointers
Posts: 957
Joined: 2-March 12
From: USA, WA state
Member No.: 2,162



I'm trying this on winXP listen server, to see what happens, today is a travel day for me, so I only had a few minutes... I tried the "bot" & "control" commands like in the post above...

bot -team axis -name joe
rcbot control joe

This would not spawn a bot named joe, it spawned a bot with a random name like "bot07". when I did "rcbot control joe", the console says joe doesn't exist. i typed "rcbot control bot07" bot07 suicides & was replaced with another, bot03. The bots were dumb, bumping into walls. I think this is spawning the dumb "pupet" bots built into the game. The control command tells rcbot to take control of that bot or slot?

I still haven't got it to work right with names yet, need more time with it.. But on a listen server, the control command didn't work until i first added a few rcbots. then i added a pupet bot (joe wouldn't work), used "rcbot control bot09", bot09 suicided, and a random rcbot took it's place, joined the correct team this time, and started playing normally...

I'll check this out more, later today or tomorrow. Not sure if this will do what you want? I'm curious to see what happens without any bot profiles? I don't see anything wrong in the config output from the console, nothing obvious... It's good to know rcbots are working in linux wink.gif

max
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
phenrol
post Feb 1 2014, 12:41 AM
Post #8


Newbie
*

Group: Members
Posts: 8
Joined: 28-January 14
Member No.: 2,322



Ultimately, I would like custom names for the spawned bots.

I find it interesting that RCBot2 does in fact spawn a bot (i.e. Bot01) and then changes its name to "RCBot".

QUOTE
L 01/30/2014 - 20:42:51: "Bot01<2><BOT><Unassigned>" changed name to "RCBot"


The question is, how can you use RCBot2 to change the name to something else?

What do you think?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
genmac
post Feb 1 2014, 11:29 AM
Post #9


RCBot Guru
*****

Group: Waypointers
Posts: 571
Joined: 11-November 11
Member No.: 2,098



Looks like a bug and the bot01 are the default dumb bots of dods.
for me this stock dods bots comes around on map change as if they have take over rcbot2 so another bug there and Cheeseh seems so busy to RL lately so we just have to wait on his better inputs to this.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
phenrol
post Feb 1 2014, 05:35 PM
Post #10


Newbie
*

Group: Members
Posts: 8
Joined: 28-January 14
Member No.: 2,322



Do you believe it is a bug with the linux RCBot2 code or the linux source dedicated server (srcds) code?

What happens on a windows dedicated server when running: bot -team 3 -class 2 -name "test1" ?
Does is create a bot named "test1"?

Does the windows dedicated server load the profiles as it adds bots using "rcbot addobt" and name them as what is set in the profile file?

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
phenrol
post Feb 1 2014, 08:30 PM
Post #11


Newbie
*

Group: Members
Posts: 8
Joined: 28-January 14
Member No.: 2,322



FYI, I answered my own questions about the windows version. I just finished setting a windows system up and created another srcds server.

Here is the output of the rcbotd addbot command on a windows system:
QUOTE
[RCBot] bot added
L 02/01/2014 - 12:24:45: "Bot01<2><BOT><>" connected, address "none"
L 02/01/2014 - 12:24:45: "Bot01<2><BOT><>" entered the game
[RCBot] Bot Command 'rcbot_defrate 0.19
' executed
L 02/01/2014 - 12:24:45: "Bot01<2><BOT><Unassigned>" changed name to "friendlygarg"
L 02/01/2014 - 12:24:45: "friendlygarg<2><BOT><Unassigned>" joined team "Allies"
L 02/01/2014 - 12:24:45: "friendlygarg<2><BOT><Allies>" changed role to "#class_allied_garand"


Looks like the windows version or the source dedicated server also does not recognize a "-name" argument in the bot command
QUOTE
bot -team 2 -class 2 -name "test1"
L 02/01/2014 - 12:27:47: "Bot02<3><BOT><>" connected, address "none"
L 02/01/2014 - 12:27:47: "Bot02<3><BOT><>" entered the game
L 02/01/2014 - 12:27:48: "Bot02<3><BOT><Unassigned>" joined team "Allies"
L 02/01/2014 - 12:27:48: "Bot02<3><BOT><Allies>" changed role to "#class_allied_heavy"


So I guess its most likely a bug within the RCBot2 code relating to the linux build.

As soon as Cheeseh has some time away from "real life" perhaps this will get looked at. Or mayhaps someone (me or otherwise) could be brave enough to look at the code?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
genmac
post Feb 2 2014, 02:56 AM
Post #12


RCBot Guru
*****

Group: Waypointers
Posts: 571
Joined: 11-November 11
Member No.: 2,098



Rcbot2 currently is more for client/listenserver use as Cheeseh only test it that way I think and as max mentioned he only relies on server admins feedbacks.

Also the updates on the servers might also be causing that.

If you can rename the bots ingame using sm_rename then why not just make a config to do all the renaming and just auto execute or bind it.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Ted
post Feb 2 2014, 03:09 AM
Post #13


Member
**

Group: Members
Posts: 13
Joined: 20-February 13
Member No.: 2,257



I've updated the build with the fix for this issue. The OS X version is updated as well. You can download them via the same links.

QUOTE(phenrol @ Jan 31 2014, 04:48 AM) *

I have indeed tried Ted's new .76 linux build as you suggested. This was where I originally found the latest build out there, and I just downloaded it again to be sure (even though the size was exactly the same) with the same results.

Interestingly enough, with your advice about the "bot" command using arguments "-team" and "-name" to add the bot and then the "rcbot control [bot name]" command, I discovered that the "-name" argument is ignored (or at least I believe it is).

When I run "bot -team 3 -class 2 -name test1" (according to the manual - team 3 = axis; team 2 = allies | class 2 is assault) I get the following output:
The "-class" and "-team" arguments are adhered to, however, the -name argument does not seem to do anything.

I get the same results when I use the "rcbotd" equivalent arguments.

So, is this indeed a bug with the linux build of the source dedicated server?
For grins, here is the output pertaining to [RCBOT] in the console output as the server loads up:
Note that I only have 8 profile files (I removed a bunch of the original 32), so I assume this output looks ok.

After I enter the "rcbotd addbot" command, I get this output (I get this same output if I use the rcbot command in-game as well):
I think its interesting that rcbot2 changes the bots name to "RCBot". This implies (by the fact that it did successfully change its name) that rcbot2 has the ability to alter the name of the bot it just added. So, even if the source dedicated server itself has a bug with the "-name" argument, shouldn't rcbot2 be using its ability to alter the bots name?

Or...is there just some part of my config that is incorrectly setup perhaps?

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
madmax2
post Feb 2 2014, 06:31 AM
Post #14


RCBot Guru
*****

Group: Waypointers
Posts: 957
Joined: 2-March 12
From: USA, WA state
Member No.: 2,162



Ted to the rescue... That was fast... Thanks... smile.gif

@ phenrol

I think I mislead you with the "bot" command ohmy.gif . It is definately for the built in source bots that never have been finished in dod:s. I can spawn these dumb bots with rcbot completely disabled. and I still can't get -name to work on windows, but -team & -class do work. So I think that was a dod:s "bot" bug/problem.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
phenrol
post Feb 2 2014, 03:56 PM
Post #15


Newbie
*

Group: Members
Posts: 8
Joined: 28-January 14
Member No.: 2,322



Ted, thank you for taking a look at the code. I appreciate it.

I just downloaded the new file from: The existing link (which then has a link to google docs)

I definitely see that you made a different file because the old one was 4,789,219 bytes and the new one is 4,928,688 bytes

I put it on my linux DOD:S dedicated server and restarted it, then tried "rcbotd addbot" and it loaded a bot:

QUOTE
[RCBot] bot added
L 02/02/2014 - 08:43:06: "Bot01<2><BOT><>" connected, address "none"
L 02/02/2014 - 08:43:06: "Bot01<2><BOT><>" entered the game
[RCBot] Bot Command 'rcbot_defrate 0.19
' executed
L 02/02/2014 - 08:43:06: "Bot01<2><BOT><Unassigned>" joined team "Allies"
L 02/02/2014 - 08:43:06: "Bot01<2><BOT><Allies>" changed role to "#class_allied_garand"


However, this time it did not change the bots name to "RCBot", nor did it change its name to any of those in the profiles files. So...no joy.

So, I simply have a bot called "Bot01" at this point. When I add more bots, it simply adds to the number at the end of the bot name, so Bot02, Bot03, Bot04, etc...

Any thoughts?

madmax2, thank you for the clarification on the "bot" command.

genmac, with this new version, it is easier to do an sm_rename, because now the bots are all named "Bot##" where as with the previous version all were named "RCBot" which meant I had to rename using the ID# (i.e. sm_rename #2 botzilla). I am unsure how to auto-execute a cfg file that has the sm_rename command in it upon a bot being spawned.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
phenrol
post Feb 2 2014, 08:04 PM
Post #16


Newbie
*

Group: Members
Posts: 8
Joined: 28-January 14
Member No.: 2,322



Here is an update on this.

I looked around for a sourcemod plugin that might be able to help out and I found Execute Configs 1.0 (Updated 08/12/09)

This plugin allowed me to execute a cfg file when someone connects to the server and when a player connects (event:player_connect).

I put a bunch of sm_rename commands into a cfg file for 75 potential bots (i.e. sm_rename Bot01 george; sm_rename Bot02 harry; sm_renam Bot03 larry; etc...).

So, essentially what happens is that when someone joins the server, bots connect automatically (due to rcbotd config max_bots) and when each bot connects, it executes the cfg file with the sm_rename commands in it.

I had to learn a bit about events at the valve events wiki. The console throws a ton of messages, but it works!

Just so you know, this would not have been possible without Ted's updated code that does NOT rename the bots to "RCBot". So...thank you Ted!

I do think there is more work to be done here to make this plugin a bit better, but this work around functions on my linux server, so I am content (for now).

smile.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
genmac
post Feb 3 2014, 02:07 PM
Post #17


RCBot Guru
*****

Group: Waypointers
Posts: 571
Joined: 11-November 11
Member No.: 2,098



glad you got the bot names taken cared of.
as for running multiple sm commands I just use some sm map configs plugins but your method seems better to.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
n0nnie
post Oct 27 2014, 10:24 AM
Post #18


Member
**

Group: Members
Posts: 35
Joined: 27-October 14
Member No.: 2,361



I am aware, this is from February, but it is exactly my Problem. Bots only get named RCBot and are ignoring Profiles. I tried dos2unix to all .ini files, I tried to edit all files to contain only name = Somname. I am using a workarround with a Sourcemodrenameplugin but this is kind of dowdy because I wanna different skills etc.

My Specs:
Ubuntu 12.04
using this
http://rcbot.bots-united.com/forums/index....ost&p=13010
Game DODS

Would be very cool if someone can give me a hand. I also have found nothing how to edit Profiles exactly. I do only know how to change name. Is there a Documentation? blink.gif

After Posting this I have found this:
http://rcbot.bots-united.com/forums/index.php?showtopic=1763

So one Problem is gone. But still no change for the names =(

Edit:
Is there a way to set a new Name for Bots which are load from default? So I can change RCBot to something other?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
n0nnie
post Oct 29 2014, 06:54 AM
Post #19


Member
**

Group: Members
Posts: 35
Joined: 27-October 14
Member No.: 2,361



Sorry for Doublepost but I think, this deserves an extra Post =)

Profiles are not read still but with the help of ZadRoot it was possible to get this Sourcemodplugin to work. In fact he did the fixes in the code für dod and I was compiling it XD


CODE
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1
#pragma unused cvarVersion

#define PLUGIN_VERSION "1.0"
#define PLUGIN_DESCRIPTION "Gives automatic names to bots on creation."
#define BOT_NAME_FILE "configs/botnames.txt"

// this array will store the names loaded
new Handle:bot_names;

// this array will have a list of indexes to
// bot_names, use these in order
new Handle:name_redirects;

// this is the next index to use into name_redirects
// update this each time you use a name
new next_index;

// various convars
new Handle:cvarVersion; // version cvar!
new Handle:cvarEnabled; // are we enabled?
new Handle:cvarPrefix; // bot name prefix
new Handle:cvarRandom; // use random-order names?
new Handle:cvarAnnounce; // announce new bots?
new Handle:cvarSuppress; // supress join/team/namechange messages?

public Plugin:myinfo =
{
    name = "Bot Names",
    author = "Rakeri",
    description = PLUGIN_DESCRIPTION,
    version = PLUGIN_VERSION,
    url = "https://forums.alliedmods.net/showthread.php?p=1054057"
}

// a function to generate name_redirects
GenerateRedirects()
{
    new loaded_names = GetArraySize(bot_names);

    if (name_redirects != INVALID_HANDLE)
    {
        ResizeArray(name_redirects, loaded_names);
    } else {
        name_redirects = CreateArray(1, loaded_names);
    }

    for (new i = 0; i < loaded_names; i++)
    {
        SetArrayCell(name_redirects, i, i);
        
        // nothing to do random-wise if i == 0
        if (i == 0)
        {
            continue;
        }

        // now to introduce some chaos
        if (GetConVarBool(cvarRandom))
        {
            SwapArrayItems(name_redirects, GetRandomInt(0, i - 1), i);
        }
    }
}

// a function to load data into bot_names
ReloadNames()
{
    next_index = 0;
    decl String:path[PLATFORM_MAX_PATH];
    BuildPath(Path_SM, path, sizeof(path), BOT_NAME_FILE);
    
    if (bot_names != INVALID_HANDLE)
    {
        ClearArray(bot_names);
    } else {
        bot_names = CreateArray(MAX_NAME_LENGTH);
    }
    
    new Handle:file = OpenFile(path, "r");
    if (file == INVALID_HANDLE)
    {
        //PrintToServer("bot name file unopened");
        return;
    }
    
    // this LENGTH*3 is sort of a hack
    // don't make long lines, people!
    decl String:newname[MAX_NAME_LENGTH*3];
    decl String:formedname[MAX_NAME_LENGTH];
    decl String:prefix[MAX_NAME_LENGTH];

    GetConVarString(cvarPrefix, prefix, MAX_NAME_LENGTH);

    while (IsEndOfFile(file) == false)
    {
        if (ReadFileLine(file, newname, sizeof(newname)) == false)
        {
            break;
        }
        
        // trim off comments starting with // or #
        new commentstart;
        commentstart = StrContains(newname, "//");
        if (commentstart != -1)
        {
            newname[commentstart] = 0;
        }
        commentstart = StrContains(newname, "#");
        if (commentstart != -1)
        {
            newname[commentstart] = 0;
        }
        
        new length = strlen(newname);
        if (length < 2)
        {
            // we loaded a bum name
            // (that is, blank line or 1 char == bad)
            //PrintToServer("bum name");
            continue;
        }

        // get rid of pesky whitespace
        TrimString(newname);
        
        Format(formedname, MAX_NAME_LENGTH, "%s%s", prefix, newname);
        PushArrayString(bot_names, formedname);
    }
    
    CloseHandle(file);
}

// called when the plugin loads
public OnPluginStart()
{
    // cvars!
    cvarVersion = CreateConVar("sm_botnames_version", PLUGIN_VERSION, PLUGIN_DESCRIPTION, FCVAR_NOTIFY | FCVAR_PLUGIN | FCVAR_DONTRECORD);
    cvarEnabled = CreateConVar("sm_botnames_enabled", "1", "sets whether bot naming is enabled", FCVAR_NOTIFY | FCVAR_PLUGIN);
    cvarPrefix = CreateConVar("sm_botnames_prefix", "", "sets a prefix for bot names (include a trailing space, if needed!)", FCVAR_NOTIFY | FCVAR_PLUGIN);
    cvarRandom = CreateConVar("sm_botnames_random", "1", "sets whether to randomize names used", FCVAR_NOTIFY | FCVAR_PLUGIN);
    cvarAnnounce = CreateConVar("sm_botnames_announce", "1", "sets whether to announce bots when added", FCVAR_NOTIFY | FCVAR_PLUGIN);
    cvarSuppress = CreateConVar("sm_botnames_suppress", "1", "sets whether to supress join/team change/name change bot messages", FCVAR_NOTIFY | FCVAR_PLUGIN);
    
    // hook team change, connect to supress messages
    HookEvent("player_connect", Event_PlayerConnect, EventHookMode_Pre);
    HookEvent("player_team", Event_PlayerTeam, EventHookMode_Pre);

    // trickier... name changes are user messages, so...
    HookUserMessage(GetUserMessageId("SayText"), UserMessage_SayText2, true);

    // register our commands
    RegServerCmd("sm_botnames_reload", Command_Reload);

    AutoExecConfig();
}

public OnMapStart()
{
    ReloadNames();
    GenerateRedirects();
}

// reload bot name, via console
public Action:Command_Reload(args)
{
    ReloadNames();
    GenerateRedirects();
    PrintToServer("[botnames] Loaded %i names.", GetArraySize(bot_names));
}

// handle client connection, to change the names...
public OnClientPostAdminCheck(client)
{
    new loaded_names = GetArraySize(bot_names);

    if (IsFakeClient(client) && loaded_names != 0)
    {
        // we got a bot, here, boss
        
        decl String:newname[MAX_NAME_LENGTH];
        GetArrayString(bot_names, GetArrayCell(name_redirects, next_index), newname, MAX_NAME_LENGTH);

        next_index++;
        if (next_index > loaded_names - 1)
        {
            next_index = 0;
        }
        
        SetClientInfo(client, "name", newname);
        if (GetConVarBool(cvarAnnounce))
        {
            PrintToChatAll("[botnames] Bot %s created.", newname);
            PrintToServer("[botnames] Bot %s created.", newname);
        }
    }
    
}

// handle "SayText2" usermessages, including name change notifies!
public Action:UserMessage_SayText2(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
{
    if (!(GetConVarBool(cvarEnabled) && GetConVarBool(cvarSuppress)))
    {
        return Plugin_Continue;
    }

    decl String:message[256];

    BfReadShort(bf); // team color

    BfReadString(bf, message, sizeof(message));
    // check for Name_Change, not #TF_Name_Change (compatibility?)
    if (StrContains(message, "Name_Change") != -1)
    {
        BfReadString(bf, message, sizeof(message)); // original
        BfReadString(bf, message, sizeof(message)); // new
        if (FindStringInArray(bot_names, message) != -1)
        {
            // 'tis a bot!
            return Plugin_Handled;
        }
    }

    return Plugin_Continue;
}

// handle player team change, to supress bot messages
public Action:Event_PlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (!(GetConVarBool(cvarEnabled) && GetConVarBool(cvarSuppress)))
    {
        return Plugin_Continue;
    }

    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    if (client == 0)
    {
        // weird error, ignore
        return Plugin_Continue;
    }
    if (IsFakeClient(client))
    {
        // fake client == bot
        SetEventBool(event, "silent", true);
        return Plugin_Changed;
    }

    return Plugin_Continue;
}

// handle player connect, to supress bot messages
public Action:Event_PlayerConnect(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (!(GetConVarBool(cvarEnabled) && GetConVarBool(cvarSuppress)))
    {
        return Plugin_Continue;
    }

    decl String:networkID[32];
    GetEventString(event, "networkid", networkID, sizeof(networkID));

    if(!dontBroadcast && StrEqual(networkID, "BOT"))
    {
        // we got a bot connectin', resend event as no-broadcast
        decl String:clientName[MAX_NAME_LENGTH], String:address[32];
        GetEventString(event, "name", clientName, sizeof(clientName));
        GetEventString(event, "address", address, sizeof(address));

        new Handle:newEvent = CreateEvent("player_connect", true);
        SetEventString(newEvent, "name", clientName);
        SetEventInt(newEvent, "index", GetEventInt(event, "index"));
        SetEventInt(newEvent, "userid", GetEventInt(event, "userid"));
        SetEventString(newEvent, "networkid", networkID);
        SetEventString(newEvent, "address", address);

        FireEvent(newEvent, true);

        return Plugin_Handled;
    }

    return Plugin_Continue;
}
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
d3m0n
post Nov 15 2014, 06:06 AM
Post #20


Member
**

Group: Members
Posts: 25
Joined: 2-May 14
Member No.: 2,333



QUOTE(n0nnie @ Oct 29 2014, 01:54 PM) *

Sorry for Doublepost but I think, this deserves an extra Post =)

Profiles are not read still but with the help of ZadRoot it was possible to get this Sourcemodplugin to work. In fact he did the fixes in the code für dod and I was compiling it XD


I tried the plugin.

It changes the name from Bot01 to a name in the botnames.txt but then rcbot changes the name AGAIN to RCBot, which is what I get even without the plugin.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

2 Pages V  1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 22nd December 2024 - 06:42 AM