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

[CS:S/CS:GO] Bot Attack Control


Post New Thread Reply   
 
Thread Tools Display Modes
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 09-04-2013 , 11:18   Re: [CS:S/CS:GO] Bot Attack Control
Reply With Quote #21

Quote:
Originally Posted by senecas View Post
CS:GO Server Crash with this ext.

Today's Update + metamod 1.10 + sm 1.5 or 1.6 => crash
Still working for me on Windows. At which point does it crash your server? Windows/Linux?
__________________
GoD-Tony is offline
senecas
Senior Member
Join Date: Jun 2006
Old 09-04-2013 , 20:55   Re: [CS:S/CS:GO] Bot Attack Control
Reply With Quote #22

linux
crash after csgo latest update. only changing is csgo update.
Crash with this ext, If I remove it, it's Ok.

Can you check on linux server ?

something's wrong with this csgo update 1.30.2.1.
In my minigame server, atfer update,
mg_multigames_devine_or_guess map crash with ED_Alloc: no free edicts atfer bot or player joining.
senecas is offline
senecas
Senior Member
Join Date: Jun 2006
Old 09-10-2013 , 23:57   Re: [CS:S/CS:GO] Bot Attack Control
Reply With Quote #23

I Fixed it out...

cssdm_ffa_enabled 1 -> 0

That cvar make server-crashing when bot is damaged by teammate.
senecas is offline
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 09-15-2013 , 17:57   Re: [CS:S/CS:GO] Bot Attack Control
Reply With Quote #24

Hello, I can't seem to get this working correctly.. I think I done it wrong

PHP Code:
public Action:OnShouldBotAttackPlayer(botplayer, &bool:result)
{
    
    for(new 
1<= MaxClientsi++)
    {
        if(
Client_IsValid(i))
        {
            if(
IsFakeClient(i))
            {
                
bot i;
            }
            else
            {
                
player i;
                
                if(
isSpawnKillProtected[player] == true){
                    
result false;
                }
                else
                {
                    
result true;
                }
            }
        }
    }

I'm trying to make all bots not attack players with the bool isSpawnKillProtected true. And when it goes false then attack again.

PHP Code:
EnableKillProtection(client
{
    if(
Client_IsValid(client))
    {
        if( !
IsFakeClientclient) )
        {
            
isKillProtected[client] =  true;
            
lastPlayerHealth[client] = Entity_GetHealth(client);
            
Entity_SetHealth(clientPROTECTED_HEALTHtrue);
            
            
CreateTimer(GetConVarFloat(zr_protect_time), Timer_DisableSpawnProtectionclientTIMER_FLAG_NO_MAPCHANGE);
        }
    }
}

DisableKillProtection(client)
{    
    
isKillProtected[client] =  false;
    
isSpawnKillProtected[client] = false;
    
Entity_SetHealth(clientlastPlayerHealth[client], true);
    
    
PrintHintText(client"[WARNING] Spawn Protection is now OFF!");

SM9 is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 09-16-2013 , 01:10   Re: [CS:S/CS:GO] Bot Attack Control
Reply With Quote #25

Quote:
Originally Posted by xCoderx View Post
Hello, I can't seem to get this working correctly.. I think I done it wrong

I'm trying to make all bots not attack players with the bool isSpawnKillProtected true. And when it goes false then attack again.
You shouldn't need a loop there. The forward will be called for all bots checking against all players. Also, don't forget to return Plugin_Changed if you're changing the result param:
PHP Code:
public Action:OnShouldBotAttackPlayer(botplayer, &bool:result)
{
    if (
isSpawnKillProtected[player] == true) {
        
result false;
    } else {
        
result true;
    }
    
    return 
Plugin_Changed;

In your EnableKillProtection function, are you forgetting to set isSpawnKillProtected to true?
__________________

Last edited by GoD-Tony; 09-16-2013 at 01:36.
GoD-Tony is offline
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 09-16-2013 , 03:13   Re: [CS:S/CS:GO] Bot Attack Control
Reply With Quote #26

Quote:
Originally Posted by GoD-Tony View Post
In your EnableKillProtection function, are you forgetting to set isSpawnKillProtected to true?
Woops, Good spot!

And it works perfectly now, thanks

Edit: Does this mean I can use "Bot" as a default index for any bots instead of running a loop in my functions or using "IsFakeClient" to determine bots from normal players?

Last edited by SM9; 09-16-2013 at 03:33.
SM9 is offline
alencore
Senior Member
Join Date: Oct 2011
Old 11-15-2013 , 07:24   Re: [CS:S/CS:GO] Bot Attack Control
Reply With Quote #27

Wow finally css bots finally can do real FFA game play...thank you very much!
alencore is offline
weeb1e
SourceMod Donor
Join Date: Sep 2011
Old 04-18-2014 , 20:21   Re: [CS:S/CS:GO] Bot Attack Control
Reply With Quote #28

There seems to be some kind of flaw with these hooks when used to limit a bot to a single target on CS:GO, the bot will fire at other players randomly even though the forward says it shouldn't.

I'm not sure if this has always been the case with CS:GO, or if valve changed something, such as adding another condition somewhere, after this was implemented.
weeb1e is offline
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 05-12-2014 , 15:32   Re: [CS:S/CS:GO] Bot Attack Control
Reply With Quote #29

Any way to port this to TF2?
El Diablo War3Evo is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 05-13-2014 , 16:21   Re: [CS:S/CS:GO] Bot Attack Control
Reply With Quote #30

Quote:
Originally Posted by El Diablo War3Evo View Post
Any way to port this to TF2?
I'm sure it would be technically possible, but tf2 bots do act differently, in fact their are two different types of bots, and the ones that actually move are considered tfbots
maybe look into the "bot_controller"
just catch it on EntityCreated
each bot should have one ( assumption )
Mitchell is offline
Reply


Thread Tools
Display Modes

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 14:29.


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