G'day, I'm having problems with this script. I have a vehicle moving to a marker. If an enemy is detected in one of two "bluefor detected by opfor" triggers, then crp_assault script is called, and the current script is exited. Well that's what's supposed to happen. Can someone with know how lay their eyes on these and tell me where I'm going wrong with this.
Init.sqf
advance_vehicle = compile preprocessfilelineNumbers "advance_vehicle.sqf";
crp_assault = compile preprocessFilelineNumbers "CRP_Assault.sqf";
advance_vehicle.sqf
// Processed in Init.sqf by.. advance_vehicle = compile preprocessfilelineNumbers "advance_vehicle.sqf"
// Initiated by [vehicle, leadergroup, unitsgroupgroupleader] call advance_vehicle
if (!isServer) exitWith {};
Private ["_nul","_exit","_current_marker","_random_number","_vehicle","_leader","_units","_first_move_markers","_first_first_move_markers","_first_second_move_markers","_first_third_move_markers","_second_first_move_markers","_second_second_move_markers","_second_third_move_markers"];
_vehicle = _this select 0;
_leader = _this select 1;
_units = _this select 2;
_first_move_markers = ["move_marker_1","move_marker_2"];
_first_first_move_markers = ["move_marker_11a","move_marker_11b"];
_second_first_move_markers = ["move_marker_21a","move_marker_21b"];
_first_second_move_markers = ["move_marker_12a","move_marker_12b"];
_second_second_move_markers = ["move_marker_22a","move_marker_22b"];
_first_third_move_markers = ["move_marker_13a","move_marker_13b"];
_second_third_move_markers = ["move_marker_23a","move_marker_23b"];
_current_marker = "";
_exit = false;
// moving the vehicle
while { alive _vehicle } do
{
// Chose a random number to radomize the marker to move to
_random_number = random 100;
// 80% chance to move to move_marker_1
if (_random_number > 20) then
{
_vehicle domove getmarkerpos (_first_move_markers select 0);
_current_marker = _first_move_markers select 0;
} else
{
_vehicle domove getmarkerpos (_first_move_markers select 1);
_current_marker = _first_move_markers select 1;
};
// Checks two triggers for detection of enemy. If detected, calls crp_assault script
while { (_vehicle distance (getmarkerpos _current_marker) >= 7) } do
{
sleep 1;
if ((BLUEFDET1 >= 1) or (BLUEFDET2 >= 1)) then
{
_nul = _vehicle call crp_assault;
exitwith {_exit = true};
}else
{
hint "crp_assault.sqf not initiated";
sleep 5;
};
};
// exitwith only exits out of the current loop, so exit again if _exit = true
if (_exit) exitwith {};
};
CRP_Assault.sqf
private ["_vehicle"];
_vehicle = _this;
while { alive _vehicle } do
{
hint "CRP_Assault has been called";
sleep 1;
};
At the moment, there's alot of hints for fault finding. I found the faults, but dont know how to fix them.
It's not initiating the script CRP_Assault.sqf for some reason. And line 39 is apparently missing a ";".
I'm at a loss.