Jump to content
Sign in to follow this  
NickThissen

Join two separate squads

Recommended Posts

Hi,

I am building a mission where two squads (two groups of three players each) start some distance away from each other. Part of the mission is to find your teammates (the other squad) and then continue together. I would like to join the two squads in the middle of the game, is that possible?

The mission is build so that one squad is flying a helicopter (manually, not scripted) and has to land at an LZ where the other squad should be waiting. When the helicopter lands (or maybe when a member of squad 1 is 'close enough' to a member of squad 2) I want the squads to 'merge' into one squad, so that we can all see each other on the map and stuff like that. Right now while landing the helicopter I cannot see the other squad and it's very easy to mistake them for enemies (this is fine, I actually like this!) but after I have landed and we have 'regrouped' at the helicopter I want to merge the squads so we can continue as one.

Is this possible? Thanks.

Edit:

I searched and found the joinSilent command, have tried it but it doesn't seem like anything is happening. I've made a test mission with two squads opposite each other and a trigger in the middle, with the trigger calling 'this joinSquad p1' on activation. 'p1' is the name of the squad leader of the other squad. Nothing happens when I hit the trigger...

Edited by NickThissen

Share this post


Link to post
Share on other sites

It is – in fact you can even do that with simple waypoints.

I dont know it by heart, but if you look at the different waypoint-types it should be fairly obvious.

Share this post


Link to post
Share on other sites

You can use the waypoint join or join and lead, You will need to synchronize the join waypoint to the last move waypoint of the group you want to join.

Edited by Anthonyfromtheuk

Share this post


Link to post
Share on other sites

Yeah I found the JOIN waypoint. But all soldiers are (in principle) controllable by human players (or AI), so I guess waypoints aren't possible to use?

Anyway I managed to do it with the trigger afterall, used the join command instead of joinSilent, and also listed the players manually:

[p1, p2, p3] join (p4);

(p4 is the squad leader of the other squad).

That works!

Now I gotta figure out a way to trigger this when the squads are close to each other. I am thinking use a trigger that fires when all players are inside it. I've done this before by listing all players in a similar way... But then what if some players are missing (eg dead or never joined if I don't play with AI)? Will the trigger recognize this and still fire?

Share this post


Link to post
Share on other sites

Name the group then put that in trigger condition ({alive _x} count units group1) < 1; i think...No i misunderstood i dont think thats right ill leave it for someone who knows what they are talking about.

---------- Post added at 18:52 ---------- Previous post was at 18:49 ----------

so I guess waypoints aren't possible to use?

Waypoints do still work with humans

Share this post


Link to post
Share on other sites

I don't understand how waypoints should work with human controlled players :/

Anyway, this may be getting off topic, but I have two scenarios that are acceptable for when the join should happen:

1) Trigger it as soon as the helicopter lands. No idea how to trigger something when a vehicle lands though... Trigger for a specific unit and a specific height (0) ?

2) Trigger it when every player is inside a certain trigger radius. Here I have the problem with variable number of players. There are 6 playable characters but the mission can be played already with 2 (and no AI). And 4 of the 6 players are 'expendable', if they die the mission can continue, but then that trigger that's checking for 6 players won't fire?

Share this post


Link to post
Share on other sites

you can group the heli to the trigger you want and set the trigger to present. When the a human player walks in to the trigger area the join waypoint is "activated" and the AI joins the human player so long as the AI is at the waypoint that the join is synchronized to. (hope that makes sense)

I did have the code for checking if players are alive aaages ago i used it in arma 2 for helicopter extraction perhaps searching heli extraction may give you the code you need

Edited by Anthonyfromtheuk

Share this post


Link to post
Share on other sites

To check if any member of a group is within a certain range of any member of another group, you can do this:

0 = [] spawn { 
       waituntil { 
               sleep 1; 
               {_unit = _x; {_unit distance (position _x) < 50} count (units [b]grp2[/b]) > 0} count (units [b]grp1[/b]) > 0
       }; 
              [color="#B22222"] hint "Group 1 has found Group 2!";[/color]
};

Best to put that in a script file or maybe the init. It waits until any units from the groups called grp1 and grp2 are within 50m of each other, then where the hint line is, you can do stuff like make them join up, etc.

Edited by 2nd Ranger

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  

×