Jump to content
Sign in to follow this  
Tom212

Civilian side undefined variable in BIS_fnc_MP parameter.

Recommended Posts

Got a very strange bug here with a mission I'm working on.

 

I have two scripts, both have the exact same line of code in it which is below:

[[_objectiveDetails,"scripts\objectiveNew.sqf"], "BIS_fnc_execVM", CIV] call BIS_fnc_MP;

In one script this works perfectly, no errors, I receive the desired effect.

 

However in the second script it's claiming that the side parameter supplied is an undefined variable. With the script that works I've tried various ways of entering the parameter to see if there's something wrong there, however both 'civilian' and 'CIV' work when used in that function. However neither of them work when used in the other script.

 

Any idea what could be causing this? I've triple checked, the line of code is exactly the same and there is no other stage in the script where I refer to or use 'civilian' or 'civ' as a variable.

Share this post


Link to post
Share on other sites
[[_objectiveDetails,"scripts\objectiveNew.sqf"],"BIS_fnc_execVM",CIVILIAN,false,true] call BIS_fnc_MP;

The way how to execute script  and which parameters need to be pass and how are defined in script itself. Show us the script first.

Share this post


Link to post
Share on other sites

This is the script that isn't working.

private ["_hvtLocation", "_hvtMission", "_timeLimit", "_succeeded"];

//Set mission time limit in seconds.
_timeLimit = 1000;

_timeLimit = serverTime + _timeLimit;
_hvtLocation = _this; // Store supplied location parameter.
_hvtMission = ["hvtMission"];
//hint format ["%1", _hvtLocation];

//Remove HVT from avaliableMissions array so it cannot be called again until the mission is complete.
availableMissions = availableMissions - _hvtMission;
hint format ["Available Missions Array: %1", availableMissions];



//Create and prepare the HVT NPC.
_group = createGroup resistance;
"I_Officer_F" createUnit [_hvtLocation, _group, "hvtTarget = this"];
removeAllWeapons hvtTarget;
hvtTarget disableAI "MOVE";
hvtTarget disableAI "AUTOCOMBAT";





//Creates marker, be sure to check these are only visible to spies.
//Fix issue with conflicting marker names on multiple runs.



_objectiveDetails = ["hvt", "Assassinate enemy officer.", hvtTarget];
[[_objectiveDetails, "scripts\objectiveNew.sqf"], "BIS_fnc_execVM", CIV] call BIS_fnc_MP;
//_objectiveDetails execVM "scripts\objectiveNew.sqf";

//Below code will be executed on soldier clients.
//_objectiveDetails = _hvtLocation + ["hvt", "Protect the friendly officer."];
//_objectiveDetails execVM "scripts\objectiveNew.sqf";





////////////////////////////////////////////////////////
//Pause until mission is succeeded or failed.
waitUntil {!alive hvtTarget or serverTime > _timeLimit};


if (!alive hvtTarget) then {
_succeeded = true;

} else {

_succeeded = false;
deleteVehicle hvtTarget;

};

//succeeded needs to be a local variable, fix scope problem.

//Finish the objective and enter the mission type back into the missions array.
[[["hvt", _succeeded], "scripts\objectiveFinished.sqf"], "BIS_fnc_execVM", civilians] call BIS_fnc_MP;
//["hvt", _succeeded] execVM "scripts\objectiveFinished.sqf";
availableMissions = availableMissions + _hvtMission;

sleep 5;
hint format ["Available Missions Array: %1", availableMissions];

Share this post


Link to post
Share on other sites

Thanks that did the trick. Still very bizarre that it worked with 'CIV' and 'civilians' on the other script.

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  

×