March 19, 2019, 07:55:40 AM

Author Topic: Why the Bots can't change their races?  (Read 568 times)

Offline Osker Lee

  • Level 0 Beginner
  • Posts: 15
  • <3 WCS :)
Why the Bots can't change their races?
« on: January 09, 2019, 11:13:58 AM »
Why the Bots can't change their races?They only choose the Undead Scourge,not random races.How to fix it?

Offline HOLLIDAY

  • <Race Maker>
  • Watchdog
  • Level 7 Expert
  • *****
  • Posts: 2851
  • Country: 00
  • of all the things ive lost i miss my mind the most
    • HOLLIDAYWCS.COM
Re: Why the Bots can't change their races?
« Reply #1 on: January 15, 2019, 07:40:17 AM »
I made a script for this way back in the day.

Offline Osker Lee

  • Level 0 Beginner
  • Posts: 15
  • <3 WCS :)
Re: Why the Bots can't change their races?
« Reply #2 on: January 16, 2019, 05:01:47 AM »
Hi HOLLIDAY
Where can i download your script? :)

Offline Kiwi :)

  • Level 7 Expert
  • *****
  • Posts: 173
  • Country: at
  • Owner from www.frostfallwcs.com
Re: Why the Bots can't change their races?
« Reply #3 on: January 19, 2019, 12:48:22 PM »
If you use eventscripts you can use this script

Code: [Select]
block load
{
es_xset players 0
es_xset counter 0
es_xset player_bot 0
}

event player_death
{
es_xset counter 0
es foreach player players #bot "es_math counter + 1"
if (server_var(players) > 1) do
{
es_isbot player_bot event_var(userid)
if (server_var(player_bot) == 1) do
{
es wcs_change_race event_var(userid) "Bot Race (bot only)"
}
}
}


Works fine for CSS Idk what version you are using

With the script the bots change to the race "Bot Race (bot only)" Thats what my bot race was called


Hope it helps you
Check our Community Page! www.FrostfallWCS.com!



Offline Osker Lee

  • Level 0 Beginner
  • Posts: 15
  • <3 WCS :)
Re: Why the Bots can't change their races?
« Reply #4 on: January 21, 2019, 05:54:24 AM »
[console] es_load: Could not open script for wcs/tools/Bot Race (bot only)/Bot Race (bot only)

Offline Kiwi :)

  • Level 7 Expert
  • *****
  • Posts: 173
  • Country: at
  • Owner from www.frostfallwcs.com
Re: Why the Bots can't change their races?
« Reply #5 on: January 21, 2019, 10:27:45 AM »
Works fine for me

I called the folder "forcedrace" and the script "es_forcedrace"

You need to put in the race you want the bots to take (in the code)
Check our Community Page! www.FrostfallWCS.com!



Offline Osker Lee

  • Level 0 Beginner
  • Posts: 15
  • <3 WCS :)
Re: Why the Bots can't change their races?
« Reply #6 on: January 21, 2019, 11:33:48 AM »
Works fine for me

I called the folder "forcedrace" and the script "es_forcedrace"

You need to put in the race you want the bots to take (in the code)
For example,just like this ?
es wcs_change_race event_var(userid) "human_alliance"

addons\source-python\plugins\es_emulator\eventscripts\wcs\races  there are 11 races.
« Last Edit: January 21, 2019, 11:39:10 AM by Osker Lee »

Offline Kiwi :)

  • Level 7 Expert
  • *****
  • Posts: 173
  • Country: at
  • Owner from www.frostfallwcs.com
Re: Why the Bots can't change their races?
« Reply #7 on: January 21, 2019, 12:24:19 PM »
Oh ya im not sure if it works with that version you need to try it :P
Check our Community Page! www.FrostfallWCS.com!



Offline Osker Lee

  • Level 0 Beginner
  • Posts: 15
  • <3 WCS :)
Re: Why the Bots can't change their races?
« Reply #8 on: January 21, 2019, 01:29:30 PM »
My WCS version:
Warcraft Source 0.78 for Counterstrike Source & Global Offensive
http://warcraft-source.com/board/index.php?topic=17185.0

Offline Osker Lee

  • Level 0 Beginner
  • Posts: 15
  • <3 WCS :)
