Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Mech unit must be an array
- _mechUnit = param [0];
- //Target is an object
- _target = param [1];
- //Distance at which to stop
- _distance = param [2];
- //Returning the apc, assumes everyone is onboard.
- _apc = vehicle (_mechUnit select 0);
- //Getting the group of the driver
- _driver = driver _apc;
- _groupDriver = group _driver;
- //Chaning behaviour
- _groupDriver setCombatMode "YELLOW";
- _cargo = [];
- _crew = [];
- //Getting cargo
- {
- if((assignedVehicleRole _x) select 0 == "Cargo") then
- {
- _cargo pushBack _x;
- }
- else
- {
- _crew pushBack _x;
- }
- }forEach crew _apc;
- //Moving
- units _groupDriver doMove (position _target);
- //Wait until they are close
- waitUntil {_driver distance2D _target < _distance};
- //Stopping the units
- {
- doStop _x;
- }forEach _crew;
- sleep 1;
- _movePos = position _target;
- //Dropping and firing
- {
- unassignVehicle _x;
- doGetOut _x;
- }forEach _cargo;
- //Move units and suppressive fire
- _cargo doMove _movePos;
- _shooter = gunner _apc;
- if(_shooter == objNull) then
- {
- _shooter = commander _apc;
- };
- //Chaning behaviour
- _groupDriver setCombatMode "RED";
- _shooter doSuppressiveFire _movePos;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement