Page 1 of 7 12345 ... LastLast
Results 1 to 10 of 65

Thread: Artillery fire at area

  1. #1

    Question Artillery fire at area

    How can I make artillery fire at area size 250x250 and at every 10 minutes it fires 5 artillery shells(2 minutes 1 artillery shell)?Artillery shells to be 60 millimeters.
    Thanks
    Editor is my life!

  2. #2
    Try to search in the first ION (PMC) mission. There's something similiar

  3. #3
    Master Gunnery Sergeant Rydygier's Avatar
    Join Date
    Aug 22 2011
    Location
    Poland, Pomerania
    Posts
    1,066
    Well, you can use something like this:

    PHP Code:
    _pos position Center;
    _pX _pos select 0;
    _pY _pos Select 1;

    while {
    not (isNull Center)} do
        {
        for 
    "_i" from 1 to 5 do
            {
            
    sleep 120;
            
    _dX = (random 250) - 125;
            
    _dY = (random 250) - 125;

            
    _pX _pX _dX;
            
    _py _pY _dY;
            
    _bum "ARTY_Sh_81_HE" createVehicle [_pX,_pY,-5]
            }
        } 
    Where "Center" is the name of any placed in editor object.

    I do not know, if there is any available 60mm shell, above is used vanilla ARTY 81mm. Notice "-5" value - shell will be spawned 5 meters below ground level. This will noticeable reduce explosion damage range to be more like 60mm (you can experiment with this value to adjust strenght of explosion, 0 will be maximum here).

    I think, that this PMC arty is more sophisticated, and spawns shells randomly, but never to close to player's group. And looks, like center in that mission is player position. Not sure though. Anyway such thing is possible as well if needed.

  4. #4
    I think it's better in this way
    Code:
    _pos = position Center;
    _pX = _pos select 0;
    _pY = _pos Select 1;
    
    while {not (isNull Center)} do
    {
        for "_i" from 1 to 5 do
        {
            private ["_dX","_dY","_tX","_tY"];
            _dX = (random 250) - (random 250);
            _dY = (random 250) - (random 250);
    
            _tX = _pX + _dX;
            _tY = _pY + _dY;
            _bum = "ARTY_Sh_81_HE" createVehicle [_tX, _tY, 10];
            sleep 120;
        };
        sleep 600;
    };
    =BTC= Col.Giallustio
    Italian Tactical clan

    All my works

  5. #5
    Lance Corporal KrisSerbia's Avatar
    Join Date
    Apr 7 2012
    Location
    Beograd, Serbia
    Posts
    45
    Author of the Thread
    Thanks,but where I need to put PHP code?Sorry,I'm new.
    Edit:Find how.
    Last edited by KrisSerbia; Jun 15 2012 at 14:36. Reason: Find how

  6. #6
    Create a sqf file called "arty.sqf", copy the code inside the file and save it inside the folder mission. Then create another sqf file called "init.sqf" and put it inside your folder mission. Open it ("init.sqf") and write
    Code:
    _arty = [] execVM "arty.sqf";
    Save it.
    In the editor create an object and call it "center". I suggest u to use an empty H.
    Then save the mission and you're good to go

  7. #7
    Lance Corporal KrisSerbia's Avatar
    Join Date
    Apr 7 2012
    Location
    Beograd, Serbia
    Posts
    45
    Author of the Thread
    Thanks.

  8. #8
    Quote Originally Posted by KrisSerbia View Post
    Thanks.
    You're welcome

  9. #9
    Master Gunnery Sergeant Rydygier's Avatar
    Join Date
    Aug 22 2011
    Location
    Poland, Pomerania
    Posts
    1,066
    Quote Originally Posted by Giallustio View Post
    I think it's better in this way
    Code:
    _pos = position Center;
    _pX = _pos select 0;
    _pY = _pos Select 1;
    
    while {not (isNull Center)} do
    {
        for "_i" from 1 to 5 do
        {
            private ["_dX","_dY","_tX","_tY"];
            _dX = (random 250) - (random 250);
            _dY = (random 250) - (random 250);
    
            _tX = _pX + _dX;
            _tY = _pY + _dY;
            _bum = "ARTY_Sh_81_HE" createVehicle [_tX, _tY, 10];
            sleep 120;
        };
        sleep 600;
    };
    But this way there will be 10 minutes of shelling by one shell per 2 minutes, then 10 minutes of pasue and again shelling, again pause... Unless this is, what was needed. I understood, that is needed just one shell per 2 minutes, so 5 shells per 10 minutes, endless. In fact simplier will be then:

    PHP Code:
    _pos position Center;
    _pX _pos select 0;
    _pY _pos Select 1;

    while {
    not (isNull Center)} do
        {
        
    sleep 120;
        
    _dX = (random 250) - 125;
        
    _dY = (random 250) - 125;

        
    _pX _pX _dX;
        
    _py _pY _dY;
        
    _bum "ARTY_Sh_81_HE" createVehicle [_pX,_pY,-5]
        } 
    ("for to do" was only remain after another version, used by me, where was quick series of shells from time to time);

    Also

    PHP Code:
    (random 250) - (random 250
    is not exactly same as

    PHP Code:
     (random 250) - 125 
    First method does not provide a uniform random distribution across 250 meter square, because where random number is picked twice and both are added, there is involved some quasi-gaussian distribution, I think. I can be mistaken here. Of course not always this matters, and sometimes we need exactly gaussian-like distribution...

    EDIT: if needed also this "whistle" sound of falling shells:

    PHP Code:
    _pos position Center;
    _pX _pos select 0;
    _pY _pos Select 1;

    while {
    not (isNull Center)} do
        {

        
    sleep 120;
        
    _dX = (random 250) - 125;
        
    _dY = (random 250) - 125;

        
    _pX _pX _dX;
        
    _py _pY _dY;
        
    _bum "ARTY_Sh_81_HE" createVehicle [_pX,_pY,100];
        
    _bum say3D "whistle";
        
    _bum setVelocity [0,0,-300];
        } 
    Where "whistle" is name of sound defined in description.ext, but this is more complicated. And not sure, if 100 meters and 300 of velocity is enough.
    Last edited by Rydygier; Jun 15 2012 at 16:32.

  10. #10
    Quote Originally Posted by Rydygier View Post
    But this way there will be 10 minutes of shelling by one shell per 2 minutes, then 10 minutes of pasue and again shelling, again pause
    mmm maybe i don't understand but this is what he wrote:
    Code:
    every 10 minutes it fires 5 artillery shells(2 minutes 1 artillery shell)
    Quote Originally Posted by Rydygier View Post
    Also

    PHP Code:
    (random 250) - (random 250
    is not exactly same as

    PHP Code:
     (random 250) - 125 
    I think it's better instead 'cause with your way you'll have an area of 125x125 or less...With mine you could have an area of 250x250 and it's more random...Just an example:
    PHP Code:
    (random 250) - (random 250)  -> 200 -100 100 
    PHP Code:
    (random 250) - (random 250)  -> 100 -200 = - 100 
    PHP Code:
    (random 250) - (random 250)  -> 250 -250 
    Just my 2 cents

Page 1 of 7 12345 ... LastLast

Similar Threads

  1. Opfor AI to fire mortar in a certain area
    By thefox1787 in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 1
    Last Post: Apr 1 2011, 20:16
  2. How to get an artillery strike on an area?
    By mervemarathon in forum ARMA 2 & OA - GENERAL
    Replies: 0
    Last Post: Aug 31 2009, 01:05
  3. Ordering AI to area fire?
    By CoriolisForce in forum ARMA 2 & OA - GENERAL
    Replies: 13
    Last Post: Aug 13 2009, 01:44
  4. Is there an area-fire command?
    By PoorOldSpike in forum ARMA - GENERAL
    Replies: 29
    Last Post: May 20 2009, 01:52
  5. Is area-fire possible?
    By PoorOldSpike in forum ARMA - GENERAL
    Replies: 0
    Last Post: May 18 2009, 15:37

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •