Jump to content
Sign in to follow this  
roguetrooper

[MP] Check if player is ready to play?

Recommended Posts

Couldn't think of a self-explaining topic name...

When a multiplayer game is being loaded (also when you play alone as server) there is a black screen with "Receiving..."

The annyoing thing is that while you have this black screen the map is already running (AI moving around and shooting). As player you are stuck in that black loading screen, but your avatar is already in a "running" world... ready for being killed.

Is there any possibility to check if the player is actually in control of his avatar?

Share this post


Link to post
Share on other sites

Try something like that in a client init script, the player variable will be non-null whenever the client is controling the slot.

waitUntil {!isNull(player)};
//--- Client is in control.

Share this post


Link to post
Share on other sites

To check if the player is ready with loading, aka black screen gone and he's able to control his character, run on his machine:

waitUntil {!(isNull (findDisplay 46))};

Edited by [KH]Jman

Share this post


Link to post
Share on other sites
Jman;1850756']To check if the player is ready with loading' date=' aka black screen gone and he's able to control his character, run on his machine:

waitUntil {!(isNull (findDisplay 46))};

[/quote']

ah that's good. Thanks

Share this post


Link to post
Share on other sites

On closer inspection this piece of code doesn't seem to work. I made a hint appear on that condition and I heard the hint sound while I was still receiving for many seconds more.

Share this post


Link to post
Share on other sites

It does work, yet not the way you assume or want it to be.

Obviously the rendering has started during the receiving phase and therefore it returns true.

Simple solution: Move the player offsite during the JIP phase/processing.

Share this post


Link to post
Share on other sites

Indeed, the code waitUntil {!(isNull (findDisplay 46))} does not prevent the receiving-screen issue.

Since I am so fed up with that screen in MP (i.e. with what it causes), I am using this in my MP maps:

the last lines of init.sqf:

~0.001

_inv1 = [nil, player, "per", rHideObject, [color="Red"]true[/color]] call RE;

STARTDIRECTION = round (direction player);
STARTPOSITION0 = round (position player select 0);
STARTPOSITION1 = round (position player select 1);
STARTPOSITION2 = round (position player select 2);

STARTVALUE = STARTDIRECTION + STARTPOSITION0 + STARTPOSITION1 + STARTPOSITION2;

and ingame a trigger with:

* single activation
* condition: STARTVALUE != ( round (direction player) + round (position player select 0) + round (position player select 1) + round (position player select 2) )
* code: inv0 = [nil, player, "per", rHideObject, [color="Red"]false[/color]] call RE;

This is meant to:

* when the player char is created, he is made invisible and not shootable

* as soon as the player gives the faintest input after the receiving-screen (barely touching the mouse or a movement key), he is made visible

The receiving-screen is such an annoying bug in MP (at least all deathmatch types). Sitting in front of a black screen unable to do anything for 15 seconds while the world around you is already running. :mad:

Can't the devs implement some code like

1. waituntil { receiving-screen is gone };

2. put player into the world;

Edited by RogueTrooper

Share this post


Link to post
Share on other sites

@RogueTrooper.

I've tested the method you've suggested on our dedicated server on a few missions and found that it has an issue whereby JIP players become stuck on receiveing data and cannot connect at all. I can't tell you exactly why it's causing this but I can confirm that it's definately the cause.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×