Home   Help Search Login Register  

Author Topic: Cannot build 3-vehicle, moving convoy with player riding as gunner  (Read 3124 times)

0 Members and 1 Guest are viewing this topic.

Offline Bahger

  • Members
  • *
Gents, this is probably very simple for most of you, yet I am slightly embarrassed to say I am stumped.  Here's what I'm trying to do:

For a singleplayer mission with the player as squad leader I want a Marine rifle squad (13 men, broken down into 3 fireteams plus squad leader) to be embarked at the beginning of the scenario in 3 HMMWVs, with the player riding as turret gunner in the lead vehicle. 

I just cannot seem to figure this out.  I think the HMMWVs come already crewed so there are always more men than vehicles; am I supposed to eliminate the crews in the vehicle init lines?  If so, with what command line?  I can get my guys boarded by setting them all at "In cargo" and the player properly positioned using the "Playable as gunner" option.  However, unless the player issues movement orders via the HUD, I can't get the convoy moving.  Preplanned waypoints simply don't have any effect when I preview the mission.

I guess what I need to know is how to use any necessary "In formation" orders, how to stop the Marines disembarking every time I get out of my stationary vehicle (the only way to keep them boarded is with a "stop" order) what entity to give the waypoints to (vehicle or player).  I have grouped the 3 vehicles with the Marines; was that my first mistake?  Surely it's not the case that a Marine squad can only ride in the back of a truck?  Is my mistake that the AI drivers of a HMMWV convoy not be part of the squad?  I must be missing something very basic here.

Eventually I want the mission to start with the convoy rolling and I have no idea how to do that, but for the time being I'd be happy just to get the guys embarked and the convoy moving per waypoint direction.  I know it's very elementary but it's defeating me and I cannot proceed with my new SP mission until I have sorted this out.  Can someone help?  Many thanks in anticipation.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
First, please be aware that driving AI is far from perfect, which means getting them to move and then -stay on the road- is not as easy as it could be.  :dry: This gets harder the more vehicles are involved, so if you can't get it to work with the three hummers, using a single lead hummvee and a truck might also do it.

What I suggest you do is put down three EMPTY vehicles (first place down the player, then you can pick Empty from the unit placement menu), and name each of them. After that, decide who you want in which vehicle. Keep in mind, I think the hummers can only fit five people - driver, shotgun, two in the back and gunner, but I'm not entirely sure about this either: it might just be four? Then use the three commands: moveInDriver, moveInCargo and moveInGunner to move the appropriate units into their appropriate places. A suggestion (even if it might not be correct when it comes to proper procedure) is to let the highest in command lead the convoy, with the second in command following, and then the third. So, for instance:

Lead: Lt
Second: Sgt
Third: Corp.

In Arma 2 (and other BIS games) convoys drive according to rank. If you don't set it up like this from the start, they will back and drive around in circles for a long while before setting off so as to drive in the correct order.

Now, simply give the squad leader a waypoint, make sure the formation is Column and Behaviour is Safe (will keep them on the road), and start. Now, since YOU are the squad leader, you have to give the order to move as well! There is however an automatic command for this in the menu: 1 (move) -> Go to next waypoint (or something like that). This will have the SL order his car to move to the next waypoint - the others will follow as they are 'in formation'. They might not follow nicely, they might swerve off the road and do other nasty things, but...yeah. Not much we can do about that >_<

Option two, which puts you in less control initially but might fix a lot of problems, is that you have a group of drivers in a -separate- group. Include the civilian truck driver in this group, and make him the group leader. Name the three drivers of the hummvees (once again in receding order of rank - note that Private can also be used, so you can have e.g. Lt-Sgt-Corp-Pvt). Now simply give the truck-driver the same waypoint, and all of the hummers will follow behind him automatically. At some point, for instance when the bomb explodes on the road, simply have the drivers of the hummers join the player's group:
Code: [Select]
[driver1, driver2, driver3] JoinSilent group Player
So then you have full control over them again - this of course means that your commandable group will be three short in the beginning.

Rather than moving everyone in, you could also have the player order the soldiers into the hummers as he sees fit. Just do the same as above, except make the truck driver's first waypoint a "Load" WP, and the player's first WP a "Get In" WP. Then synchronize (F6) them, and the truck won't go anywhere until after the whole player's group is inside the vehicles. :)

Can't make an example mission now, but hopefully you get the instructions somewhat!

Wolfrug out.



"When 900 years YOU reach, look as good you will not!"

Offline zonker3210

  • Members
  • *
You may want to consider using something like Convoy Creator script...

http://forums.bistudio.com/showthread.php?t=90208

FYI - If you don't mind the extra dependency for your mission, the author eventually converted it to an addon instead of a script pack.

Offline Bahger

  • Members
  • *
Thanks, guys!  As always, I'm grateful for your time and expertise.

Wolfrug, I tried your second solution -- putting the drivers in their own individual group -- and it worked beautifully but note that the player, if he is riding gunner on the second vehicle (the lead HMMWV) must be included in this group, too.  What happens now is that we hear orders in Russian from the Independent driver of the truck, as he is group leader.  I will find out a way to disable this dialog at some point.
« Last Edit: 14 Mar 2010, 21:58:15 by Bahger »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Hi!

You sent me a PM as well, where you asked me about the command structure. This can be solved easily by using selectLeader at an opportune moment. But I'd still imagine that once the leader of the leading truck is dead (as he's scripted to be), then the player's vehicle -should- be second in command. But of course if two people have the same rank (e.g. lieutenant) then it seems to be just luck who gets picked as the next in line. Anyway, selectLeader should do the trick!

As to the language problem: hm. Would it be impossible, storywise, that the truck is driven by an American soldier? I don't think you can change people's language without an addon, so the other alternative would be to use enableRadio which should entirely 'turn off' all radio conversations - including your own orders and such. You could then re-enable it whenever you wanted to. But this is a little harsh - I don't think it'd hurt immersion too much if you'd simply let the poor truckdriver be an American soldier...(or, as a third option, make the leader of the whole convoy an actual USMC Captain or the like, sitting up in the front of the truck leading the parade! Even if the truck DRIVER isn't the captain, he'd still be the leader of the group --> the one giving the orders in English).

Hope that solves it! Oh, and by the way: I never got any mission file from you, so I'm not really sure where you sent it :) You can always attach them here on the forums, preferably in zip/rar format.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Bahger

  • Members
  • *
Thanks so much, Wolfrug, I will experiment with the code you suggest.  Does it matter if the selectLeader is used in a trigger or a waypoint init line and do I need to apply it twice, to corral both the driver group and the Marine group into the player's command?  Also, if I enter, say, "USMC_1" in the "Name" field of the ranking squad member, does this mean that the group is now called "USMC_1"?  If not, what is the best way to name a group?  Does every individual group member need to have this text in his "Name" field?  You do not get a naming option in the create group menu, I believe.

Yes, I will probably make the driver an English-speaker, although the idea of creating a guy riding shotgun as the leader of the group, hence solving the language problem, is a really elegant one.  I'd need to condemn him to death, too, which I can copy from your code.

I sent the file to the email address listed for you in your profile.  PMs here don't seem to allow attachments.  Here it is again.
« Last Edit: 15 Mar 2010, 17:55:27 by Bahger »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
You'll have to experiment with selectLeader - and no, it doesn't matter where you put it in; you could even create an external script for all of this if it gets too unwieldy!

Naming a group is simple: add this line into ANY group member's init field:

Code: [Select]
YourGroupName = group this;
YourGroupName of course being the name of the group (or, rather, a global variable which stores the group and its composition dynamically). To access the (living) members of that group, you can use the units command, which will return an array of all the units in the group - but that's a bit more complicated already. :)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Bahger

  • Members
  • *
OK, thanks to you, Wolf, I've now got this slightly ambitious orchestration of a massacre of civilians while escorted by Marines with the player riding directly behind as gunner working perfectly, using the first, rather than the second of your suggested strategies for grouping the convoy.  Giving the murderers sniper rifles adds an appropriately nasty element to the mix, as would putting children amongst the civilian group if there were any in the A2 character model files.  Now, hopefully, I can build an assault mission around the hunt for the perps that will engage the player's emotions in a way a strictly tactical mission might not.  At some point I'll also need to learn the rudiments of ArmA 2 cinematics, as this one will need an intro/outro.  Does anyone know of a good primer?