Jump to content
Sign in to follow this  

Recommended Posts

Hi,

I would like to know how to create a full working MP helicopter insertion for a Coop mission I am working on.

(I am new to Editing/scripting in Arma)

At the moment I have 4 playable units and a chopper(helicopter) with a load waypoint with this in the condition:

((!alive unit1) || (!u1) || (unit1 in helicopter)) and  ((!alive unit2) || (!u2) || (unit2 in helicopter)) and  ((!alive unit3) || (!u3) || (unit3 in helicopter)) and  ((!alive unit4) || (!u4) || (unit4 in helicopter))

I also have a trigger with this condition set as "isMultiplayer" and in the onAct field:

if (!isPlayer unit1) then {u1 = false; publicVariable "u1"} else {u1 = true; publicVariable "u1"}; if (!isPlayer unit2) then {u2 = false; publicVariable "u2"}else {u2 = true; publicVariable "u2"}; if (!isPlayer unit3) then {u3 = false; publicVariable "u3"}else {u3 = true; publicVariable "u3"}; if (!isPlayer unit4) then {u4 = false; publicVariable "u4"}else {u4 = true; publicVariable "u4"};

Now, this set up will works perfectly if i do not disable the Ai on the mission set up screen! if I disable the Ai, the Load waypoint condition does not fire!?:j:

Is there a function call I can use in the Load condition to check if "OR (!AIdisabled)" or something like that?

Share this post


Link to post
Share on other sites

How's your scripting? I have some good scripts you can use for multiplayer helo insertion and pickup.

---------- Post added at 11:09 AM ---------- Previous post was at 10:54 AM ----------

1. I created a helicopter called "helo3", controlled by AI and not playable with HeloGroup3 = group this; in its init line.

2. I then created my playable units (s1 to s6), and added "this assignAsCargo helo3;this moveInCargo helo3;" to each of their init lines. This puts them in the helicopter

3. I created a "MOVE" waypoint for helo3, with helo3 land "GET OUT"; to be executed on completion, activation radius set at 5 meters.

4. I created an invisible H pad near the move waypoint, where I want it to land.

5. I created an empty waypoint where I wanted the helicopter to return to, and called it "end_helo3";

6. I created a script, that gets activated upon mission start (could just put it in an init.sqf file):

//Wait till landed
_end = markerpos "end_helo3";
waitUntil {((position helo3 select 2) < 1)};

//Wait until boarded, time expired, or units near
_timelanded = time;
waituntil {(helo3 emptypositions "cargo" == 7) OR (time - _timelanded > 120 )};

_wp = HeloGroup3 addWaypoint [_end, 10];
_wp setWaypointStatements ["true", "deletevehicle helo3;"];
_wp setWaypointType "MOVE";

What does this do?

It causes the helicopter to fly in, land, and then remain landed but with the engine running until all the people get out (but only if it is a UH1Y, as that has seven cargo slots when empty... change this value for other helicopters!), or two minutes have passed. If either of those occur, the helicopter flies merrily away off into the sunset and then gets deleted for its trouble.

Share this post


Link to post
Share on other sites

Thanks for posting Rocket, my scripting is noobish tbh I am just trying to learn the language as I go. (I do know other scripting lauguages but I find sqf abit silly tbh lol).

I will use your concept in the future, as I have moved on from this problem due to it taking up all my free time lol. And I can not find a solution or function for "OR notAI".

Thanks anyway.

Share this post


Link to post
Share on other sites
How's your scripting? I have some good scripts you can use for multiplayer helo insertion and pickup.

---------- Post added at 11:09 AM ---------- Previous post was at 10:54 AM ----------

1. I created a helicopter called "helo3", controlled by AI and not playable with HeloGroup3 = group this; in its init line.

2. I then created my playable units (s1 to s6), and added "this assignAsCargo helo3;this moveInCargo helo3;" to each of their init lines. This puts them in the helicopter

3. I created a "MOVE" waypoint for helo3, with helo3 land "GET OUT"; to be executed on completion, activation radius set at 5 meters.

4. I created an invisible H pad near the move waypoint, where I want it to land.

5. I created an empty waypoint where I wanted the helicopter to return to, and called it "end_helo3";

6. I created a script, that gets activated upon mission start (could just put it in an init.sqf file):

//Wait till landed
_end = markerpos "end_helo3";
waitUntil {((position helo3 select 2) < 1)};

//Wait until boarded, time expired, or units near
_timelanded = time;
waituntil {(helo3 emptypositions "cargo" == 7) OR (time - _timelanded > 120 )};

_wp = HeloGroup3 addWaypoint [_end, 10];
_wp setWaypointStatements ["true", "deletevehicle helo3;"];
_wp setWaypointType "MOVE";

What does this do?

It causes the helicopter to fly in, land, and then remain landed but with the engine running until all the people get out (but only if it is a UH1Y, as that has seven cargo slots when empty... change this value for other helicopters!), or two minutes have passed. If either of those occur, the helicopter flies merrily away off into the sunset and then gets deleted for its trouble.

two questions

1) when i type in "this assignAsCargo helo3;this moveInCargo helo3;" in to the init field of each unit "EXACTLY" mind, they don't board the chopper. how do I fix this so they do get in it?

2) where do you put the script that activated upon mission start?

Share this post


Link to post
Share on other sites

I want AI soldiers board a AI HELICOPTER in a search and recue mission how can i do it??

I already have the waypoints and the H too but i don't know how the AI SOLDIERS BOARD when the heli land.

Thanks!!!

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  

×