Jump to content
Sign in to follow this  

Recommended Posts

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

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
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

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
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
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

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 ...

  • Like 1

Share this post


Link to post
Share on other sites
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

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
43 minutes ago, Daniel Frič 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

  • Like 1

Share this post


Link to post
Share on other sites
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×