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?
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
if you are testing on zombie mod, set autoassign 0
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
What do you need ? Here is my Callback_PlayerConnect:And testclient script: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);
[...]
PHP Code:
addTestClients() //called on Callback_StartGameType
{
//level waittill("connected");
wait 1;
if(!level.debug)
return;
for(i = 0; i < level.debug_clients; i++)
{
ent[i] = addTestClient();
if(!isDefined(ent[i]))
continue;
ent[i] thread 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
Try this:
PHP Code:
addTestClients() //called on Callback_StartGameType
{
//level waittill("connected");
wait 1;
if(!level.debug)
return;
for(i = 0; i < level.debug_clients; i++)
{
ent[i] = addTestClient();
if(!isDefined(ent[i]))
continue;
ent[i] thread testClientInit( "axis" );
}
}
testClientInit( team )
{
while( !isdefined( self.pers["team"] ) )
wait( 0.05 );
self notify( "menuresponse", game["menu_team"], team );
wait( 0.5 );
self notify( "menuresponse", game["menu_weapon_axis"], "knife_mp" );
}
wouldnt that explain it?What do you need ? Here is my Callback_PlayerConnect:PHP Code:
Callback_PlayerConnect()
{
waittillframeend;
...
}
i wouldnt do anything before the begin-notify
RobsoN (15th October 2013)
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"])
RobsoN (15th October 2013)
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