Jump to content
Sign in to follow this  
JasperRab

commandArtilleryFire not working.

Recommended Posts

Good day Forum,

 

I've come across a issue with the command commandArtilleryFire.

 

Me and one of my friends are trying this command out in a trigger but it doesn't do anything.

 

I've even tested with the debug execution which didn't work.

 

 

This what I'm using:

 

mortar commandArtilleryFire [(getMarkerPos "marker"),"8Rnd_82mm_Mo_shells",1];

 

The mortar guy is named Mortar and the marker is named marker.

 

 

I hope you guys could tell me what I am doing wrong here, there are no error's in the rpt file's and I think no error's I am doing with the command.

 

- Rabbit

Share this post


Link to post
Share on other sites

Works fine here unless it's out of range then nothing happens.

Share this post


Link to post
Share on other sites

Ok just tried it again and it worked, Only problem is I'm trying to have it work with the Podnos 2B14 from RDS and this isn't working, is there anything extra that I need to do for this to have to work?

Share this post


Link to post
Share on other sites

Was discussed here yesterday. I also added a small function which shows some debug data.

 

For the RHS vehicle, make sure that you've choosen the correct ammunition class name.

Share this post


Link to post
Share on other sites

Was discussed here yesterday. I also added a small function which shows some debug data.

 

For the RHS vehicle, make sure that you've choosen the correct ammunition class name.

 

I had a look but It didn't really helped me. Today I tried it again with just RDS, ACE 3, ACRE 2, and CBA loaded up, but no success.

Thing I see happen is that the unit is turning to the right direction, but doesn't fire.

Just to make sure, if I use the command getArtilleryAmmo [gun]; it will give me all the right usable ammo for the gun right?

Also distance of the target is about 500 which shouldn't be a problem right?

 

And when I use the default arma 3 mortar on the same spot I don't have any issues.

 

I will have a look at the function that you made later on.

Share this post


Link to post
Share on other sites
getArtilleryAmmo [gun] 

returns an array, and therefor you would need to select on of the entries e.g.

(getArtilleryAmmo [_arty]) select 0;

Also, I think your distance is too short. The vanilla artilleries have a range from ~600 to ~66000 meters.

 

The regular Sochor shell's range is about 800m-66km.

 

From the thread I've posted above

Share this post


Link to post
Share on other sites
Also, I think your distance is too short.

Ok just moved the target somewhat further away and it worked, which is weird as I used the default arma 3 one and it worked at the shorter range.

Share this post


Link to post
Share on other sites

It's not necessarily weird. The range also depends on the ammunition which is used.

Share this post


Link to post
Share on other sites

scrap that last, forgot that I was still using the mk6, the podnos isn't working still.

Even with the range increase.

Share this post


Link to post
Share on other sites

I've just tried it myself with the RDS Podnos, and it doesn't seem to work, even though the target is in range. Guess that's caused by the modification.

Share this post


Link to post
Share on other sites

I've just tried it myself with the RDS Podnos, and it doesn't seem to work, even though the target is in range. Guess that's caused by the modification.

 

Ok thanks at least I know it's not just me and my game, I will probably look into an other mortar then.

Share this post


Link to post
Share on other sites

To test it, try this code. Open your editor and copy this code inside the init of your mortar unit:

TEST = this spawn
{
private ["_magClass"];
while {alive player} do

{

_magClass = currentMagazine _this;

if (getpos player inRangeofArtillery [ [_this], _magClass])
then {

        effectiveCommander _this commandArtilleryFire [getpos player, currentMagazine _this,  1];

        _This globalChat format ["Fire! Using: %1", _magclass];
        _this setVehicleAmmo 1;
} else

{ _This globalChat "Player is out of range" };
hintsilent format ["Distance: %1", player distance _this];
sleep 4;
};
};

Share this post


Link to post
Share on other sites
/*
    Author: Revo

    Description:
    Let an artillery fire on the given position

    Parameter(s):
        0: object  - artillery vehicle
        1: array   - position of target, default [0,0,0]
        2: string  - ammunition type, if empty then random one is selected, default ""
        3: number  - number of rounds, default 5
        4: boolean - debug on/off, default false
        5: boolean - unlimited ammunition, default true
        
    Returns:
    -
*/