Re: Why the Bots can't change their races?
« Reply #9 on: January 23, 2019, 05:44:06 PM »
Open csgo/cfg/autoexec.cfg,type these commands:
(number = userid)

wcs_changerace 3 Undead Scourge
wcs_changerace 4 Human Alliance
wcs_changerace 5 Orcish Horde
wcs_changerace 6 Night Elves
wcs_changerace 7 Blood Mage
wcs_changerace 8 Archmage Proudmoore
wcs_changerace 9 Shadow Hunter
wcs_changerace 10 Warden
wcs_changerace 11 Crypt Lord
...

Then open the console ingame,type "exec autoexec", now all bots will change to the particular races. :)

Offline Manifest

  • Race & effect creator
  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 1061
  • Country: dk
  • Content creator for the new WCS version by Kami.
Re: Why the Bots can't change their races?
« Reply #10 on: January 24, 2019, 12:15:01 PM »
Hi guys!

Sorry for my absence, I plan on returning to the forums here around February and be more active, hopefully also bringing something useful along as well.

Okay, so straight to the topic!

First and foremost, it is possible to make bots change their own race. I do not recall this being part of the core, or have a standard configuration to it. In order to do this you need a script/addon installed on your server.

Okay, now that's clarified, let us get down to business!
I know you replied to another post of mine in regards to the same feature, that addon should work. However it was designed for Kami's version of WCS at the time, and I do not believe the wcs_getrandomrace command is existent in the new version by ThaPwned, you'd have to manually make that command yourself for your version in order to make my addon work for the most recent Warcraft Source.

_________________________________________________________________________________________________________________________________________________
Kiwi was very nice and helpful and linked you a script, that on his old server would make bots change their races to the race named "Bot Race (bot only)".
This script will make your bots play one specific race and not randomize between the different races available to them.  I didn't this, I just read the code - Please correct me if I'm wrong here Kiwi. :)

Moving on to the code of the script itself, this would not work on the newer versions, not because the script itself is wrong, but purely because wcs_change_race was a custom command on Kiwi's server that was never actually integrated in to the new and more recent versions which support CS:GO. :-)

_________________________________________________________________________________________________________________________________________________
Next thing is the version you're running, with that this addon should work, if loadded correctly;
http://warcraft-source.com/board/index.php?topic=17213.msg121879;topicseen#new

_________________________________________________________________________________________________________________________________________________
I would highly advice the suggestion of putting the following in your autoexec.cfg:
Code: [Select]
wcs_changerace 3 Undead Scourge
wcs_changerace 4 Human Alliance
wcs_changerace 5 Orcish Horde
wcs_changerace 6 Night Elves
wcs_changerace 7 Blood Mage
wcs_changerace 8 Archmage Proudmoore
wcs_changerace 9 Shadow Hunter
wcs_changerace 10 Warden
wcs_changerace 11 Crypt Lord

The reason for this is because you'd not only force bots to change their races but also all players currently playing on the server who were assigned the respective userids, 3, 4, 5, 6, 7, 8, 9, 10, and 11 will have their races changed to that specific race which will be very frustrating for them.

Based on what you've written there, it is my understanding that you want the bot to change race everytime it dies, and you want it to change to a certain range of races. Below is a script that'll do just that. I've tried to make it as simple and easily understandable as possible.
In essence you define which races the bots are allowed to choose between, and when they die they'll change their race to one of these races.

_________________________________________________________________________________________________________________________________________________
Code: [Select]
block load
{
es_xset the_dead_person_is_a_bot 0
}

