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)
They are spawning (self thread maps\mp\gametypes\_zom::spawnPlayer(); ) but one weird thing is, they have still connecting status icon, even i changed it to "" ( self.statusicon = ""; ) Btw, scripts wont work correctly on bots, because script are still waiting for connected player... (stuck on self waittill("begin") )
"Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right
just use the default callback_playerconnected() procedure (or the slightly modified one below)
add a shitload of debug-iprintln()'s in combination with getTime() to see where it stucks and whyCode:Callback_PlayerConnect() { self endon( "disconnect" ); self thread notifyConnecting(); self.statusicon = "hud_status_connecting"; self waittill( "begin" ); self.statusicon = ""; waittillframeend; //...do your callback catching stuff here, AFTER everything went fine } notifyConnecting() { self endon( "disconnect" ); self endon( "begin" ); waittillframeend; if( isDefined( self ) ) { level notify( "connecting" , self ); } }
RobsoN (15th October 2013)