Jump to content
Sign in to follow this  
roguetrooper

When is (alive player) true in MP?

Recommended Posts

I am not aiming at the lifestatus, but when does the condition "alive player" return true for the first time in multiplayer?

When he has clicked away the briefing map? or

When he is actually controlling his avatar?

For certain reasons I want the players in MP to be invisible and indestructable for a few seconds when they join the game (especially JIP) and when they respawn:

I have a trigger with

multiple activation
condition: alive player
[0] exec "activate.sqf";

When a certain condition is met after a few seconds, "he" executes

[1] exec "activate.sqf";

activate.sqf:

_parameter = _this select 0;

if (_parameter == 1) then { goto "status1" } else { goto "status0" };
exit;

#status1
0 fadesound 1;
"colorCorrections" ppEffectEnable false;
player allowdamage true;
player enableSimulation true;
inv0 = [nil, player, "per", rHideObject, false] call RE;
cap0 = [nil, player, "per", rsetCaptive, false] call RE;
exit;

#status0
0 fadesound 0;
"colorCorrections" ppEffectEnable true;
player allowdamage false;
player enableSimulation false;
inv1 = [nil, player, "per", rHideObject, true] call RE;
cap1 = [nil, player, "per", rsetCaptive, true] call RE;
exit;

For some unknown reason some jip-players do not get invisibilized/immortalized. In my imagination, when a player joins a game and his client comes across the trigger with "alive player", he should execute it (?) I know, that there may be a gap of 0.5 seconds until the trigger triggers, but that's not the cause for the non-execution of the code in my opinion. How long does "RE" take to be initialized? Aren't a few 10th seconds enough?

Edited by RogueTrooper

Share this post


Link to post
Share on other sites

because you combine sqs and sqf, stick to one type.

goto is sqs, also exit

Ive seen alot of people combine both lately, is this because of old guides like Mr Murrays or something else messing with the heads of the community?

Share this post


Link to post
Share on other sites

Mix of old guides and old threads. It's interesting though, because some of you guys who have been around scripting before .sqf say the hell with .sqs. Fine by me, just interesting.

Anyway, definitely stick to .sqf. Also, would it not work if you just execute it locally from a script? Just seems like that would be easier in this case.

Share this post


Link to post
Share on other sites

Why then does the code run fine without any ingame or rpt- error messages? Why then does it work fine for the host and some clients?

Share this post


Link to post
Share on other sites

Perhaps RE isn't ready yet when the trigger triggers.

Add a diag_log to the trigger / scripts to log information to the rpt and figure out what's going on.

e.g diag_log [player, "RE:", RE];

I bet it will show [Playername blalbalbal, "RE:", nil]

Share this post


Link to post
Share on other sites

Putting

waitUntil{!(isNil "BIS_MPF_InitDone")};

at the top of your script should ensure that RE works as it should. Also don't forget the Functions module.

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  

×