//Whenever someone on the server dies, the following will happen.
event player_death
{
//Checks if the dead person was a bot.
es_isbot the_dead_person_is_a_bot event_var(userid)
if (server_var(the_dead_person_is_a_bot) == 1) do
{
//If the person was a bot, roll a dice between 1 to 9.
es_xrand wcs_rand 1 9

//Depending on the number the dice lands on, the bot will be assigned a race, 1 is undead scourge, 6 is blood mage etc.
if (server_var(wcs_rand) == 1) then es wcs_changerace event_var(userid) "Undead Scourge"
if (server_var(wcs_rand) == 2) then es wcs_changerace event_var(userid) "Human Alliance"
if (server_var(wcs_rand) == 3) then es wcs_changerace event_var(userid) "Orcish Horde"
if (server_var(wcs_rand) == 4) then es wcs_changerace event_var(userid) "Night Elves"
if (server_var(wcs_rand) == 5) then es wcs_changerace event_var(userid) "Blood Mage"
if (server_var(wcs_rand) == 6) then es wcs_changerace event_var(userid) "Archmage Proudmoore"
if (server_var(wcs_rand) == 7) then es wcs_changerace event_var(userid) "Shadow Hunter"
if (server_var(wcs_rand) == 8) then es wcs_changerace event_var(userid) "Warden"
if (server_var(wcs_rand) == 9) then es wcs_changerace event_var(userid) "Crypt Lord"
}
}

I hope this helped!
"BRAVORA: Bruh it is fucking operation crystal night when you are approving races."


Offline Osker Lee

  • Level 0 Beginner
  • Posts: 15
  • <3 WCS :)
Re: Why the Bots can't change their races?
« Reply #11 on: January 25, 2019, 02:54:44 PM »
In fact, in the new version by ThaPwned, it does not need any script or addons, because the bots will choose different races when they join the game, type "playerinfo" and we will see that.The WCS version by Kami, I think it needs the script to make the bots change their races.

Thanks anyway.

« Last Edit: January 25, 2019, 02:57:11 PM by Osker Lee »

Offline Manifest

  • Race & effect creator
  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 1061
  • Country: dk
  • Content creator for the new WCS version by Kami.
Re: Why the Bots can't change their races?
« Reply #12 on: January 26, 2019, 10:45:19 AM »
Yeah, that's actually right, in Tha Pwned's version it's a setting in the core package, I couldn't remember if he implemented that.:-)

On Kami's version you have to rely on external addons, but that randomrace addon here on the forum should work at least, it worked when we tested it at least :-)
« Last Edit: January 28, 2019, 10:50:21 PM by Manifest »
"BRAVORA: Bruh it is fucking operation crystal night when you are approving races."


Offline HOLLIDAY

  • <Race Maker>
  • Watchdog
  • Level 7 Expert
  • *****
  • Posts: 2851
  • Country: 00
  • of all the things ive lost i miss my mind the most
    • HOLLIDAYWCS.COM
Re: Why the Bots can't change their races?
« Reply #13 on: February 03, 2019, 03:16:30 AM »
Reading these posts makes me want to get back into this.
I wish I had the time.

I remember making a script called bot_changerace
It got the total number of races on the server, then changed the bots race to any random race on the server.
But this was back when the races were numbered in a dB instead of an ini (before python)

I later found a new way to do this, but I can't remember how.

Has anyone ever made bots use ultimates?
I remember doing this, but it would get buggy.

Offline Tha Pwned

  • Watchdog
  • Level 7 Expert
  • *****
  • Posts: 209
  • Country: dk
  • 5% coder, 85% derp, 10% herp
Re: Why the Bots can't change their races?
« Reply #14 on: February 04, 2019, 10:15:05 PM »
In fact, in the new version by ThaPwned, it does not need any script or addons, because the bots will choose different races when they join the game
Yeah, that's actually right, in Tha Pwned's version it's a setting in the core package, I couldn't remember if he implemented that.:-)
That's correct. If you want to disable it, however, just set wcs_bot_random_race to 0 in the config.cfg file.

Has anyone ever made bots use ultimates?
I just recently (as in, yesterday) made it possible for bots to use a race's abilities/ultimates (they aren't using them in any meaningful way. Just enjoy the effects while they teleport into a wall with Human Alliance). I've only tested it with the new style races but it should work with old style races as well. If you don't like it, just set wcs_bot_ability_chance to 0 (as in, the bots having 0% chance of using an ability (0.0-1.0)) and they won't bother.
Quote from: La Muerte
17:44 - #La Muerte: FU whipe your ass so you hear better!
Quote from: La Muerte
13:41 - Muerte: what is it with you and I talking about asses in eachothers quotes?
13:41 - Muerte: ass buddies!
If you need help, got a question about Python, or just need to chat with a friendly guy, feel free to add me on Steam.