Announcement

Collapse
No announcement yet.

Warning to all forces operating in Sahrani! (Anti-Air Scripts)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Warning to all forces operating in Sahrani! (Anti-Air Scripts)

    Attention US forces operating in the Kingdom of South Sahrani!

    Recent intel indicates that the armed forces of the Democratic Republic of Sahrani (DRS) has begun deployment of a new air-defense system. Short-range missile launchers have been tied into a fire control system driven by a network of low-powered radar stations. The radar stations operate at low enough power-levels that we've had difficulty destroying them with our normal anti-radiation weapons.

    We've captured a pair of these radar systems and a launcher, and are currently testing them at the Sahrani airport. Early examination indicates that the AA missile launchers are based on 'Little Red Tractor' (LRT) technology. Truly a dastardly weapon.

    --

    A zip of the script files is attached, as well as a simple sample mission. Make sure your init.sqf looks like the one in the sample mission, or it won't work!

    To add a radar station:
    1. Create your radar object in the editor. You can use any object type you want, although I recommend Radar objects.
    2. Assign those radar objects some names (like radar1, radar2, etc...).
    3. Add lines to the init.sqf file after the #include lines (and before it execVM's the aaSystem script) that look like: [radar1, 1000] call radar_initStation;

    radar1 is the name of the object and 1000 is the range of the station, in meters. You can make any range you like.

    To add a new launcher:
    1. Create the launcher object in the editor. Again, you can use any object type you want, although I recommend tractor objects. It is little red tractor technology, after all. :)
    2. Assign the object a name (like missileLauncher1).
    3. Register it in the init.sqf file, just like radar objects: missileLauncher1 call missile_initLauncher

    You can't control the maximum range of the missiles, although a launcher won't fire on a target more than 5km away. A missile launcher will not fire if it has been destroyed (duh). The system will only target things it can detect, and radar towers will not detect anything if they have been destroyed (duh). Missiles will not track a target without radar guidance; with radar guidance their probability of a kill is above 90%. The system is entirely automated and does not, at the moment, alert ground forces to your presence (not until I finish my AI scripts).

    I haven't had a chance to test these scripts in MP mode... they should work though. Bug reports are welcome. :)
    Attached Files

  • #2
    Re: Warning to all forces operating in Sahrani! (Anti-Air Scripts)

    Oh nice.. very useful!!!


    Comment


    • #3
      Re: Warning to all forces operating in Sahrani! (Anti-Air Scripts)

      Jep this is extremely impressive.. did you program this from scratch?

      One thing I would like to modify is the tendency of the missile to "circle" the target if it misses. I would prefer to have a variable I can set that allows me to say "if you get within _xyz distance from _target" either end further guidance or perhaps even blow-up. Is something like this possible?

      Also is it possible to slow the missles flight speed or is that inherent in the BI programming of the unit?


      Comment


      • #4
        Re: Warning to all forces operating in Sahrani! (Anti-Air Scripts)

        Originally posted by Shiner View Post
        Jep this is extremely impressive.. did you program this from scratch?

        One thing I would like to modify is the tendency of the missile to "circle" the target if it misses. I would prefer to have a variable I can set that allows me to say "if you get within _xyz distance from _target" either end further guidance or perhaps even blow-up. Is something like this possible?

        Also is it possible to slow the missles flight speed or is that inherent in the BI programming of the unit?
        Yeah, but once I worked out how to do full 3D control of an object's orientation it only took an afternoon. The version included in my hostage rescue mission is slightly newer, with a smarter guidance system to better track fast movers.

        And yes, something like that would be possible. I actually wrote the scripts for the hostage rescue mission, so a gauranteed kill was more important than perfect realism. Having the missile blow up based on a proximity fuse in case of a near-miss was something I wanted to put in the script, but didn't get around to.

        Missile speed is a function of thrust and aerodynamics, and I can't change the thrust values on missiles with just a script. There are two ways to get a slower missile... the first is to replace reference to "M_Sidewinder_AA" to "M_Stinger_AA" in the scripts\missile\fireMissile.sqf file... the sidewinder has a lower thrust, so it'll go slower. The other way is to directly control missile speed, but this is a lot more work. Why do you need slower missiles anyway?

        There's a marketting film for the weapon system now too. :)

        Comment


        • #5
          Re: Warning to all forces operating in Sahrani! (Anti-Air Scripts)

          My thoughts were to use the AA for more of an "atmospheric" element. For example, your flying into enemy held territory; you get a warning beep (add eventHandler "incomingMissle"); you go evasive and a missle goes flying by and explodes 10 meters out causing non-critical damage to your chopper. You continue on sweating every inch above the ground.

          I will definately make the switch to the stinger that will probably suffice for the missle characteristics I want.

          My thoughts on changes I think would make this more useful for my missions.:

          Radar only fires at target when _target is more than _xyz (20-40) meters above ground (perhaps for more than _xyztime)
          When fired process _target add eventHandler ["incommingMissle", {warn target of incomming missle}]
          When missle is within _xyz (5-10) meters exit guidance package (fly straight) and/or explode if possible

          Do you want me to give a shot on making these changes or do you want to keep my fingers out of your pretty script :)


          Comment


          • #6
            Re: Warning to all forces operating in Sahrani! (Anti-Air Scripts)

            I originally created the script for the hostage rescue mission. So not exactly atmospheric... but more about mission gameplay- to deny access to parts of the map in a realistic way until some objective has been accomplished. But it's all part of trying to add more 'environment' to the Armed Assault mission maps than what is there now.

            1. IIRC, the guidance system will already only detect and track aircraft a certain altitude above ground... the magic number is in radar\detecting.sqf (currently 10m). If you're in range of a missile launcher and pop above the altitude, it'll lock on and fire a missile at you... going below the altitude will evade the radar and the missile will loose its lock and continue flying straight until it is re-established. You could make this smarter by putting in a delay on the tracking when a lock is reaquired. I can think of a number of other possible improvements that could be made in this area, although the words 'extended Kalman filter' came to mind and it reminded me that there are diminishing marginal returns. :-)

            2. If the game engine doesn't fire off the incommingMissile event handler itself (which I bet it doesn't) then I have no clue how to do this. There's no convenient getEventHandler function which to use... maybe the game saves event handlers in the config tree or something. For now I'm resigned to saying it's just not going to work. It shouldn't be too hard to implement a custom event though- just put the hooks to call a supplied function in aaSystem.sqf; it keeps track of current targets and newly identified targets, so it should be possible to call a custom function whenever a weapons lock is made, or lost.

            3. Exiting the guidance package when you're within a few meters of the target would work fairly well with some modifications... Basically the script fireMissile.sqf is the main missile loop, and it calls the guidance script (missileGuidance.sqf) ever tick, until the guidance script returns nil data. At that point it deletes the missile object. The missile's guidance script continues trying to track until the missile has been destroyed, at which point it returns nil data, indicating to the fire script to shut down the control loop and delete the object.

            To shut down guidance you'd want to change the guidance script to return nil once its distance from the target goes below a certain distance. Then after the main loop in fireMissile.sqf but before the deleteVehicle command, put in something like waitUntil (position _missile call vector_norm) == 0;

            You could do a proximity fuse by changing the condition to something like
            waitUntil ((position _missile call vector_norm) == 0) || (_missile distance _target < _fuseDistance);

            Then put in a check after that wait to see if the missile has been destroyed or is within fuse distance. If it's in fuse distance wait a few hundred milliseconds, check to see if the missile is still alive (it might have scored a direct strike). If it is, it's probably missed the target, so detonate it. Then destroy the object.

            I'm not sure how to detonate the missile from within a script though. I'd probably just assign some inverse-square damage to every object in the vicinity and call it a day.



            I think the MP bug can be fixed by replacing the createVehicle command in fireMissile.sqf with createVehicleLocal.


            Feel free to make whatever changes you'd like. The only change I'm hugely interested in making myself right now is fixing the MP mode bug. Right now I'm spending my time on an AI script and a big 'environment' system (auto-populate the entire map outside the 'mission area' with civilians and military forces).

            Comment

            Connect

            Collapse

            TeamSpeak 3 Server

            Collapse

            Advertisement

            Collapse

            Twitter Feed

            Collapse

            Working...
            X