Forum Jump :

Author Message


Posts: 6
Rank:


Level: Member

Country: uk
Location: Lincs
Occupation: Warehouse op.
Age: 35
In-game name:

 
#1 Posted at 2013-07-14 18:17        
     
I can make the Apache unit leave my group on a trigger but the gunner remains in my group.

How do I name the unit who is the Apache gunner so that I can make him leave my group along with the pilot after a trigger?

Edit: I just tried moving a pilot and gunner into an empty helicopter which works but then they aren't part of my group anymore.

What I want to achieve is on the death of one of my squad (the ai jtac) I want the Apache to leave my group.

Edit2: I just used a join waypoint to make the helicopter join my group and as both units had names I was able to make them both leave my group on the trigger. I assume making them both join groupnull means they aren't actually in the same group as each other once they leave. Can I make a new group that they both become in?

This post was edited by jeproject (2013-07-14 18:36, ago)


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 43
In-game name: kylania

 
#2 Posted at 2013-07-14 18:51        
     
So you want to have a group of you, a JTAC and an Apache but when the JTAC dies the Apache leaves and disappears or stays just as a different group?


Advertisement


Author Message


Posts: 6
Rank:


Level: Member

Country: uk
Location: Lincs
Occupation: Warehouse op.
Age: 35
In-game name:

 
#3 Posted at 2013-07-14 19:04        
     
I'd rather have it fly off back to base or something. At the minute when the pilot and gunner are assigned to groupnull they land straight away and get out.


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 43
In-game name: kylania

 
#4 Posted at 2013-07-14 20:32        
     
Ok. Name your JTAC as jtac. Name your helo as knope.

Then where you want the helo to fly away to place a Rifleman. Give him a nearby MOVE waypoint.
Rifleman init:
offStation = group this; deleteVehicle this;

OnAct of his waypoint:
cleanUpveh = vehicle leader this; {deleteVehicle _x} forEach crew cleanUpveh + [cleanUpveh]

Then place a trigger.
Condition of:
!alive jtac

onAct of:
leavingGroup = createGroup west; {[_x] joinSilent leavingGroup} forEach crew knope; leavingGroup copyWaypoints offStation;

What should happen is when JTAC dies your pilot and gunner from the helo will join the new group called leavingGroup. They'll then copy the waypoints from the rifleman we placed earlier so it'll move to that MOVE waypoint. Once there it executes the code to delete its crew and itself.

This post was edited by Pirin (2013-07-14 22:40, ago)


Author Message


Posts: 6
Rank:


Level: Member

Country: uk
Location: Lincs
Occupation: Warehouse op.
Age: 35
In-game name:

 
#5 Posted at 2013-07-14 21:22        
     
Thanks for the quick reply, I tried it and it isn't working. I copied and pasted the commands you gave.

Nothing happens to the chopper at all. It just stays in the group with me after I've shot the jtac. (he died for a good cause!"


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 43
In-game name: kylania

 
#6 Posted at 2013-07-14 22:40        
     
Oh sorry! This is for ArmA2. Change the word "blufor" to "west" in the trigger and try again. :)


Author Message


Posts: 6
Rank:


Level: Member

Country: uk
Location: Lincs
Occupation: Warehouse op.
Age: 35
In-game name:

 
#7 Posted at 2013-07-14 22:57        
     
Friggin A mate. Works great. Next step will be going through all the commands so I understand why it works.

But for now I can finish my mission!

Thanks again, appreciate you taking the time.


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 43
In-game name: kylania

 
#8 Posted at 2013-07-14 23:16        
     
offStation = group this; deleteVehicle this;

The rifleman and these commands setup the ability to use copyWaypoints command later. First we name the group offStation using the = group this; command. This means we'll be able to refer to that group later as offStation. The deleteVehicle this; will delete the rifleman since all we needed was the group and the waypoints.

cleanUpveh = vehicle leader this; {deleteVehicle _x} forEach crew cleanUpveh + [cleanUpveh]

Waypoints onAct field refers to the group that owns the waypoint as this. Since we knew the name of the helo we could have simply done this:

{deleteVehicle _x} forEach crew knope + [knope];
but I decided to make it reusable so the first thing we do is grab the object of the vehicle we're in.
cleanUpveh = vehicle leader this;
First part of that that gets evaluated is the leader this part. That returns the leader of the group. Then we check for what vehicle he's in, returning the knope helicopter and we store that value as cleanUpveh. Now that we know the vehicle we can delete the crew then delete the vehicle with the rest of that code:
{deleteVehicle _x} forEach crew cleanUpveh + [cleanUpveh]

Then for the group switch:

leavingGroup = createGroup west; {[_x] joinSilent leavingGroup} forEach crew knope; leavingGroup copyWaypoints offStation;

leavingGroup = createGroup west; This creates a new group for the pilot/gunner to join. Then we use the forEach for the crew of the helicopter to silently join that group. Finally we return to the offStation group we created at first and apply their waypoints (the move with the delete everyone code) to this new group and they'll start to follow that waypoint right away. copyWaypoints is: groupTo copyWaypoints groupFrom.

Let me know if you have questions about any of this.


Author Message


Posts: 6
Rank:


Level: Member

Country: uk
Location: Lincs
Occupation: Warehouse op.
Age: 35
In-game name:

 
#9 Posted at 2013-07-14 23:22        
     
Argh in the quick test I did with no extraneous units it worked fine. Now that I've implemented it into my current mission it's doing the same thing where after the JTAC dies the Attach helicopter lands and then the units proceed on foot, presumably to the waypoint of that lone rifleman.

The only differences are that my group starts in a transport helicopter using {_x moveincargo Heli1} foreach units Group1

And after a GetOut synchronized with a TransportUnload the Transport chopper has a waypoint to other side of the map and my group has a seek and destroy waypoint.

The part you gave me I copied and pasted in the editor so it's exactly the same as when it worked.


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 43
In-game name: kylania

 
#10 Posted at 2013-07-14 23:50        
     
Hmm... this is why I never use waypoints for players. It does appear to break completely if they have waypoints already and I'm not finding any way of getting it to work via deleting waypoints or reassigning vehicles or anything.

Just never give players actual waypoints, they should be smart enough to know when to get out of a helicopter and where to go for their mission from markers/briefing. :)


Author Message


Posts: 6
Rank:


Level: Member

Country: uk
Location: Lincs
Occupation: Warehouse op.
Age: 35
In-game name:

 
#11 Posted at 2013-07-15 00:27        
     
I'll do what you suggest and do away with the waypoints. I don't really know why I put them in there as I've been playing it on veteran trying to get better at my map skills etc. I guess the only good thing about waypoints for players is you can easily replay a mission as another section or platoon and see it from another point of view.

It's a shame that the HC module doesn't take into account the difficulty setting as that kinda ruins the immersion of not having your team mate markers appear on the hud when you have loads of blue markers for everyone else on the map! Sorry going way off topic!

Thanks again for your help, I've been wanting to do what you helped me do for a good while now. Can't wait for tomorrow to be over so I can get home and carry on! I saved your explanations as I think I might have to read them a fair few times lol.


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 43
In-game name: kylania

 
#12 Posted at 2013-07-15 02:52        
     
If you have questions feel free to ask.