Jump to content
Sign in to follow this  
DaysShadow

Waypoints in script are not applied

Recommended Posts

Hi,

i'm working on a little mission with Invasion 1944 mod.

I want to create a group and let them move to a waypoint.

Group creation works but the waypoint doesnt seem to be applied to the group.

// Create allied troops at position given by argument

_position = _this select 0;
_radius = _this select 1;
_grp = _this select 2;

"I44_Man_A_Army_DDay_NCO_M1Carbine" createUnit [ [ (_position select 0) + random _radius, (_position select 1) + random _radius ], _grp ];
"I44_Man_A_Army_DDay_M3Greasegun" createUnit [ [ (_position select 0) + random _radius, (_position select 1) + random _radius ], _grp ];
"I44_Man_A_Army_DDay_M1Garand" createUnit [ [ (_position select 0) + random _radius, (_position select 1) + random _radius ], _grp ];
"I44_Man_A_Army_DDay_M1Garand_M7" createUnit [ [ (_position select 0) + random _radius, (_position select 1) + random _radius ], _grp ];
"I44_Man_A_Army_DDay_M1Garand" createUnit [ [ (_position select 0) + random _radius, (_position select 1) + random _radius ], _grp ];
"I44_Man_A_Army_DDay_M3Greasegun" createUnit [ [ (_position select 0) + random _radius, (_position select 1) + random _radius ], _grp ];
"I44_Man_A_Army_DDay_M1Garand" createUnit [ [ (_position select 0) + random _radius, (_position select 1) + random _radius ], _grp ];

{ addSwitchableUnit _x; _x allowFleeing 0 } forEach units _grp;

_grp selectLeader units _grp select 0;

// Everything until here works

_wp = _grp addWayPoint [[904.533, 3366],0]; 
_wp setWaypointType "DESTROY"; 
_grp setCurrentWaypoint _wp;

The units are created correctly, join the group correctly but they dont seem to have the waypoint i added.

I used "hint str count waypoints _grp" to check if it was added but nothing is "hinted".

Any help would be nice.

Share this post


Link to post
Share on other sites

delete

_grp selectLeader units _grp select 0;

thats should work - just tested it for you -

Share this post


Link to post
Share on other sites

Many thanks, it works without but also with the line.

There are braces missing: "_grp selectLeader (units _grp select 0);"

If i put it that way into the script it works although i dont need to choose the leader as the NCO is the one with the highest rank in the group (didnt thought about it) :)

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  

×