Jump to content

Recommended Posts

Anyone know why this is not working?

while {alive player} do { 
{player disableUAVConnectability [_x,true]} foreach allUnitsUAV;
waituntil {isPlayer s08 || isPlayer s17};
{player enableUAVConnectability [_x,true];} foreach allUnitsUAV;
waituntil !{isPlayer s08 || isPlayer s17};
{player disableUAVConnectability [_x,true]} foreach allUnitsUAV;
};

Share this post


Link to post
Share on other sites

Anyone know why this is not working?

while {alive player} do { 
{player disableUAVConnectability [_x,true]} foreach allUnitsUAV;
waituntil {isPlayer s08 || isPlayer s17};
{player enableUAVConnectability [_x,true];} foreach allUnitsUAV;
waituntil !{isPlayer s08 || isPlayer s17};
{player disableUAVConnectability [_x,true]} foreach allUnitsUAV;
};

waituntil !{} should give you error. What .rpt file says?

Share this post


Link to post
Share on other sites

So this is being run locally cause your using 'player'. How are u running this code?

 

Why are you checking if the player is different?

 

What is the expected outcome?

Share this post


Link to post
Share on other sites

I'll check rpt and report back.  You are correct though, the waituntil is throwing the error.

 

Sorry, what i am attempting to do is make it so that only 2 of my squad mates can use UAV options.  Others will be disabled.  This is SP and teamswitch is enabled.  So when i switch to units s08 OR s17, the UAV options are available, otherwise all UAVs are disabled.  I also need it to check throughout missions as new UAVs can be spawned/created and i want those disabled as well.  For example, if player adds UAV backpack, then that also should not work on next check.

Share this post


Link to post
Share on other sites

Rpt file shows:

18:21:15 Error in expression <h allUnitsUAV; 
waituntil {isPlayer s08 || isPlayer s17}; 
{player enableUAVConn>
18:21:15   Error position: <|| isPlayer s17}; 
{player enableUAVConn>
18:21:15   Error Generic error in expression
18:21:15 Error in expression <true];} foreach allUnitsUAV; 
waituntil !{isPlayer s08 || isPlayer s17}; 
{playe>
18:21:15   Error position: <!{isPlayer s08 || isPlayer s17}; 
{playe>
18:21:15   Error !: Type code, expected Bool

Share this post


Link to post
Share on other sites

As Killzone Kid pointed out, your waitUntil is wrong, the ! was outside the code block.

waituntil {!(isPlayer s08 || isPlayer s17)};

The logic for this is going to fail though.  If someone is logged in as s08 and you log in as s01, it's going to detect that s08 is a player and attach the UAVs to you, the player, as s01.  This is because isPlayer is global so as long as someone is playing those slots, it'll be true for everyone.

Share this post


Link to post
Share on other sites

As Killzone Kid pointed out, your waitUntil is wrong, the ! was outside the code block.

waituntil {!(isPlayer s08 || isPlayer s17)};

The logic for this is going to fail though.  If someone is logged in as s08 and you log in as s01, it's going to detect that s08 is a player and attach the UAVs to you, the player, as s01.  This is because isPlayer is global so as long as someone is playing those slots, it'll be true for everyone.

Ah dumb me.  I tried so many different combinations and different codes.

 

So is there no other code i can run to check for this?  I tried combinations of (player == s**), getunittrait == UAVHACKER, etc.. with no luck.  Basically i was just hoping to only only certain units the ability to use UAV units as a restriction for enhanced gaemplay...but not a deal breaker.  I know I can do the below for each unit, but my thing is if they spawn a UAV, or add UAV backpack, then new UAVs will be available.

 

{s01 disableUAVConnectability [_x,true]} foreach allUnitsUAV;

{s02 disableUAVConnectability [_x,true]} foreach allUnitsUAV;

etc...

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

×