Coladebote 46 Posted August 20, 2020 Hello guys: I'm trying to get an FIA shooter to appear at night with night vision. I have prepared this script but it gives an error and does not do its job. Can someone tell me what am I doing wrong? if (!isServer) exitWith {}; // SHOOTER // _markerstr = createMarker ["Unit_1",[3263.3,912.274]]; _markerstr setMarkerShape "ICON"; _height = 0; _pos = getMarkerPos "Unit_1"; _Unit_1 = [ [_pos select 0, _pos select 1, _height], EAST, ["O_G_Sharpshooter_F"],[],[],[],[],[],0] call BIS_fnc_spawnGroup; {_x setFormDir 0; _x allowFleeing 0; _x setdir 0; _x addItem "ACE_NVG_Gen4"; _x assignItem "ACE_NVG_Gen4"; _x enableAI "TARGET"; _x enableAI "AUTOTARGET"; _x setUnitPos "AUTO"; _x setBehaviour "SAFE"; _x setCombatMode "RED"} forEach units _Unit_1; _Unit_1 action ["ACE_NVG_Gen4", _Unit_1 ]; sleep 4; Thanks. Share this post Link to post Share on other sites
Harzach 2505 Posted August 20, 2020 11 minutes ago, Coladebote said: it gives an error What is the error? In the meantime, instead of _x addItem "ACE_NVG_Gen4"; _x assignItem "ACE_NVG_Gen4"; you can simply do _x linkItem "ACE_NVG_Gen4"; 1 Share this post Link to post Share on other sites
Harzach 2505 Posted August 20, 2020 19 minutes ago, Coladebote said: _Unit_1 action ["ACE_NVG_Gen4", _Unit_1 ]; Not sure what you are trying to do here. Force the AI to use the NVGs? If it is dark out, they'll use them. Just remove that line. 1 1 Share this post Link to post Share on other sites
Coladebote 46 Posted August 20, 2020 Excellent. Suggested changes work perfectly. The shooter appears in the position with night vision activated. The little script, therefore, is as follows: if (!isServer) exitWith {}; // SHOOTER // _markerstr = createMarker ["Unit_1",[3263.3,912.274]]; _markerstr setMarkerShape "ICON"; _height = 0; _pos = getMarkerPos "Unit_1"; _Unit_1 = [ [_pos select 0, _pos select 1, _height], EAST, ["O_G_Sharpshooter_F"],[],[],[],[],[],0] call BIS_fnc_spawnGroup; {_x setFormDir 0; _x allowFleeing 0; _x setdir 0; _x linkItem "ACE_NVG_Gen4"; _x enableAI "TARGET"; _x enableAI "AUTOTARGET"; _x setUnitPos "AUTO"; _x setBehaviour "SAFE"; _x setCombatMode "RED"} forEach units _Unit_1; sleep 4; Harzach, thank you very much for your help. Greetings from the Mediterranean coast. 2 Share this post Link to post Share on other sites
pierremgi 4737 Posted August 21, 2020 btw, _unit_1 can't be a group && a unit. If I'm right you tried to pass the spawned group to action. imho, too much similar names ("unit_1", _unit_1) for marker, group and unit. So, you're lost. Try something like "mk1" _grp1 and _unit1 as leader _grp1 or units _grp1 #0 Greetings from Pacific ocean. 1 1 Share this post Link to post Share on other sites
Coladebote 46 Posted August 21, 2020 Thank you very much Pierre. You know that this humble learner greatly values your opinions and advice. Thank. Share this post Link to post Share on other sites