Raised This Month: $ Target: $400
 0% 

[L4D2] add bot problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cigs
Senior Member
Join Date: Jul 2006
Old 03-02-2010 , 16:51   [L4D2] add bot problem
Reply With Quote #1

I'm using this to add a bot (spawn and kick fakeclient), which works fine whenever I'm near any info_survivor_position entities in the beginning of each map. For some reason, when I'm too far away from those entities, I can't spawn any more additional bots. Instead it adds a fakeclient and shows it as a DEAD survivor.

I allready tried creating an additional info_survivor_position and change it's coordinates every 10 seconds to the origin of an alive survivor. But that didn't help. :/

I tried searching for a cmd that limits the range between survivor and spawnpoint, but didn't find one.
Any ideas on how I can spawn that bot on demand?

PHP Code:
bool:SpawnFakeClient()
{
    new 
bool:fakeclientKicked false
    
    
// create fakeclient
    
new createdFakeclient 0
    createdFakeclient 
CreateFakeClient("FakeClient")
    
    
// if entity is valid
    
if (createdFakeclient != 0)
    {
        
// move into survivor team
        
ChangeClientTeam(createdFakeclientTEAM_SURVIVORS)
        
        
// check if entity classname is survivorbot
        
if (DispatchKeyValue(createdFakeclient"classname""survivorbot") == true)
        {
            
// spawn the client
            
if (DispatchSpawn(createdFakeclient) == true)
            {    
                
// kick the fake client to make the bot take over
                
CreateTimer(DELAY_KICK_FAKECLIENTTimer_KickFakeBotcreatedFakeclientTIMER_REPEAT)
                
fakeclientKicked true
            
}
        }            
        
// if something went wrong, kick the created FakeClient
        
if (fakeclientKicked == false)
            
KickClient(createdFakeclient"Kicking FakeClient")
    }
    
    return 
fakeclientKicked

__________________
cigs is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 03-03-2010 , 13:08   Re: [L4D2] add bot problem
Reply With Quote #2

Try teleporting a random Survivor back and forth while spawning a new one?
AtomicStryker is offline
cigs
Senior Member
Join Date: Jul 2006
Old 03-03-2010 , 13:18   Re: [L4D2] add bot problem
Reply With Quote #3

Since I installed Infected Bots plugin it seems to work without any tricks. I haven't found why it works with that plugin and not without though.
__________________
cigs is offline
EHG
Senior Member
Join Date: May 2009
Location: 127.0.0.1
Old 03-09-2010 , 08:02   Re: [L4D2] add bot problem
Reply With Quote #4

Quote:
Originally Posted by cigs View Post
Since I installed Infected Bots plugin it seems to work without any tricks. I haven't found why it works with that plugin and not without though.
If you find why please do post. I am also interested in this.
When I get home I will test this further.
EHG is offline
cigs
Senior Member
Join Date: Jul 2006
Old 03-09-2010 , 08:09   Re: [L4D2] add bot problem
Reply With Quote #5

I haven't found why yet and I really need to know why because my plugin doesn't function without l4dinfectedbots.smx now.
__________________
cigs is offline
mi123645
Veteran Member
Join Date: Feb 2009
Old 03-09-2010 , 18:10   Re: [L4D2] add bot problem
Reply With Quote #6

z_spawn_flow_limit 50000

No idea why, but it just is.
mi123645 is offline
cigs
Senior Member
Join Date: Jul 2006
Old 03-09-2010 , 18:12   Re: [L4D2] add bot problem
Reply With Quote #7

Allright. Going to test it straight away.
I appreciate you looking at the topic, mi123645. Thanks!
__________________
cigs 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 20:43.


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