Raised This Month: $51 Target: $400
 12% 

Solved CT bots that are respawned after bomb plant are frozen - fix?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin
Senior Member
Join Date: Oct 2005
Old 04-06-2023 , 13:54   CT bots that are respawned after bomb plant are frozen - fix?
Reply With Quote #1

I have a bot server where I wrote a respawn plugin.
I use this to do the respawns
CS_RespawnPlayer(client);

Everything is working except that CT bots that spawn after the bomb is planted don't move until you shoot them or go up to them and start interacting with them.

I have a way to know which bots are stuck.
I save off their position when I respawn them and set a timer for a few seconds on them.
When this timer fires I check their current position with the saved one and if it is the same (or very close to the same) location they are "stuck".

What I need help with is what should I do to the bots in the script to wake them up?

I have their client ID in the stuck timer check but can someone show me how to wack them or whatever to try to get them moving?

tx

Last edited by Austin; 04-30-2023 at 06:29.
Austin is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 04-06-2023 , 15:12   Re: CT bots that are respawned after bomb plant are frozen - fix?
Reply With Quote #2

This problem with AI code, I have fix but only for money
Vit_amin is online now
Austin
Senior Member
Join Date: Oct 2005
Old 04-07-2023 , 13:06   Re: CT bots that are respawned after bomb plant are frozen - fix?
Reply With Quote #3

I added the following slap right after respawing them and they seem to not be getting stuck now,
but then for testing I took this code OUT and they still! seem to not be getting stuck now.

Maybe this is a map specifice thing?
Maybe it only happens if more than one human is on the server?
I have more testing to do obviously.

But thanks for the reply.

PHP Code:
CS_RespawnPlayer(client);

if(
IsFakeClient(client) && GetClientTeam(client) == && bombIsPlanted)
    
SlapPlayer(client0); 

Last edited by Austin; 04-07-2023 at 13:07.
Austin is offline
Austin
Senior Member
Join Date: Oct 2005
Old 04-25-2023 , 17:41   Re: CT bots that are respawned after bomb plant are frozen - fix?
Reply With Quote #4

This is definitely not solved.

I tried all sorts of things and nothing works 100%.
Some percent of the CT bots that are
CS_RespawnPlayer(client);
after the bomb plant are stuck.

I noticed if I walk up to them from behind when they hear my footsteps they wake up
so I tried playing footsteps sounds near them after re spawing but it doesn't wake them up.

One clue that I noticed while testing is
All bots added with

Bot_add_ct
After the bomb plant will be added to the server dead.

Bot_add_ct
Before the bomb plant adds them alive.

Vit_amin
Does your fix require using the newer
mp_bot_ai_bt "//scripts/ai..."
I am not using that but getting more interested in checking it out.

Anyone?
Austin is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 04-26-2023 , 00:38   Re: CT bots that are respawned after bomb plant are frozen - fix?
Reply With Quote #5

My fix using setup some memory CCSBot variables. Not behavior tree AI
Vit_amin is online now
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 04-26-2023 , 12:16   Re: CT bots that are respawned after bomb plant are frozen - fix?
Reply With Quote #6

Are you using the CS:GO command to add bots to the server or are you creating fake clients by yourself?

Creating fake clients is kinda messy as you can spawn the bots but they won't move. Adding bots through the existing game command should make them move around
__________________

Last edited by SpirT; 04-26-2023 at 12:16.
SpirT is offline
Austin
Senior Member
Join Date: Oct 2005
Old 04-26-2023 , 13:02   Re: CT bots that are respawned after bomb plant are frozen - fix?
Reply With Quote #7

Quote:
Originally Posted by SpirT View Post
Creating fake clients is kinda messy as you can spawn the bots but they won't move. Adding bots through the existing game command should make them move around
Thanks for the reply.
I am aware of the fake client problem.
This is a totally different problem.

I am using
CS_RespawnPlayer(client);
and I have tried instead of respawning them,
kicking the bot that is being respawned and then using
ServerCommand("bot_add_ct");

For this problem,
It only affects CT bots added or respawned after the bomb is planted.

After the Bomb is Planted:
1) ct bots added using bot_add_ct are added to the server dead instead of alive
2) CS_RespawnPlayer(client); Some percent of the bots will be stuck until somethign interacts with them.
Austin is offline
Austin
Senior Member
Join Date: Oct 2005
Old 04-30-2023 , 06:56   Re: CT bots that are respawned after bomb plant are frozen - fix?
Reply With Quote #8

I found this post with a fix for this.
https://forums.alliedmods.net/showthread.php?t=321011

This definitely fixes the ct bots that respawn after the bomb plant are sometimes stuck problem.

Thanks goes out to backwards for this code / idea.

PHP Code:
if(IsFakeClient(client) && bombIsPlanted)
{
    
CS_RespawnPlayer(client);
    
ent = -1;
    
ent FindEntityByClassname(ent"planted_c4");
    if(
ent != -1)
    {
        
float c4_position[3];
        
float player_position[3];
        
GetEntPropVector(ent,            Prop_Send"m_vecOrigin"c4_position);
        
GetEntPropVector(client,    Prop_Send"m_vecOrigin"player_position);
        
TeleportEntity(clientc4_positionNULL_VECTORNULL_VECTOR);
        
        
Event BombPlanted CreateEvent("bomb_planted");
        if(
BombPlanted != null)
        {
            
SetEventInt(BombPlanted"userid"client);            
            
SetEventInt(BombPlanted"site"bombSite);
            
FireEvent(BombPlantedtrue);
        }
        
TeleportEntity(clientplayer_positionNULL_VECTORNULL_VECTOR);
    }
}
else
{
    
CS_RespawnPlayer(client);
    
ent = -1;
    
ent FindEntityByClassname(ent"weapon_c4");
    if(
ent != -&& (GetRandomInt(110) <= 7))
    {
        
//DebugLog("Found weapon_c4");
        
float c4_position[3];
        
float player_position[3];
        
GetEntPropVector(ent,            Prop_Send"m_vecOrigin"c4_position);
        
GetEntPropVector(client,    Prop_Send"m_vecOrigin"player_position);
        
TeleportEntity(clientc4_positionNULL_VECTORNULL_VECTOR);
        
TeleportEntity(clientplayer_positionNULL_VECTORNULL_VECTOR);
    }            

I noticed a side effect this has is the bots really go for the bomb now so I am not limiting this to just CT bot but also T bot so the respawned T bots now "report in" better to the planted bomb site.

This made me think it might make for even better game play if I also did this for respawned bots "showing" them where the bomb is when dropped and being carried.

It works!
In fact it works too good and I had to put in a random chance and bump it down to only showing the non planted bomb 70% of the time.

This significantly improves the bot game play when the bomb is planted or not!

Last edited by Austin; 04-30-2023 at 07:05.
Austin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode