Jump to content
Sign in to follow this  
lockjaw-65-

Make a spawned group move to marker faster!

Recommended Posts

Ok I have a script that spawns a group at a named marker. I then have a script that tells them to move to another marker on the map and then task patrol that marker. The problem is they move so slow in the vehicles and I am not sure why? Is there a way to set there speed so they are faster?

The script to call the vehicles is:

_spawn = [getmarkerpos "spawn500", "BTR40_MG_TK_INS_EP1", "ssp1a",0] execVM "supportmission1a.sqf";
_spawn = [getmarkerpos "spawn500", "LandRover_SPG9_TK_INS_EP1", "ssp1c",0] execVM "supportmission1a.sqf";
_spawn = [getmarkerpos "spawn500", "V3S_TK_EP1", "ssp1d",0] execVM "supportmission1a.sqf";

Then the script to call the crew and set the task patrol is:

_spawn_zone = _this select 0;
_veh_type = _this select 1;
_name = _this select 2;
_dir = _this select 3;// new

_group = createGroup east;
_veh = createVehicle [_veh_type, _spawn_zone, [], 0, "NONE"];
_driver = _veh emptyPositions "driver";
_gunner = _veh emptyPositions "gunner";

_cargo = (_veh emptyPositions "cargo") - 1;
if (_driver > 0) then {"TK_INS_Soldier_EP1" createUnit [_spawn_zone, _group, "this moveinDriver _veh;this assignAsDriver _veh;this setskill [""general"",1];"];};
if (_gunner > 0) then {"TK_INS_Soldier_EP1" createUnit [_spawn_zone, _group, "this moveinGunner _veh;this assignAsGunner _veh;this setskill [""general"",1];"];};
if (_commander > 0) then {"TK_INS_Soldier_EP1" createUnit [_spawn_zone, _group, "this moveinCommander _veh;this assignAsCommander _veh;this setskill [""general"",1];"];};
for "_i" from 0 to _cargo do
{
"TK_INS_Soldier_EP1" createUnit [_spawn_zone, _group, "this moveinCargo _veh;this assignAsCargo _veh;"];
};
_veh setdir _dir;// new
_veh SetVehicleVarName _name;
call compile format["%1 = _veh", _name];
_patrol = [_group, getmarkerpos "objmk1", 200] call bis_fnc_taskPatrol;

All work really well, its just the speed?

Share this post


Link to post
Share on other sites

I think bis_fnc_taskPatrol sets speed to "LIMITED" by default.

Try creating a waypoint at "objmk1" with speed "NORMAL" or "FULL" and call bis_fnc_taskPatrol after that...

Share this post


Link to post
Share on other sites

Thanks for info but I am not sure how I would create a waypoint during the mission or how to do it within the script?

Share this post


Link to post
Share on other sites

Try this:

_spawn_zone = _this select 0;
_veh_type = _this select 1;
_name = _this select 2;
_dir = _this select 3;// new

_group = createGroup east;
_veh = createVehicle [_veh_type, _spawn_zone, [], 0, "NONE"];
_driver = _veh emptyPositions "driver";
_gunner = _veh emptyPositions "gunner";

_cargo = (_veh emptyPositions "cargo") - 1;
if (_driver > 0) then {"TK_INS_Soldier_EP1" createUnit [_spawn_zone, _group, "this moveinDriver _veh;this assignAsDriver _veh;this setskill [""general"",1];"];};
if (_gunner > 0) then {"TK_INS_Soldier_EP1" createUnit [_spawn_zone, _group, "this moveinGunner _veh;this assignAsGunner _veh;this setskill [""general"",1];"];};
if (_commander > 0) then {"TK_INS_Soldier_EP1" createUnit [_spawn_zone, _group, "this moveinCommander _veh;this assignAsCommander _veh;this setskill [""general"",1];"];};
for "_i" from 0 to _cargo do
{
"TK_INS_Soldier_EP1" createUnit [_spawn_zone, _group, "this moveinCargo _veh;this assignAsCargo _veh;"];
};
_veh setdir _dir;// new
_veh SetVehicleVarName _name;
call compile format["%1 = _veh", _name];

[color="#FF0000"]_wp = _group addWaypoint [getmarkerpos "objmk1",0];
_wp setWaypointStatements ["true","[_group, getmarkerpos "objmk1", 200] call bis_fnc_taskPatrol;"];[/color]

Share this post


Link to post
Share on other sites

Many thanks I will try that later today, will that make them move quicker to the waypoint?

Share this post


Link to post
Share on other sites

This does seem to work and the units are quicker but it says there is an error with the script?

Share this post


Link to post
Share on other sites

Ah, the quotes within quotes is what is causing the problem. Put double quotes around "objmk1".

_wp = _group addWaypoint [getmarkerpos "objmk1",0];
_wp setWaypointSpeed "FULL";
_wp setWaypointStatements ["true","[_group, getmarkerpos ""objmk1"", 200] call bis_fnc_taskPatrol;"];

Share this post


Link to post
Share on other sites
Ah, the quotes within quotes is what is causing the problem. Put double quotes around "objmk1".

_wp = _group addWaypoint [getmarkerpos "objmk1",0];
_wp setWaypointSpeed "FULL";
_wp setWaypointStatements ["true","[_group, getmarkerpos ""objmk1"", 200] call bis_fnc_taskPatrol;"];

This works perfect, thanks to all for the help :)

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  

×