Daniel Frič 1 Posted August 22, 2018 I want to ask what is perfect trigger script for AI artillery to fire at position, im using this one _ammo = getArtilleryAmmo [gun1] select 0; _tgt = getMarkerPos "target1"; gun1 doArtilleryFire[_tgt,_ammo,10]; At first it worked on my mission while testing, but then it stopped working, i dunno how and why, i tested it on another map and it worked like dafuq i srsly dont know what to do Share this post Link to post Share on other sites
M1ke_SK 230 Posted August 22, 2018 use inRangeOfArtillery if you are in range, it is possible that your gun1 is too close or too far from target1 Share this post Link to post Share on other sites
Daniel Frič 1 Posted August 22, 2018 should i just add it normally there or like this _ammo = getArtilleryAmmo [gun1] select 0; _tgt = getMarkerPos "target1"; gun1 doArtilleryFire[_tgt,_ammo,10]; inRangeOfArtillery Share this post Link to post Share on other sites
Daniel Frič 1 Posted August 22, 2018 57 minutes ago, M1ke_SK said: use inRangeOfArtillery if you are in range, it is possible that your gun1 is too close or too far from target1 _ammo = getArtilleryAmmo [gun4] select 0; _tgt = getMarkerPos "target1"; gun4 doArtilleryFire [_tgt,_ammo,10]; _isInRange = getMarkerPos "target1" inRangeOfArtillery [[gun4], "_tgt,_ammo,10"] i did this script and still not working..... Share this post Link to post Share on other sites
M1ke_SK 230 Posted August 22, 2018 you have syntax error and missing " ; " _ammo = getArtilleryAmmo [gun1] select 0; _tgt = getMarkerPos "target1"; _isInRange = _tgt inRangeOfArtillery [[gun1], _ammo]; if (_isInRange) then { gun1 doArtilleryFire [_tgt,_ammo,10]; } else { hint "not in range"; }; Share this post Link to post Share on other sites
Daniel Frič 1 Posted August 22, 2018 6 minutes ago, M1ke_SK said: you are missing " ; " on end _isInRange = getMarkerPos "target1" inRangeOfArtillery [[gun4], "_tgt,_ammo,10"] and put if (_isInRange) then { // you can fire gun4 doArtilleryFire [_tgt,_ammo,10]; } else { hint "not in range"; }; Thank you , its not in range, but i dont understand why , since i can shoot with it across map but Ai cannot ? also idk if i mentioned earlier but that first script worked for me and i had them even further than now so its weird... Share this post Link to post Share on other sites
Daniel Frič 1 Posted August 22, 2018 9 minutes ago, M1ke_SK said: Even at close range they dont want to shoot..... Share this post Link to post Share on other sites
Daniel Frič 1 Posted August 22, 2018 20 minutes ago, M1ke_SK said: you have syntax error and missing " ; " _ammo = getArtilleryAmmo [gun1] select 0; _tgt = getMarkerPos "target1"; _isInRange = _tgt inRangeOfArtillery [[gun1], _ammo]; if (_isInRange) then { gun1 doArtilleryFire [_tgt,_ammo,10]; } else { hint "not in range"; }; i copied this to trigger yet still its happening, they aim like they want to fire, but then they return they aim back to normal Share this post Link to post Share on other sites
M1ke_SK 230 Posted August 22, 2018 Upload demo mission, this is pointless if something is different. Lot of variables can change outcome. Posted code is working perfect, don't know how you are using it. did you named your artyllery "gun1" ? is your marker called "target1" ? etc ... 1 Share this post Link to post Share on other sites
Daniel Frič 1 Posted August 22, 2018 1 hour ago, M1ke_SK said: Upload demo mission, this is pointless if something is different. Lot of variables can change outcome. Posted code is working perfect, don't know how you are using it. did you named your artyllery "gun1" ? is your marker called "target1" ? etc ... yes it is , ill upload demo here for you if u want to check it out, still its weird, hold on sec Share this post Link to post Share on other sites
Daniel Frič 1 Posted August 22, 2018 Also its with mods , as u can see on screens, artillery is from mod, BUT as i said earlier , it worked, and working on other maps so idk whats wrong... https://imgur.com/a/qrTodkF heres picture of mods, cuz idk how to upload picture over here Share this post Link to post Share on other sites
Daniel Frič 1 Posted August 22, 2018 here you have demo https://steamcommunity.com/workshop/filedetails/?id=1489054836 Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted August 22, 2018 43 minutes ago, Daniel Frič said: here you have demo https://steamcommunity.com/workshop/filedetails/?id=1489054836 This won't really help, since I doubt folks want to download the exact same mods you've used just to help debugging. Try loading only the mod needed for the AI gun, and see if the problem persists. Cheers 1 Share this post Link to post Share on other sites
Daniel Frič 1 Posted August 22, 2018 18 minutes ago, Grumpy Old Man said: This won't really help, since I doubt folks want to download the exact same mods you've used just to help debugging. Try loading only the mod needed for the AI gun, and see if the problem persists. Cheers will do Share this post Link to post Share on other sites