Jump to content

Recommended Posts

I have been making a mission involving the Nimitz and a squad that is tasked to take a boat to this island (Map is Kerama Islands for those curious) and blow up AA defenses so F18s can do the rest. I have 3 objectives for the 9 man squad (Each member's Variable Name is F1-F9). The objectives are

A.) Get in the boat

B.) Unload at the shore/Rearm if needed

C.) Take down AA

 

I have C.) finished but I am having an issue with A.)

For the objective I have set down the "Create Task" module titled "Get in the ship" and its state is "Assigned" with an always visible marker on the boat. Synced to the "Create Task" module I have a Trigger that has a timer for the Objective to be assigned (Like 2 seconds just so the notification pops up). next I have the "Set Task State" module in the state of completed. There is a trigger synced to the "Set Task State" module. The Trigger has Activation set to "Any Player" and Activation Type "Present" the Condition Script box has the following code:

 

allInTheVehicle = false; while {(not allInTheVehicle)} do  {allInTheVehicle = true}; {if (!alive f1 && f2 && f3 && f4 && f5 && f6 && f7 && f8 && f9 || vehicle truck1 != myVehicle) 
 then {allInTheVehicle = false;}} forEach playableUnits; globalAllInTheVehicle = true;

 

My friend supplied me with this script but we couldn't figure out why the objective will not render as completed when all playable units take a position within the boat (Driver, Navigator, Gunners, Etc). Any help with this would be grateful since I am still new to scripting.

Edited by Tornado1001
Accidentally hit finished while writing the first time

Share this post


Link to post
Share on other sites

this condition: {_x in myBoat and alive _x} count playableUnits == {alive _x} count playableUnits;

or , if you don't care with AI units (playable but not played) , change playableUnits for allPlayers

 

  • Like 1

Share this post


Link to post
Share on other sites

The objective gets assigned then automatically succeeds without any playable units entering the boat,

Share this post


Link to post
Share on other sites

There are 2 true conditions:

- all alive playable units are in boat;

- there is no playable units, or you're trying in SP. To make it work SP/MP:

{_x in myBoat and alive _x} count playableUnits + switchableUnits == {alive _x} count playableUnits + switchableUnits;

or allplayers if you don't want to check the  AIs in group (SP = player / MP = players, at the time the cond is met.

 

Your trigger can be a simple one with no area, none activation. The condition is sufficient.

 

  • Like 1

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

×