_artillery     = param [0,objNull];
_pos         = param [1,[0,0,0]];
_ammoClass  = param [2,""];
_numRounds    = param [3,1];
_debug         = param [4,false];
_unlimitedAmmo = param [5,true];


//select a valid ammunition type if none was given
if (isNil "_ammoClass") then
{
    _ammoClass = (getArtilleryAmmo [_artillery]) call BIS_fnc_selectRandom;
};
//check if target is in range, if not, displays an error message
_inRange = _pos inRangeOfArtillery [[_artillery], _ammoClass];

if (_inRange) then
{
    _artillery doArtilleryFire [_pos,_ammoClass ,_numRounds];
}
else
{
    ["Target is not in range"] call BIS_fnc_error;
};
//display important information
if (_debug) then
{
    _eta  = _artillery getArtilleryETA [_pos,_ammoClass];
    _distance = _artillery distance2D _pos;
    hint format ["ETA: %1 seconds\nDistance %2 meters\n In Range: %3\nAmmunition Type: %4\nUnlimited Ammo: %5",_eta,_distance,_inRange,_ammoClass,_unlimitedAmmo];
};
//fills ammunition of given artillery once fired (would actually need to wait until fire mission is completed in order to completely rearm it)
if (_unlimitedAmmo) then
{
    _artillery setVehicleAmmo 1;
};


Here is the function I used in the other thread, it's basically the same. Maybe someone searches for something like that, then he'll find it here.

Share this post


Link to post
Share on other sites

To test it, try this code. Open your editor and copy this code inside the init of your mortar unit.

 

OK thanks I tried it and it told me it was possible to fire, unfortunately it doesn't work, probably to do with the RDS units.

 

But thanks for that nice script will help me in the future.

Share this post


Link to post
Share on other sites

I'm experiencing something weird right now trying to make a simple mission.

 

I used a RHS USMC as player and a RHS BM21 on Chernarus. In the BM21s init I have "this commandartilleryfire [getpos T1, getartilleryammo [this] select 0,5];". At a distance perfect for shooting (not to far not to short) is a Game logic named "T1".

 

I started next to the game logic expecting to see explosions but nothing happened. So in the editor I put my unit close to the BM21 to see what happens and restarted. Then it shoots and I can hear the rockets exploding in the distance. If I move myself back to the target nothing.

If I moved my unit halfway I could hear the shots, see the rockets and hear the explosions. If I moved myself almost to the target I got the same result. But as soon as I was "too close", or further away, nothing happens. It only kept shooting if I moved away after being close to it. If I moved closer from the target to the BM21 nothing happened until I was really close. Then I could move away from the BM21 and it kept shooting... This move is in the editor so it's a restart between the attempts and I ended up using the same spots.

 

So I tried the same setup on Altis with NATO as player, a 2S9 Sochor and the same game logic at the same distance with the same code.

I get the same result. This is stable 1.50 with no mods active.

 

For some time It didn't shoot at all so I changed unit to CSAT and stood close to the 2S9 and then it started again. Until I have my unit too far away. If I add zeus and move the camera to the 2S9  i can see that the gun is not raised.

 

Wtf?

Share this post


Link to post
Share on other sites

My guess is that commandArtilleryFire has some check in it, if there are friendly units nearby, and if that's the case deletes the shell, but that's just a wild guess.

Perhaps, commandArtilleryFire checks for nearby friendly units around the target, and if that's the case, it deletes the shells. (Only a wild guess)

Share this post


Link to post
Share on other sites

No, the arty unit itself doesn't shoot. It's very strange.

 

But I tried to name the arty unit and use a trigger instead and that works just fine. So I can make my mission no problem. But I'm sure there is a strange bug when trying the above mentioned scenario.

 

Unless it's the normal Bohemia fraggles again. You know suddenly it just stops working or a different outcome happens. And the day after it works again (after you have wasted many hours in research and alternatives trying different workarounds...). 

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  

×