Jump to content
Sign in to follow this  
morthon

Trying to make a dynamic unit side switch switch

Recommended Posts

So I'm trying to make a script where a single switch switches a unit from Civ to East and vice versa. I want to use this as part of a script that dynamically checks certain parameters to determine on what side the unit should be on depending on its actions (for example murdering a civilian).

What I did was make two triggers on repeatedly with the following code PLAYER_RED and PLAYER_BLUE as conditions, respectively.

First trigger:
Condition: PLAYER_RED
On. Act.: hostile1 = createGroup east; [bob] joinSilent hostile1; PLAYER_BLUE=false;

Second trigger:
Condition: PLAYER_BLUE
On. Act.: neutral1 = createGroup civ; [bob] joinSilent neutral1; PLAYER_RED=false;

In the init.sqf

PLAYER_BLUE = false;

And I added an addaction to the player calling a .sqf with the following code:

if (side player == civ) then {PLAYER_RED = true;} else {PLAYER_BLUE = true;};

But alas, no big. I am really a scripting novice and I have trouble keeping information apart in my head. I don't see why this doesn't work. Could anyone please give me some advice?

Share this post


Link to post
Share on other sites

Hmm.. could be that CIV isn't working, try CIVILIAN.

Share this post


Link to post
Share on other sites

That's not it, I'm afraid, as it works fine when I trigger everything using Radio Alpha/Bravo.

Share this post


Link to post
Share on other sites
That's not it, I'm afraid, as it works fine when I trigger everything using Radio Alpha/Bravo.

Hmm, may be a locality issue try the following:

if (side player == civ) then {PLAYER_RED = true; publicVariable "PLAYER_RED";} else {PLAYER_BLUE = true; publicVariable "PLAYER_BLUE";};

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  

×