Suppose you want to create a new mission, but you don't want to get too complicated for your first effort. You could implement a very simple modification of one of our existing missions. For example, suppose you want to modify MISSION_NETWORKBATTLE07. You want the result to be exactly like "Peabody's Mission", but you want to limit anti-aircraft guns to an altitude of 2000 feet, so bombers or strike aircraft could more easily attack airfields.
You would begin by replacing the contents of "MissionNetworkBattle07.cpp" with the contents of "MissionNetworkBattle06.cpp" (Peabody's Mission), adjusting the mission name and menu description text as appropriate to your mission design ideas.
All of the damage inflicted by anti-aircraft fire is handled inside a single function. It is located in "mission.cpp", and it is named "CalcDamageRiskFromNearbyOpposition()". That function is rather large. The area of interest looks like this:
As you can see, that area of the function determines the amount of damage that the player will suffer when he lingers close to an airfield, an artillery bettery, a battleship, or a destroyer. You could modify that logic so it would treat your specific mission differently. For example, you might expand the first little area of that code like this:
With that change, the damage inflicted when lingering near an airfield is diminished to "0" if the player is flying higher than "65" units of altitude (about 1950 feet). and if the current mission is "MISSION_NETWORKBATTLE07".
You could expand this idea for your specific mission by inserting similar logic into the areas that calculate damage due to lingering near artillery batteries, battleships, or destroyers.
Once you have your new version of MISSION_NETWORKBATTLE07 working to your satisfaction, you'll need to email your changed source code to webmaster@AskMisterWizard.com for review and possible inclusion in a future version of LAC.
Last edit: bbosen 2023-04-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Suppose you want to create a new mission, but you don't want to get too complicated for your first effort. You could implement a very simple modification of one of our existing missions. For example, suppose you want to modify MISSION_NETWORKBATTLE07. You want the result to be exactly like "Peabody's Mission", but you want to limit anti-aircraft guns to an altitude of 2000 feet, so bombers or strike aircraft could more easily attack airfields.
You would begin by replacing the contents of "MissionNetworkBattle07.cpp" with the contents of "MissionNetworkBattle06.cpp" (Peabody's Mission), adjusting the mission name and menu description text as appropriate to your mission design ideas.
All of the damage inflicted by anti-aircraft fire is handled inside a single function. It is located in "mission.cpp", and it is named "CalcDamageRiskFromNearbyOpposition()". That function is rather large. The area of interest looks like this:
As you can see, that area of the function determines the amount of damage that the player will suffer when he lingers close to an airfield, an artillery bettery, a battleship, or a destroyer. You could modify that logic so it would treat your specific mission differently. For example, you might expand the first little area of that code like this:
With that change, the damage inflicted when lingering near an airfield is diminished to "0" if the player is flying higher than "65" units of altitude (about 1950 feet). and if the current mission is "MISSION_NETWORKBATTLE07".
You could expand this idea for your specific mission by inserting similar logic into the areas that calculate damage due to lingering near artillery batteries, battleships, or destroyers.
Once you have your new version of MISSION_NETWORKBATTLE07 working to your satisfaction, you'll need to email your changed source code to webmaster@AskMisterWizard.com for review and possible inclusion in a future version of LAC.
Last edit: bbosen 2023-04-09