Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Simulating Electronic Warfare

  1. #1
    Warrant Officer
    Join Date
    Nov 21 2002
    Location
    Southampton, UK
    Posts
    2,541
    Hi all,

    I was making a map for my squad's Air Wing last night for training purposes and the idea of simulating an electronic warfare mission popped up.

    What I would like to know is this :

    Would it be possible to, through scripting or any other method, stop any/all AA vehicles on a map from engaging a target? I was thinking along the lines of; when the EW platform gets to within a certain distance of an AA vehicle, that vehicle can no longer engage aircraft, and when the EW platform leaves this area, the ability to engage is returned to the AA vehicle.

    I know that the distance from a set point/unit can be used to trigger an event of some sort through scripting, as I've seen this in other scripts, so either by removing all the AA vehicle's ammo (temporarily) or forbidding it from opening fire when these distance parameters are met, my idea should be feasable?

    I don't think anything like this has been attempted before so I'm rather excited about it. It would give us OFP pilots a new mission to perform, other than the usual attack/transport ones we are so used to

    An EW platform is a valuable and vulnerable asset so all sorts of mission possibilities would be opened up

    Mission candidates include:


    Simulating the French C-160 GABRIEL system


    Simulating the US EC-130H Compass Call system


    Simulating the US F-4G Wild Weasel system


    Simulating the US EA-6B Prowler system


    Simulating the Russian Gardeniya family of internally mounted and podded airborne radar/communications-band jammers which can be fitted to most fighter types as well as the Mi-17
    (As stated above, MIG-29, SU-27, SU-25, Mi-17...)

    Simulating the German and Italian Tornado ECR system


    Simulating the US EA-18G growler system




    Original OFP-er and 'old' on here, with little to no idea what's going on these days, so go easy on me. Cheers mate!

  2. #2
    Warrant Officer Mandoble's Avatar
    Join Date
    Nov 10 2005
    Location
    Madrid, Spain
    Posts
    2,020
    Put the following code in the init field of each enemy AA unit:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    &#91;this, ewunitname, desired range&#93;exec&#34;ewjamming.sqs&#34;
    [/QUOTE]

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    ;ewjamming.sqs
    ;
    _aaunit = _this select 0
    _ewunit = _this select 1
    _minrange = _this select 2

    #checkrange
    @ &#40;_aaunit distance _ewunit&#41; &#60; _minrange
    _aaunit setBehaviour &#34;CARELESS&#34;
    @ &#40;_aaunit distance _ewunit&#41; &#62; _minrange
    _aaunit setBehaviour &#34;AWARE&#34;
    goto &#34;checkrange&#34;
    [/QUOTE]

    EDIT:
    The above script is valid for AI units. If you want prevent players to fire, you need to substitute the "_aaunit setBehaviour "CARELESS"/"AWARE" lines by the corresponding set of instructions to remove the AA magazines and to reload them respectively.




  3. #3
    Warrant Officer
    Join Date
    Nov 21 2002
    Location
    Southampton, UK
    Posts
    2,541
    Author of the Thread
    Wow thanks a lot for that, Mandoble, really&#33;

    I&#39;ll go try it now.

    I guess I could associate an elliptical marker, covering the range of the EW platform&#39;s systems, which would be displayed on the map, moving in real time, so that players can see the area affected. How would I do that?

  4. #4
    Warrant Officer Mandoble's Avatar
    Join Date
    Nov 10 2005
    Location
    Madrid, Spain
    Posts
    2,020
    Put the following in the EW unit INIT field:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    &#91;this, markername with quotes&#93;exec&#34;ewmarker.sqs&#34;
    [/QUOTE]

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    ;ewmarker.sqs
    ;
    _ewunit = _this select 0
    _marker = _this select 1

    #placemarker
    _pos = &#91;getPos _ewunit select 0, getPos _ewunit select 1&#93;
    _marker setMarkerPos _pos
    ~1
    goto &#34;placemarker&#34;
    [/QUOTE]

    For example, with a plane named ew1 and a marker named mk_ew1:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    &#91;this, &#34;mk_ew1&#34;&#93;exec&#34;ewmarker.sqs&#34;
    [/QUOTE]

    One option you may play with is the flying altitude of the EW plane, so, the higher, the bigger size of the marker and the larger area affected by the EW emissions, but also less probability of effectively jamming the AA systems.

  5. #5
    Warrant Officer
    Join Date
    Nov 21 2002
    Location
    Southampton, UK
    Posts
    2,541
    Author of the Thread
    Quote Originally Posted by (Mandoble @ May 03 2006,21:23)
    Put the following in the EW unit INIT field:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    &#91;this, markername with quotes&#93;exec&#34;ewmarker.sqs&#34;
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    ;ewmarker.sqs
    ;
    _ewunit = _this select 0
    _marker = _this select 1

    #placemarker
    _pos = &#91;getPos _ewunit select 0, getPos _ewunit select 1&#93;
    _marker setMarkerPos _pos
    ~1
    goto &#34;placemarker&#34;
    [/QUOTE]

    For example, with a plane named ew1 and a marker named mk_ew1:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    &#91;this, &#34;mk_ew1&#34;&#93;exec&#34;ewmarker.sqs&#34;
    [/QUOTE]

    One option you may play with is the flying altitude of the EW plane, so, the higher, the bigger size of the marker and the larger area affected by the EW emissions, but also less probability of effectively jamming the AA systems.[/QUOTE]
    Oooooo well thanks for that

    What would the script for your suggestion look like? I&#39;m a scripting n00b quite obviously

  6. #6
    Warrant Officer Mandoble's Avatar
    Join Date
    Nov 10 2005
    Location
    Madrid, Spain
    Posts
    2,020
    How many ew planes do you plan to have flying in the mission? Only one?
    How many AA units do you plan to have at maximum in the map?

  7. #7
    Warrant Officer
    Join Date
    Nov 21 2002
    Location
    Southampton, UK
    Posts
    2,541
    Author of the Thread
    Well, there will be one EW platform (Hawk&#39;s updated C-130 representing an EC-130H Compass Call) .

    Is the number of AA units necessary? Could I not define all the vehicle types I want to be affected by the EW aircraft somewhere, then needing to know the total amount wouldn&#39;t be necessary?

  8. #8
    Warrant Officer Mandoble's Avatar
    Join Date
    Nov 10 2005
    Location
    Madrid, Spain
    Posts
    2,020
    Well, I will assume you have only one EW plane:

    Script for the INIT field of each enemy AA unit:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    ;ewjammed.sqs by Mandoble
    ;
    _aaunit = _this select 0
    _ewunit = _this select 1

    #checkrange
    ~1
    ?damage _aaunit &#62; 0.9&#58;exit

    ;Nobody inside the aa unit?
    ?count crew _aaunit == 0&#58;goto &#34;checkrange&#34;

    ?&#40;_aaunit distance _ewunit&#41; &#62; ewrange&#58; goto &#34;checkrange&#34;
    _luck = random 1.0
    ;you may try also gunner _aaunit setBehaviour &#34;CARELESS&#34;


    ?_luck &#60; eficiency&#58;_aaunit setBehaviour &#34;CARELESS&#34;
    ;you may try also gunner _aaunit setBehaviour &#34;AWARE&#34;

    ?_luck &#62; eficiency&#58;_aaunit setBehaviour &#34;AWARE&#34;
    goto &#34;checkrange&#34;
    [/QUOTE]

    Script for the INIT field of the EW plane:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    ;ewjamming.sqs by Mandoble
    ;
    _ewunit *** *** *** ***= _this select 0
    _minewalt *** *** ***= _this select 1
    _maxewalt *** *** ***= _this select 2
    _rangeatminalt = _this select 3
    _rangeatmaxalt = _this select 4
    _marker *** *** *** ***= _this select 5

    ;The following two lines assume there is only one EW plane present
    ewrange = 1
    eficiency = 0.0


    #checkrange
    ~1
    ;if too damaged, no more ew jamming
    ?damage _ewunit &#62; 0.5&#58; ewrange = 1;eficiency = 0.0;exit

    ;if no pilot, no ew jamming
    ?format&#91;&#34;%1&#34;, driver _ewunit&#93; == &#34;&#60;NULL-object&#62;&#34;&#58;goto&#34;outofalt&#34;

    _alt = getPos _ewunit select 2
    ? &#40;_alt &#60; _minewalt&#41; &#124;&#124; &#40;_alt &#62; _maxewalt&#41;&#58; goto &#34;outofalt&#34;
    _drg = _rangeatmaxalt - _rangeatminalt
    _dalt = _maxewalt - _minewalt
    _xd = &#40;_maxewalt - _alt&#41;*&#40;_drg/2&#41;/_dalt
    _eff = &#40;_xd + 0.1&#41; / &#40;_drg / 2.0&#41;
    _rg = _rangeatmaxalt - _xd * 2.0

    _marker setMarkerSize &#91;_rg, _rg&#93;
    _pos = &#91;getPos _ewunit select 0, getPos _ewunit select 1&#93;
    _marker setMarkerPos _pos
    _marker setMarkerColor &#34;ColorBlue&#34;

    ;The following two lines assume there is only one EW plane present
    ewrange = _rg
    eficiency = _eff
    goto &#34;checkrange&#34;


    ;Above or below minimum/maximum effective ew altitudes
    #outofalt
    _rg = 1
    _marker setMarkerSize &#91;_rg, _rg&#93;
    _pos = &#91;getPos _ewunit select 0, getPos _ewunit select 1&#93;
    _marker setMarkerPos _pos
    _marker setMarkerColor &#34;ColorWhite&#34;

    ;The following two lines assume there is only one EW plane present
    ewrange = 1
    eficiency = 0.0
    goto &#34;checkrange&#34;
    [/QUOTE]

    Lets say you have two Shilkas and one EW plane named ew1, and one marker named mk_ew1 (ellipse with grid fill).

    For the init fields of the shilkas:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    &#91;this, ew1&#93;exec&#34;ewjammed.sqs&#34;
    [/QUOTE]

    For the init field of EW plane:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    &#91;this, 30, 300, 100, 1000, &#34;mk_ew1&#34;&#93;exec&#34;ewjamming.sqs&#34 ;
    [/QUOTE]

    The arguments are as follows:
    ew unit,
    minimum ew effective altitude,
    maximum ew effective altitude,
    ew range at minimum altitude,
    ew range at maximum altitude
    marker name

    Maximum EW efficiency is for minimum ew effective altitude and minimum range.




  9. #9
    Warrant Officer
    Join Date
    Nov 21 2002
    Location
    Southampton, UK
    Posts
    2,541
    Author of the Thread
    This is wonderful&#33;

    Thankyou so much Madoble

    I noticed while testing your original script (ewjamming.sqs which you posted in your first reply) that the enemy AA vehicles still fire, so I changed the script to this :

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;ewjammingSA11.sqs

    ;
    _aaunit = _this select 0
    _ewunit = _this select 1
    _minrange = _this select 2

    #checkrange
    @ &#40;_aaunit distance _ewunit&#41; &#60; _minrange

    removeallweapons _aaunit

    _ewunit SideChat &#34;---*9S470M1 FIRE DOME* SIGNAL DETECTED. COMMENCING JAM---&#34;

    @ &#40;_aaunit distance _ewunit&#41; &#62; _minrange

    _aaunit addmagazine &#34;9M38_Launcher&#34;
    _aaunit addmagazine &#34;9M38_Launcher&#34;
    _aaunit addmagazine &#34;9M38_Launcher&#34;
    _aaunit addweapon &#34;9M38_Launcher&#34;

    _ewunit SideChat &#34;---OUT OF JAMMER RANGE. SIGNAL JAMMING ENDED---&#34;

    goto &#34;checkrange&#34;[/QUOTE]

    I had to go for the weapon removal option as they didn&#39;t seem to care whether they were in "CARELESS" or "AWARE" mode. They opened fire whenever they wanted to




  10. #10
    Warrant Officer Mandoble's Avatar
    Join Date
    Nov 10 2005
    Location
    Madrid, Spain
    Posts
    2,020
    Shashman,
    if you use ewjamming.sqs for the EW unit, modify the last ewjammed.sqs I write to add the magazines code.

    Note that in their last version ewjammed.sqs is for AA units and ewjamming.sqs is for the EW unit. You may add a new parameter after the marker name, this would be an efficiency multiplier between 0.1 and 1. Pick up this parameter and multiply it by the resulting efficiency. This way you may simulate the different maximum efficiencies of different EW plane types. For example, with a 0.5, the plane would not get more than 50% chances of nullifying AA units at the minimum efective range/alt.

    EDIT:
    About AWARE and CARELESS, you should try to use
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    gunner _aaunit setBehaviour &#34;CARELESS&#34; &#40;or &#34;AWARE&#34;&#41;
    [/QUOTE]
    instead of _aaunit setBehaviour "CARELESS" or "AWARE"

    If the unit has a commander, you may try commander _aaunit setBehaviour "CARELESS" or "AWARE"




Page 1 of 2 12 LastLast

Posting Permissions

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