Thursday, April 30, 2015

Arma 3, Bombing Run System

As a part of the mission/mod that I am creating, it involves a bombing run with one or multiple planes and zones.

Bombing run script

I wanted the script to be a proper bombing run, not just a red circle (bombing zone) that appears on your map and then a heap of explosions scattered around the place *cough*... as there is little to no immersion in the game-play for any players, and rather unrealistic.

I sat down, and thought about how I wanted my version to be, and came up with a rather decent solution.

When the bombing zone is spawned in-game, whether once or six times at once, each jet plane and zone is kept separate from the next. Each jet plane spawns out-of-bounds, so that any player gradually hears and sees the jet... it gives you pre-warning.

The jet plane will do a low altitude fly-over for the pre-warn (the jet sound is loud), the players would check their map (default 'm' key) to see where the bombing zone(s) will be placed, as they would be marked in an amber marker with a random size/diameter. If any player(s) are in the zone... it would be time to run run run!

The jet plane will then loop around (avoiding all other air traffic), gain altitude and fly back over the determined bombing zone which in-turn, changes the amber marker to red, and it's bombs-away!



Uh ow... bombing zone
 
Once the jet plane has dropped all it's bombs (bomb number depends on diameter of zone), it then flies off into the distance, which removes the red marker from your map... hopefully by this stage, you are still alive! :D

Bombs be dropping
I have gone over my bombing zone script multiple times, redone the procedures, redone the variable checks, redone the cleanup of entities/objects/etc... and can now say that whether I run the script once or twenty times at the same time... everything works perfectly, each jet plane does-their-own-thing and there are absolutely NO left-overs to clutter up memory (memory leaks) or affect FPS.

From being a novice at Arma 3 scripting/coding, and learning as I proceed, I'm fairly proud of what I have achieved in a short amount of time.

The video below shows an in-game demonstration of my bombing zone system in action. In this video, I ran the script/function six times at once... as you will see multiple amber and red zones on the map.



Another part of the mod created, more to follow.

-soul.