Forum Jump :

Author Message

Posts: 1

Level: Member

Country: uk
Age: 29
In-game name: [pXa] XMortX

#198828 Posted at 2018-03-13 09:58        
Hi All,
I have tried to write a script that fails in my editor saying its receiving 0 in the position array when it expects 3.
Hopefully someone can explain what i have done wrong here?
Also to improve this i would like the unit to produce a set of waypoints it walks to, then stops for an amount of time before moving on to the next if anyone has suggestions how to do that.
Fairly green on Arma 3 scripting so help would be very appreciated.
Cheers in advance guys

private ["_pos", "_unitname"]
_pos = [] call BIS_fnc_randomPos; 
_unit = createAgent ["C_scientist_F", _pos, [], 0, "CAN_COLLIDE"];
_unitname = "peddler";
_initinit = format["[{
(objectFromNetId '%1') setVehicleVarName '%4'; 
(objectFromNetId '%1') setunitpos '%2'; 
(objectFromNetId '%1') disableAI '%3';
(objectFromNetId '%1') setVehicleAmmo %5;
(objectFromNetId '%1') setUnitAbility %6;
(objectFromNetId '%1') setDir %7;
}]", (netId _unit), "AUTO", "MOVE", _unitname, 0, 0.60000002, random 360]; 
[call compile format["%1",_initinit],"BIS_fnc_spawn", true, false] spawn BIS_fnc_MP; 
_unit call compile format ["%1=_this; publicvariable '%1'", _unitname];