Hey guys -
I don't know if I should post this in scripting or in here (or in tutorials... since my issue actually comes from a tutorial...) but anyway...
I am making a very barebones multiplayer script. The script basically just creates cbabe at a random location when you connect. This code is a stripped down version of Locoweed's MP tutorial (which I have loved other than this issue.)
So... in the code there is a spot in "main" where if you are a client, you wait for "server_says_start" to be true. In the server_called event, we set that variable to true and then do a send variable. So... the client sees:
if(connection == 2) //connection is a client
{
while (server_says_start == FALSE) // wait for server to signal ok
{
wait(1);
}
}
and the server sees:
if ((event_type == event_join) && (people_connected <= MAX_CONNECTIONS))
{
ifdef server;
people_connected += 1; // another person connected
send_var(people_connected); // send number of people connected
server_says_start = TRUE; // send it's ok to go to newest client
send_var(server_says_start); // send start message
endif; // ifdef server
}
Again, this is all from Locoweed's tutorial.
However, what I'm seeing is that if you start one host, then one client, the client is stuck in that while loop. The client somehow misses the "server_says_start" being set to true.
However, if you start a second client... that second client gets stuck in the while loop, but the first client get the send_var from the second client joining.
Isn't this strange? What am I doing wrong?
Anyone who would like to see the whole small project, it is here:
http://www.iamimmortal.com/3dgs/launch.zipThanks, everyone!
Paul