Results 1 to 10 of 10

Thread: Artillery Aiming?

  1. #1

    Artillery Aiming?

    Is there a way, within an sqf script, to have the artillery take aim at a position (in format [x,y,z] of course) so when it fires the rounds come down from above?

    I've tried lookAt but you have to make the gun point up and then its guess and check to try to get the rounds to land anywhere within a mile of the target.

    I'm trying to make a small "from scratch" script that has artillery fire at a predesignated spot after being triggered. I would know how to do the rest if I just could figure this part out.

    So maybe if I knew what the artillery module uses for the first step of a fire mission when the guns take aim I could use that for my script. Any help or advice you guys can give I would greatly appreciate!

  2. #2
    First Lieutenant Manzilla's Avatar
    Join Date
    May 30 2007
    Location
    In the lab cooking up some serious s#%t!
    Posts
    5,115
    madbull's script does that. It's a great script, I use it in my missions. There is other stuff that it does as well but I only use the artillery portion.

    http://forums.bistudio.com/showthread.php?t=94280
    (God damn bananas..... again)

    Join the most rootin', tootin'est crew on these here forums! That's right folks we're darn tootin'.

    Mike Tyson's ode to Manzilla's SP playing style:
    My style is impetuous. My defense is impregnable and I'm just ferocious.... I want your heart, I want to eat his children! Praise be to Allah!

  3. #3
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    why not just fake it???

    create a invh h or gl at a approx height in the direction to the target and then dowatch that.
    then fire and collect and delete "bullet" with a fired eventhandler and then spawn a shell at real target area at max precision..

    Or better, just use the arty modules as they work nicely
    My scripts:
    Spoiler:

    what to do when posting any kind of code dammit!!

    Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

  4. #4
    Quote Originally Posted by Manzilla View Post
    madbull's script does that. It's a great script, I use it in my missions. There is other stuff that it does as well but I only use the artillery portion.

    http://forums.bistudio.com/showthread.php?t=94280
    So he has an actual script in there that calculates trajectory and whatnot?

  5. #5
    First Lieutenant Manzilla's Avatar
    Join Date
    May 30 2007
    Location
    In the lab cooking up some serious s#%t!
    Posts
    5,115
    Quote Originally Posted by masonkiller View Post
    So he has an actual script in there that calculates trajectory and whatnot?
    I'm pretty sure it does. It's an intense script. It seems to be the best one out there...at least the most advanced.

  6. #6
    I'm just surprised BI doesn't have a command to use that aims the weapons

    Oh and while I have you, how do I get the laser designator position to work in a script? I tried _ArtyArea = position laserTarget player;

    but the script doesn't run

    ---------- Post added at 01:34 ---------- Previous post was at 00:22 ----------

    Quote Originally Posted by Demonized View Post
    why not just fake it???

    create a invh h or gl at a approx height in the direction to the target and then dowatch that.
    then fire and collect and delete "bullet" with a fired eventhandler and then spawn a shell at real target area at max precision..

    Or better, just use the arty modules as they work nicely
    What I've been doing is using createVehicle and setting the z position at about 7500-9000. That way the artillery rounds were coming down pretty fast. Is there a way to have the rounds "pre-accelerated" so they are moving quick right when they are spawned?
    Last edited by masonkiller; Apr 29 2011 at 00:37.

  7. #7
    Just create a arty template and tell the battery to execute a fire mission.

    Code:
    // Mission template.
    _heTemplate = ["IMMEDIATE", "HE", 0, 15];
    
    // Execute Fire mission
    [battery, targetPosASL, _heTemplate] call BIS_ARTY_F_ExecuteTemplateMission;
    all the info you need to do it here :

    http://community.bistudio.com/wiki/A..._fire_missions

  8. #8
    Yeah I've used the artillery module before but its not exactly what I'm looking for but thanks. I've decided to opt for what Demonized said about faking it. So I mainly want to know about if there is a way to do a createVehicle and have it spawn with an initial acceleration and possibly direction.

  9. #9
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    use the setvelocity command to acellerate them, maybe in combination with setVectorDirAndUp.
    or simply setPos them down in a very quick loop. (recomended)

    PHP Code:
    while {(getPos _bullet select 2) > 0.3} do {
       
    _pos getPos _bullet;
       
    _bullet setPos [_pos select 0_pos select 1; (_pos select 2)-0.1];
       
    sleep 0.01;
    }; 
    experiment with different values to get good result, as gravity is slow in arma when just spawned in air.

    Edit, in the above setPos example you can also offset it a little as well in any direction to simulate a arc and not direct drop down, but if its fast i dont see it as anything other than frosting, because noone will probably see it?

    Edit: changed alive in while loop to height check instead.
    Last edited by Demonized; Apr 29 2011 at 08:29.

  10. #10
    Thanks a lot guys you're a big help to a newbie scripter!

Posting Permissions

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