Nou's Forward Observer Script v0.5
September 11, 2009
This will simulate a forward observer attached to a gun battery. It is ran on a unit which then begins to search in a radius around it (500 meters) for enemy units. It finds the largest group of units (a group in this case consists of units within 50 meters of anyone unit) and begins to execute a fire mission on them.
When it executes a fire mission it may or may not adjust fire, up to 2 adjustments of fire. A majority of the time it will Fire For Effect on the first mission. It determines the number of rounds based off of the number of units at the target, times a force multiplier that adds rounds if there are tanks or IFV in the area, the maximum number of rounds per tube per mission is 8. Dispersion is set at a value of 12.5 meters times the number of rounds up to a maximum of 200 meters.
Once the mission completes it then waits a defined amount of time and it starts again. If the largest group is within 120 meters of the last mission it moves on to the next group and fires against it. It will repeat this until all units are either dead or disabled within range of the FO.
Applicable values for side are (these are the objects, not strings):
junk = [foUnit, artilleryModuleBattery, numberOfMinutesBetweenMissions, side] execVM "fo\forward_observer.sqf";
west, east, resistance, civilian
This and the engage.sqf file MUST BE PLACED IN A FOLDER CALLED "fo" and called from that folder!
1. Place a couple artillery pieces grouped together on the map.
2. Place an Artillery Module and sync it with the artillery group leader. Name this module something like "myBattery"
3. Place a unit that you want to act as your forward observer, it can be any unit really.
4. In the init line of your forward observer place the follow code:
5. The above code will tell the unit to use "myBattery" to search every 1 minutes for units aligned with the "west" side.
junk = [this, myBattery, 1, west] execVM "fo\forward_observer.sqf";
6. Any units within 500 meters of the forward observer will be engaged until they are killed or disabled.
Please review the included example mission if you have any trouble.
1. When engaging only one target it will take twice the amount of time to fire on it due to it considering that the FO should engage another target first and it resets (otherwise it sits there and attacks the largest target only).
2. Sometimes the count of units in the area is slightly off, do not know why...
1. Add in more configuration options for the script (round type, search radius, etc).
2. Add in better use of adjust fire, make it so previously hit areas do not use the adjust fire simulation.
3. Control multiple batteries from the same FO (simulate a FDC in control of multiple batteries).
4. Add radio calls for use with missions where the FO is working with the player.
5. Add better debugging code!!!!
6. Add better commenting of code!!!
I hope people enjoy and use this. Remember, its not my fault if something breaks because of this, so use it at your own risk! Also, I seriously doubt this will occur, but if you do use this in a commercial product please let me know so I can be proud of it, and make sure you keep this header in the script!!!
Please feel free to mirror if you want. Thank you!
Let me know what you guys think and what other improvements you can think of.