Jump to content

GazDesignate - Laser Designator Script for SA342M - Gazelle

Recommended Posts

Hey helicopter pilots,


if you (like me) just can't wait any longer for the OH-58D to finally be released, and want to get in on the action of designating targets for our fast and high flying buddies a little earlier, I created something that might interest you!


This script adds the ability for Pilots of the SA342M to designate ground targets by laser.


It includes the following features:


  • -Configurable laser codes and laser code presets
  • -Automatic tracking of the Viviane LOS and recalculation of the lased point
  • -Configurable snapping function to automatically snap the laser to nearby targets
  • -Lasermodes: IR (Visible in NVG), Laser, or both
  • -Configurable load time before menu options are created
  • -No MIST or MOOSE needed


Laser configuration and activation is done through options in the F10 radio menu, I highly recommend the use of macros. To that end I included an option in the config section of the script that allows you to delay the creation of the menu entries. That way you can control where in the F10 menu the scripts main menu option is located.


How do you load the script?


Including the script in missions works similar to CTLD. First you must enter the pilot names of all Gazelles, you want to use the script with, into the list of names at the top of the script. The name must be the same as the one specified in the Field "Pilot Name" in the mission editor.

Please note that the script only works with the M-variant of the gazelle. All other Gazelles will be ignored.


While you have the script open anyway, maybe take the time and see if the options for delaying the menu creation are configured to your liking.

You can also enter lasercodes into the provided list, or change existing ones. Please note that only the last 10 entries in the list are loaded into the ingame radio menu.


Once you made your adjustments, don't forget to save. Now, to get the script into you mission, you have to set up a trigger that performs a "DO SCRIPT FILE" action at the beginning of the mission. To do that either use a trigger of the type MISSIONSTART or use a ONCE trigger, with a condition of TIME MORE (x seconds). 


Now you should be all set up. After entering a Gazelle M you should first get a message, that tells you that GazDesignate is loading. After a few seconds (or more, depending on how you configured it) the loading message will update to tell you that the script has loaded. Check the F10 - Other radio menu. There you should now find an entry that says "Laser designator". Congratz, you are ready to go!


How do you use it?


If you take the time to read the menu entries, the use of the script should be quite self explanatory. I will only highlight a few things.


The range setting is only there in case the automatic laser point calculation fails or is to inaccurate. Note that I included an option to make relative changes to the range currently dialed in. I have macros bound to these options...very useful for quick adustments. You can check the accuracy of the automatic range calculation by comparing the number it returns on laser activation or slewing, to the number your rangefinder in the Viniane gives you. If the deviation is higher than the blast zone of the weapons you want to lase onto your target, you need to make some manual adustments. Range adustments can be done while the laser is active. Note that I included a snapping function that can be configured in the script file. Per default the snapping distance is set to 30 m. This means that, once the script has calculated a target point for the laser, it searches for units within a radius of 30 m around that point. If it finds a unit, the laser is automatically pointed at the position of that unit. You can turn off the snapping function by setting the search distance in the config section to 0.


Once you activate the laser in one of its modes, the activation options are removed. Instead you get a "turn off" option. If the option for deactivating the laser sits at the same place where the "Designate (Laser) option was before, so it can be accessed by the same macro. I'd like to take credit for that, but it's just a "happy little accident", that i had not planned for but am more than happy about!


Once the laser is turned on, it will automatically follow the sights orientation, the laser point is recalculated at an interval that you can adjust in the config section of the script file. Out of the box the script recalculates every 0.1 seconds, but only if the sight has been moved. I use a Ryzen 7 3700X and the cpu load induced by the recalculation doesn't rise above the "background noise", but on some smaller cpus, or on servers with a high player load, there may be permormance issues. Thus I included the option to increase the interval between recalculations. The more acute the angle to the ground gets, the less accurate the calculated range will be. Curiously the deviations in the calculated ranges provided by the script are about the same in magnitude as the deviations in the measurements with the Gazelles own rangefinder.


As you know, the Gazelle is not really that stationary in auto hover, but is always swinging side to side and up and down. Therefore I had to dampen the sensitivty of the script to orientation changes of the sight a little bit, because otherwise it would constantly try to recalculate the laser spot. This dampening is mostly felt on the y-axis of the sight. The x-axis has less variation and can be updated at a higher resolution. My recommendation: When lasing targets in the distance (>5000 m), first place the sight left or right from the target and then, with the laser activated, slew the sight over the target. Sometimes you have to wiggle around for a bit, but you should in most cases be able to get the laser to recognize the target. If that method fails, you can still put in the range manually. 


When first starting it, or slewing it around, the laser is only stabilized in the horizontal axis, I recommend to only adjust the lased point from a leveled out hover position. When the laser is active, and you don't manually move it, it should stay on the position targeted by the Viviane sight, even if you move your helicopter. Abrupt maneuvers will still cause the laser to veer of.


One minor bug stills exists, that I could not yet snuff out: When you have the autopilot in slave mode, it does not update the horizontal orientation of the laser on rotation of the helicopter, only once you wiggle the sight up and down a little, it will update. Probably a mistake in the logic of the script, I will look into that some more.


How does it work?


The script uses the functions spot.createLaser, spot.createInfraRed, spot.setPoint and spot.setCode to create and update the laser.

The orientation of the Viviane sight was a bit more tricky, but I found out that you can use Unit.getDrawArgumentValue(), to access the curent animation state of the Viviane sight (ArgumentValue 215 and 216). The rest was math (and a bit of logic)!


A quick note on how the range calculation works. The main problem that I faced was that I could not acces the rangefinder readings through the scripting engine. Manually entering 5 digit ranges through the F10 menu is not exactly convenient so I tried to find a way to calculate the range with the numbers I had: Helicopter altitude (BARO and AGL) and heading + vertical angle of the Viviane sight. I first attempted trigonometry, but that only worked (semi-accurately at best) in cases where the target area was significantly lower than the helicopter and at about the same elevation as underneath the helicopter. In all other cases the results where highly inaccurate or just plain wrong.

I ended up having to "brute force" the diagonal range to the target area: I run a for loop that calculates the elevation of points increasingly further away from the helicopter along the Vivianes LOS. The calculated elevation is checked against the land height at the given point (land.getHeight).

The point where the calculated elevation slips below the land height is where the laser from the rangefinder touches ground. I first run a loop with very high distances between the checks. The range resulting from that loop is then fed into the next one, that works with smaller intervals. This cycle continues until I'm down to increments of 0.1 m. In that way I can calculate a very accurate diagonal distance without having to run a loop that checks from 1-20000 with increments of 0.1.



2021/02/24 v. 1.2 - new version is attached to this post

  • Fixed a minor bug that prevented status messages from being shown when changing the laser code digit per digit
  • Tweaked the sensitivity to changes in sight orientation, laser spot follows the sight orientation more closely now


Known Bugs

  • had a bug once in multiplayer where a player, when respawning after crashing his helo, could not activate his laser. Haven't been able to reproduce yet, but if any of you run into the same problem, let me know please (best with log file attached 🙂 )




Edited by CakeSorbus
Script Update
  • Thanks 4
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...