View Single Post
Old 07-03-13, 01:39 PM   #2193
Black Magic
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Got everything coded in What I changed was if the carrier has a contact and it's scrambling aircraft to that contact:
- the scrambled aircraft's speed is set to the aircraft's max speed
- all waypoints of the aircraft are set to the aircraft's max speed
- the aircraft is spawned at a height of 10m in a 250m radius around the carrier (thus making it look like it took off from the carrier deck) - thus multiple aircraft will spawn in different places around the carrier but all of them will spawn at the same height (10m)
- depending on how the AI routines are handling the aircraft (IRAI) the unit will either climb to the altitude specified in it's first waypoint (some random value of 40m - can be +- 15m) or go to the altitude specified by the AI routines (IRAI)

The spawned aircraft are given two waypoints:
- waypoint 1 is the contact's current position when the aircraft was spawned
- waypoint 2 is the carrier's current position when the aircraft was spawned (altitude set to 150m so you'll never see it being removed from game). Thus it tries to return home (somewhat - as realistic as I wanted it to be without excessive amount of code)

This value in \data\Cfg\Airstrikes.cfg Logic Steps Between Air Sessions=15 determines when the game checks for airstrikes. What this value means is:
- after 91.0 seconds X Logic Steps Between Air Sessions check to see if airstrikes need to happen. I changed this slightly in the fact that if ANY unit detects a contact (or it changes the contact it was following to a different one) then the game is forced to check for airstrikes immediately (for some upcoming patches and for this carrier airstrike patch - I have some very cool ideas!).

If the aircraft have loadouts specified in their .cfg file then they will be applied (bombs or torpedoes)

Here I was setting up for a shot on the carrier and it detected me at ~10.4kms out It scrambled one fighter after me:

this guy means business!! Time to dive!

Sometime later carrier launches another aircraft at me and he means business also! Crew hasn't detected this one yet...

Intense! This is freakin awesome

Currently just under 1Kb of new assembly code just for this patch!

New version of patcher uploading shortly...having fun in my test mission currently

Last edited by TheDarkWraith; 07-03-13 at 02:10 PM.
TheDarkWraith is offline   Reply With Quote