Page MenuHomeFeedback Tracker

BIS_fnc_spawnCrew ignores waypoints
New, WishlistPublic

Description

Crew is not following waypoints when spawned using BIS_fnc_spawnCrew {F26468}

Details

Legacy ID
4245885059
Severity
None
Resolution
Open
Reproducibility
Always
Category
AI Issues
Steps To Reproduce

Included repro mission, mission init below.

Additional Information
  • spawn { player setCaptive true; sleep 3; private ["_vehicleClassname", "_vehicle", "_vehiclePosition", "_crew", "_group", "_initialWaypointIndex", "_noOfWaypoints", "_wpPosition1", "_wpPosition2", "_wpPosition3", "_waypoint"]; _vehicleClassname = "B_APC_Wheeled_01_cannon_F"; _vehiclePosition = getPosATL player; _vehiclePosition set [0, (_vehiclePosition select 0) + 10]; _vehiclePosition set [1, (_vehiclePosition select 1) + 10]; _vehicle = createVehicle [_vehicleClassname, _vehiclePosition, [], 0, "NONE"]; createCenter west; -------------------------------- Crew is not following waypoints when spawend with BIS_fnc_spawnCrew _group = createGroup west; _crew = [_vehicle, _group, false, "", "B_crew_F"] call BIS_fnc_spawnCrew; // -------------------------------- _initialWaypointIndex = 0; if (count waypoints _group > 0) then { _initialWaypointIndex = (count waypoints _group) - 1; }; _wpPosition1 = getPosATL player; _wpPosition1 set [0, (_wpPosition1 select 0) + random 200]; _wpPosition1 set [1, (_wpPosition1 select 1) + random 200]; _wpPosition2 = getPosATL player; _wpPosition2 set [0, (_wpPosition2 select 0) + random 200]; _wpPosition2 set [1, (_wpPosition2 select 1) + random 200]; _wpPosition3 = getPosATL player; _wpPosition3 set [0, (_wpPosition3 select 0) + random 200]; _wpPosition3 set [1, (_wpPosition3 select 1) + random 200]; _waypoint = _group addWaypoint [_wpPosition1, 0]; _waypoint setWaypointType "MOVE"; _waypoint setWaypointBehaviour (["AWARE", "SAFE"] select (floor random 2)); _waypoint setWaypointCombatMode "RED"; _waypoint = _group addWaypoint [_wpPosition2, 0]; _waypoint setWaypointType "MOVE"; _waypoint setWaypointBehaviour (["AWARE", "SAFE"] select (floor random 2)); _waypoint setWaypointCombatMode "RED"; _waypoint = _group addWaypoint [_wpPosition3, 0]; _waypoint setWaypointType "MOVE"; _waypoint setWaypointBehaviour (["AWARE", "SAFE"] select (floor random 2)); _waypoint setWaypointCombatMode "RED"; [_group, (count waypoints _group) - 1] setWaypointStatements ["true", format["(group this) setCurrentWaypoint [group this, %1]", _initialWaypointIndex]];

};

Event Timeline

Cyruz edited Steps To Reproduce. (Show Details)Jun 17 2015, 10:05 PM
Cyruz edited Additional Information. (Show Details)
Cyruz set Category to AI Issues.
Cyruz set Reproducibility to Always.
Cyruz set Severity to None.
Cyruz set Resolution to Open.
Cyruz set Legacy ID to 4245885059.May 8 2016, 12:14 PM
Cyruz added a subscriber: Cyruz.May 8 2016, 12:14 PM
Cyruz added a comment.Feb 6 2016, 1:59 AM

Restested in current stable version (1.54), still an issue.

F2kSel added a comment.Feb 6 2016, 2:45 AM

Although the code is correct, it seems it's assigning the waypoints before the crew have been initialized.

Solution is a small delay just after the BIS_fnc_spawnCrew;

_crew = [_vehicle, _group, false, "", "B_crew_F"] call BIS_fnc_spawnCrew;
sleep 0.2;

Cyruz added a comment.Feb 6 2016, 2:31 PM

Thanks for the info F2k Sel :)