Jump to content
Sign in to follow this  
h0rs

Respawn / JIP Help

Recommended Posts

Hey everyone,

I am having great difficulty trying to set up a specific set of conditions to allow players in a server under a dedicated server environment before the mission starts.

Description.ext settings:

disabledAI = 1;

respawn = 4;

These are the steps I would like to follow:

1) Player joins server, starts mission, is sent to "waiting" location. (Works)

2) Second player joins server, assumes role of playable unit (taking the respective slot in the multiplayer lobby)

At this stage it all appears to work fine, however, this new player is still counted as an AI if I perform the following loop in onPlayerConnected.sqf

snippet from onPlayerConnected.sqf

// Loop to find it.
{
diag_log format ["Unit Found: %1 (Player: %2)", name _x, isPlayer _x];
} forEach playableUnits;

From the .RPT file:

22:40:25 "Unit Found: James (Player: true)"

22:41:22 "Unit Found: Chrystophoros Elias (Player: false)"

The second player is my friend who joins. He appears in the same area as me, but I cannot see any of his messages in direct. I believe it is because he is still counted as an AI unit.

So my question basically is: How do I go about ensuring my friend entirely becomes that unit, rather than just being able to control his movement?

If I am missing some information please let me know and I'll dig it up :)

Thanks,

James.

Share this post


Link to post
Share on other sites
put in a condition

waituntil {IsPlayer _x};

Also the following thread may help you understand the Timing process and also an aid in future debugging

http://forums.bistudio.com/showthread.php?176096-Zeu-Debugging-Tutorial-amp-Foundation-Template

Thanks for your reply.

Unfortunately the onPlayerConnected script does not allow suspension with waitUntil { isPlayer _x };

If I pass this onto another script, I get a syntax error:

0:18:36 Error in expression <format ["Processing %1", _x];

[_x] execVM "scripts\processPlayer>

0:18:36 Error position: <] execVM "scripts\processPlayer>

0:18:36 Error Missing ]

The code causing the error is:

[_x] execVM "scripts\processPlayer.sqf";

Which would work in any other circumstance.

_x of course representing the names of the playable units (in editor): player1, player2 etc.

Is there something I'm doing wrong here? Or must I pass this off to another script differently (other than execVM?)

EDIT: Works when I use [] execVM "scripts\processPlayer.sqf";

Have to test whether other players are processed correctly now.

Edited by h0rs

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  

×