Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: TestClients

  1. #1
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts

    TestClients

    Hello everyone. Can you tell me where is a notify about "begin" (in Callback_PlayerConnect) ? My TestClients Bots can't pass it, but in older mod they could. What's wrong then?
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    if you are testing on zombie mod, set autoassign 0

  3. #3
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    I don't think so autoassign have something to that. I deleted basic functions, and rewrited to my ones with deleting some useless stuff for me, so I could have missed something.
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  4. #4
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by RobsoN View Post
    I don't think so autoassign have something to that. I deleted basic functions, and rewrited to my ones with deleting some useless stuff for me, so I could have missed something.
    You know the golden rule - post your script. We can't see if there is a mistake without seeing the code itself.

  5. #5
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    What do you need ? Here is my Callback_PlayerConnect:
    PHP Code:
    Callback_PlayerConnect()
    {
        
    waittillframeend;

        if(
    isdefined(self))
        {
            
    level notify("connecting"self);
            
    level thread [[level.functions["onEvent"]]]("onPlayerConnecting"self);
        }
        
        
    // Before Connect
        
    self.statusicon "hud_status_connecting";
        
    self setClientCvar("download","Copyrights of extreme~Modding Team");
        
    iprintln("Connecting "+self.name);
        
    self waittill("begin");
        
    self.statusicon "";
        
    iprintln("Connected "+self.name); //cant see this debug
        // After Connect
        
    level notify("connected"self);
        
    level thread [[level.functions["onEvent"]]]("onPlayerConnect"self);
            [...] 
    And testclient script:
    PHP Code:
    addTestClients() //called on Callback_StartGameType
    {
        
    //level waittill("connected");
        
        
    wait 1;
        
        if(!
    level.debug)
            return;
        
        for(
    0level.debug_clientsi++)
        {
            
    ent[i] = addTestClient();
            
            if(!
    isDefined(ent[i]))
                continue;
        
            
    ent[ithread testClientInit();
        }
    }
    testClientInit()
    {
        
    self.pers["team"] = "axis";
        
    self.pers["primary_weapon"] = "knife_mp";
        
    self.data["bot"] = true;
        
    self.statusicon "";
        
    self thread maps\mp\gametypes\_zom::spawnPlayer();

    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  6. #6
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Try this:

    PHP Code:
    addTestClients() //called on Callback_StartGameType
    {
        
    //level waittill("connected");
        
        
    wait 1;
        
        if(!
    level.debug)
            return;
        
        for(
    0level.debug_clientsi++)
        {
            
    ent[i] = addTestClient();
            
            if(!
    isDefined(ent[i]))
                continue;
        
            
    ent[ithread testClientInit"axis" );
        }
    }

    testClientInitteam )
    {
        while( !
    isdefinedself.pers["team"] ) )
            
    wait0.05 );

        
    self notify"menuresponse"game["menu_team"], team );
        
    wait0.5 );
        
    self notify"menuresponse"game["menu_weapon_axis"], "knife_mp" );


  7. #7
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    What do you need ? Here is my Callback_PlayerConnect:
    PHP Code:
    Callback_PlayerConnect()
    {
        
    waittillframeend;
    ...

    wouldnt that explain it?
    i wouldnt do anything before the begin-notify

  8. #8
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by serthy View Post
    wouldnt that explain it?
    i wouldnt do anything before the begin-notify
    No, I believe the problem is that the bots aren't given their notifications as they pass through the menus. They notify first for team, then for team weapons. If you don't do them, they wont spawn.

  9. The Following User Says Thank You to Tally For This Useful Post:

    RobsoN (15th October 2013)

  10. #9
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    CoD2 is really sensitive with waittillframeend; when it comes to spawnplayer() function. Try adding waittillframeend; or just a plain wait .05 before doing anything with your bot (that includes setting the .pers["team"])

  11. The Following User Says Thank You to IzNoGoD For This Useful Post:

    RobsoN (15th October 2013)

  12. #10
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    Thanks for the quick reply, I tried your ideas, but nothing has changed.
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •