Jump to content
Sign in to follow this  
skooma

Issue with putting a group of troops in a chopper

Recommended Posts

I'm making a mission where it is necessary for a group of troops to ride a helicopter in and disembark. I'm trying to use the command that make the entire group start in the chopper with just one line in the leader's init box.

I'm sure you're all familiar with it: {_x moveincargo chopper} forEach units this

The weird thing is the same command in the same mission works with another group. For some reason after that group I can only get the leader to start in the chopper, his men stay on the ground. I've tried using different helos, pre-made groups, hand picked group, different naming schema and nothing works.

Is there a bug that I'm not aware of?

Share this post


Link to post
Share on other sites
{_x moveincargo chopper} forEach units group this

Thanks! But it still doesn't work. Only the team leader is in the helicopter and everyone else is still standing on the ground.

Share this post


Link to post
Share on other sites

Must work - maybe lost the group-line and the leader is a group of himself?

Maybe theres not enough space (left) in the chopper for everyone else??

Share this post


Link to post
Share on other sites

I'm using that command in the group leader units init field

wgrp1 = group this; {_x moveInCargo wh1} forEach units wgrp1; 

Name groupleader is wgrp1 , name of chopper wh1

Just replace the variable names with those you used.

It never failed to work.

Hope that helps.

Cheers:D

Share this post


Link to post
Share on other sites

I tried the methods you guys suggested and it still doesn't work. It's really weird. Maybe I should disable all my mods and see if that doesn't help.

I'm using that command in the group leader units init field

wgrp1 = group this; {_x moveInCargo wh1} forEach units wgrp1; 

Name groupleader is wgrp1 , name of chopper wh1

Just replace the variable names with those you used.

It never failed to work.

Hope that helps.

Cheers:D

That did work for another group on the map, but this one is continuing to be stubborn.

Share this post


Link to post
Share on other sites
Maybe I should disable all my mods and see if that doesn't help.

I strongly suggest not using any mods when trying scripts or mods.

Otherwise you will never know that if something didn't work was because the script itself or conflict with another mod. :D

Best, Splicer.

Share this post


Link to post
Share on other sites
I'm using that command in the group leader units init field

wgrp1 = group this; {_x moveInCargo wh1} forEach units wgrp1; 

@ nettrucker,

The code: wgrp1 = group this;

If you place this code in the leader's init field, all units grouped/linked to the leader (using F2), they will be added automatically to the group. Right?

In other words, there is no need to enter in the init of each unit the code: wgrp1 = group this;

I just want to be sure I understand correctly this. Now that I'm at the early stages of the 1st mission I'm putting together, it could save me a lot of time down the road. :D

Thanks much in advance.

Best, Splicer.

Share this post


Link to post
Share on other sites

I disabled all my mod folders and tested it. Still doesn't work despite naming the group with wgrp1 = group this and leaving as is and using "this". I have patch 1.04.

If you are so inclined. Here is the test mission I made. I doubled checked the syntax and names and it should work, but doesn't.

http://www.mediafire.com/?intjzjdw12y

Thanks for all your help guys!

Share this post


Link to post
Share on other sites

I'll take a look at it later tonight or tomorrow morning.

BYW, why haven't you upgraded to patch 1.05?

Just curious... :D

Best, Splicer.

Share this post


Link to post
Share on other sites

Fixed this...

You didn't do as you said. You didn't have the _x

I replaced T1 and T2 with _x in your groups and removed the group variable, it worked fine. It wasn't moving everyone in because you were telling it to put the group leader in (the T1 and T2).

{_x moveinCargo BH2} forEach units group this;

You must use _x as quoted from the wiki.

http://community.bistudio.com/wiki/forEach

Executes the given command(s) on every item of an array. The array items are represented by _x.

Also,

If you really want to use a group name (which I don't really see the advantage unless you are using the group in other scripts) use this code:

chalk2=group this; {_x moveinCargo BH2} forEach units chalk2;

Don't use group before a group name, only use group if you are trying to refer to a unit's group.

http://community.bistudio.com/wiki/group

http://community.bistudio.com/wiki/units

Edited by xPaveway

Share this post


Link to post
Share on other sites

MANY THANKS!

I replaced T1 and T2 with _x in your groups and removed the group variable, it worked fine. It wasn't moving everyone in because you were telling it to put the group leader in (the T1 and T2).

Ah there it was. I thought when _x was used in examples it was the name of the squad leader and not something more important.

Share this post


Link to post
Share on other sites
@ nettrucker,

The code: wgrp1 = group this;

If you place this code in the leader's init field, all units grouped/linked to the leader (using F2), they will be added automatically to the group. Right?

In other words, there is no need to enter in the init of each unit the code: wgrp1 = group this;

I just want to be sure I understand correctly this. Now that I'm at the early stages of the 1st mission I'm putting together, it could save me a lot of time down the road. :D

Thanks much in advance.

Best, Splicer.

Hi

yeah it's sufficient to put that code snippet in the leaders Init field. No need to do that for every unit.

Share this post


Link to post
Share on other sites
Hi

yeah it's sufficient to put that code snippet in the leaders Init field. No need to do that for every unit.

Nettrucker,

Thank you so much! I really appreciate it! :)

Best, Splicer.

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  

×