HL2DM: Bots on and off
- daren adler
- Senior Member
- Posts: 348
- Joined: Sat May 18, 2019 7:42 pm
HL2DM: Bots on and off
Hello script writers . I am using hrcbot for my bots on my server, i am using the map-config to be able to change type of game while on a gg map and change back to normal when on a non gungame (gg) map. the only trouble i have is sometimes when you go to a non gg map after being on a gungame map, it still keeps the bots off untill next map or rtv or admin change map, i would like a plugin to fix that please. Thank you and have a great weekend.
-
- Senior Member
- Posts: 310
- Joined: Sun May 17, 2020 7:56 am
- Location: Finland
- Contact:
Re: HL2DM: Bots on and off
Hi try this code(Untested)
Syntax: Select all
from listeners import OnLevelInit
from engines.server import queue_command_string
@OnLevelInit
def map_start(current_map):
if not current_map.startswith('gg'):
queue_command_string('hrcbot_enabled 1')
- daren adler
- Senior Member
- Posts: 348
- Joined: Sat May 18, 2019 7:42 pm
Re: HL2DM: Bots on and off
cssbestrpg wrote:Hi try this code(Untested)Syntax: Select all
from listeners import OnLevelInit
from engines.server import queue_command_string
@OnLevelInit
def map_start(current_map):
if not current_map.startswith('gg'):
queue_command_string('hrcbot_enabled 1')
Thank you for trying but it did not work on me, left no errors in sp logfile either. I did have a script writer make a script that was for the hrcbots for weapons https://forums.sourcepython.com/viewtopic.php?f=37&t=2521 and to turn the hrcbots on and off are hrcbot_enabled 1 < -on, and hrcbot_enabled 0 <-off
-
- Senior Member
- Posts: 310
- Joined: Sun May 17, 2020 7:56 am
- Location: Finland
- Contact:
Re: HL2DM: Bots on and off
Weird, that code should execute the command turn on bots when map isn't gg one when new map starts.
- daren adler
- Senior Member
- Posts: 348
- Joined: Sat May 18, 2019 7:42 pm
Re: HL2DM: Bots on and off
cssbestrpg wrote:Weird, that code should execute the command turn on bots when map isn't gg one when new map starts.
Ok, thanks for trying, i looked again after i updated my source-python, and it still will not work, i even added dm insteed of gg and it still let the bots on. i just need a plugin i guess that you could turn the bots on and off in game, Here are some of the bots setting if that will help
Code: Select all
//Hurricane Bot settings
hrcbot_enabled 1
hrcbot_minplayers 0
hrcbot_maxplayers 5
hrcbot_handicap 65
hrcbot_motd 0
hrcbot_dialogmsg 1
hrcbot_freezeifnoplayers 0
hrcbot_spawnprotectionseconds 2
hrcbot_spawnprotectedhealth 125
hrcbot_player_spawnweapon smg1
hrcbot_clan ""
Hope that will help. if you need anything else please ask.
Re: HL2DM: Bots on and off
Well, if nothing works, try delaying queue_command_string command. May be plugin switches bots after our command command. Also, debug this switch and look, if it at least runs
- daren adler
- Senior Member
- Posts: 348
- Joined: Sat May 18, 2019 7:42 pm
Re: HL2DM: Bots on and off
Ok can you show me what to do on here please, i am just trying to have my hrcbots (hurricane bots ) able to turn on and off in game.Articha wrote:Well, if nothing works, try delaying queue_command_string command. May be plugin switches bots after our command command. Also, debug this switch and look, if it at least runs
-
- Senior Member
- Posts: 310
- Joined: Sun May 17, 2020 7:56 am
- Location: Finland
- Contact:
Re: HL2DM: Bots on and off
daren adler wrote:Ok can you show me what to do on here please, i am just trying to have my hrcbots (hurricane bots ) able to turn on and off in game.Articha wrote:Well, if nothing works, try delaying queue_command_string command. May be plugin switches bots after our command command. Also, debug this switch and look, if it at least runs
Syntax: Select all
from listeners.tick import Delay
from listeners import OnLevelInit
from engines.server import queue_command_string
@OnLevelInit
def map_start(current_map):
if not current_map.startswith('gg'):
Delay(0, queue_command_string, ('hrcbot_enabled 1',))
print(f'Executed bots on for {current_map} map')
- daren adler
- Senior Member
- Posts: 348
- Joined: Sat May 18, 2019 7:42 pm
Re: HL2DM: Bots on and off
I tryed it and it will not work, i updated sp, i even changed the "gg" to "asc" (other maps i have asclan maps), and did not work, gives no errors on log. I am thinking its the hrcbots. Thank you for all your help/try.
- L'In20Cible
- Project Leader
- Posts: 1534
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: HL2DM: Bots on and off
My first guess would be that your bots plugin is loaded prior SP and its callbacks do their things before the variable is enabled. Try to load SP first.
- daren adler
- Senior Member
- Posts: 348
- Joined: Sat May 18, 2019 7:42 pm
Re: HL2DM: Bots on and off
L'In20Cible wrote:My first guess would be that your bots plugin is loaded prior SP and its callbacks do their things before the variable is enabled. Try to load SP first.
ok, will try. ty
- daren adler
- Senior Member
- Posts: 348
- Joined: Sat May 18, 2019 7:42 pm
Re: HL2DM: Bots on and off
Come to think about it, i do not even have my bots in my autoexec file, but i will try with it on there (remove from server.cfg) and add them to my autoexec file at the end.daren adler wrote:L'In20Cible wrote:My first guess would be that your bots plugin is loaded prior SP and its callbacks do their things before the variable is enabled. Try to load SP first.
ok, will try. ty
Who is online
Users browsing this forum: No registered users and 1 guest