kibaBG 53 Posted October 26, 2022 I try to script simple mortar shooting to marker "attached" to the player. The idea is to give the possibility to evade the mortar barrage if the player is moving and not camp on one place. First I make a marker called "mortar_barrage" and make it change its position to player position every 20 sec. in initPlayerLocal.sqf : while {true} do { sleep 10; "mortar_barrage" setMarkerPos (getPos player); }; So far so good, works well. Then I make a trigger which fires if the enemies detect player. On activation : _mortargrp = createGroup [east, true]; _mortargrp setBehaviour "COMBAT"; _mortar = [(getMarkerPos "mortar_1"),350,"I_G_Mortar_01_F",_mortargrp] call BIS_fnc_spawnVehicle; _mortar commandArtilleryFire [(getMarkerPos "mortar_barrage"), "8Rnd_82mm_Mo_shells", 3]; But it does not want to shoot! I tried to make waypoint like _wp1 = _mortargrp addWaypoint [(getMarkerPos "mortar_barrage"),0]; _wp1 setWaypointType "SCRIPTED"; _wp1 setWaypointScript "A3\functions_f\waypoints\fn_wpArtillery.sqf"; Does not work too ... What is wrong? 🙄 Share this post Link to post Share on other sites
Larrow 2822 Posted October 27, 2022 BIS_fnc_spawnVehicle returns an array of [ vehicle, crew, group ]. So you should be seeing errors from commandArtilleryFire as you are feeding it this array. Instead... Spoiler _mortargrp = createGroup[ east, true ]; _mortargrp setBehaviour "COMBAT"; [ getMarkerPos "mortar_1", 350, "I_G_Mortar_01_F", _mortargrp ] call BIS_fnc_spawnVehicle params[ "_vehicle", "_crew", "_group" ]; gunner _vehicle commandArtilleryFire[ getMarkerPos "mortar_barrage", "8Rnd_82mm_Mo_shells", 3 ]; 1 Share this post Link to post Share on other sites
avibird 1 155 Posted October 27, 2022 Hey if you use Vcom or GAIA zones you just have to place motors down or other artillery pieces. No waypoints needed no scripting needed. Once your player group is identified by the enemy and engagement occurs the AI system used in these two mod/Script will order fire missions on their own at your last known location. You can't sit around and hold a fortified position because eventually they will lock onto your exact location. 1 Share this post Link to post Share on other sites
kibaBG 53 Posted October 27, 2022 6 hours ago, Larrow said: BIS_fnc_spawnVehicle returns an array of [ vehicle, crew, group ]. So you should be seeing errors from commandArtilleryFire as you are feeding it this array. Instead... Hide contents _mortargrp = createGroup[ east, true ]; _mortargrp setBehaviour "COMBAT"; [ getMarkerPos "mortar_1", 350, "I_G_Mortar_01_F", _mortargrp ] call BIS_fnc_spawnVehicle params[ "_vehicle", "_crew", "_group" ]; gunner _vehicle commandArtilleryFire[ getMarkerPos "mortar_barrage", "8Rnd_82mm_Mo_shells", 3 ]; I tested so many times but the spawned mortar does not fire. I tested 5 different ranges, same thing. 🤔 Share this post Link to post Share on other sites
Larrow 2822 Posted October 30, 2022 On 10/27/2022 at 7:06 PM, kibaBG said: I tested so many times but the spawned mortar does not fire. Works fine for me, placed both markers and then run code from debugConsole, mortar spawns and fires off three rounds. Although it does rely on the marker being in range for the mortar to fire at it. 1 Share this post Link to post Share on other sites
kibaBG 53 Posted October 30, 2022 14 hours ago, Larrow said: Works fine for me, placed both markers and then run code from debugConsole, mortar spawns and fires off three rounds. Although it does rely on the marker being in range for the mortar to fire at it. I guess it checks only one time if the marker is in range? Does AI change the type of rounds depending on the range or just use type 0, the nearest ones? Or maybe is ACE issue? EDIT: Ok, its ACE/CBA issue https://github.com/acemod/ACE3/issues/6173 Damn. Workaround Ace Crew Served Weapons -> Advanced Assembly -> Turn off Ace Crew Served Weapons -> Ammo Handling -> Players Only And now @Larrow code works without any issue. Thanks you @Larrow! 1 Share this post Link to post Share on other sites