Browsed by
Category: CMANO

MikMyk’s CMANO Various Ships Imports

MikMyk’s CMANO Various Ships Imports

One of my passion projects in helping develop CMANO was building import files (I built 80% + of what was shipped with the game). I enjoyed doing the research and digging through various sources to find pictures, information etc. to build accurate facilities and ship formations. I’ve continued this work project to this day and will continue to post here and update as I’ve got time. Grab and use!

Download them here.

Book Review: Northern Fury H-Hour

Book Review: Northern Fury H-Hour

I was recently asked by Bart Gauvin and Joel Radunzel to review their first book, Northern Fury: H Hour. This was exciting because I am a huge fan of Bart’s scenario work since playing my first during the Harpoon era and culminating into what I think is his GOAT level work with his Northern Fury CMANO scenario set.  This work helped grow the popularity of the games and created wonderful stories for players to fall into after a hard day in the mine. Now partnering with a talented writer like Joel to create a series of novels based on that work makes perfect sense as more people will get to experience a really great story. I am definitely a fan and hope my bias shows in this case.

Northern Fury: H Hour is the first in a series of novels covering a Third World War between the Soviet Union and NATO in the 1990s. This novel describes the historical and hypothetical events that lead into and past war start through the eyes of many participants from the leader of the Soviet Union down to the fighter pilots, mechanized infantry officers fighting in Norway and Coast Guard commanders and crews off the US East Coast.  The other theaters of war are mentioned at a high level but are left for follow-on novels in the series to cover in detail. There are a number of really great maps and diagrams included to help tell the tale and readers who may not know too much about Norwegian geography.  The book is written for adults who like modern military fiction and is appears professionally edited.

I like many things about this book. The plot and writing style really sucked me in. I love books that I know after reading a chapter that I’m going to enjoy the entire ride. The writing flows comfortably and the plot makes sense. I even liked the preface which sets the reader up to understand the writers’ perspectives. The characters are well crafted, warts and all. Pavel Medvedev loves his country and his kids and he worries about them. It drives hard decisions that lead to world war.  You get it though, it’s relatable, Pavel’s trying to do his best as he sees it. David Strong is at the tip of the spear and wants all to know it. Who wasn’t that ambitious but insecure young person at some point? You have a much to prove and the tools to do it. Abby Savage, skilled helicopter pilot and lioness, you feel her frustration at not being able to fly combat missions.  Get her into the fight! The character work is great as you know these people, they could be you.  Finally, Joel and Bart’s military expertise is in the novel. The complex mechanics of warfighting are explained well and fed into action sequences that make enjoyable sense to any war nerd.  Norwegian and US Coast Guard, National Guard and Police defenders suffer horribly to the realities and challenges of modern war. Sometimes you can’t see the enemy, talk to your friends or have favorable odds. Sometimes your perfect plans fail and you lose. It is gritty, real and works.

I have a couple of gripes with the book. First, is I’d like to see a little more detail on what is going on in NATO and US leadership. You do get some bits and pieces on Norwegian thinking but the big picture stuff is murky. I want to see what the NATO leadership thinks and what they’ll be doing. My guess is I will get this next novel but it’s something I’m thinking about. My second gripe is probably me being a square but I’m not a fan of authors giving accents or sprinkling foreign words in.  The word Tovarishch is used a lot and I’m not sure it is in colloquial Russian. There are also several instances where Brooklyn or Boston accents are used but are not consistent. It gets a little weird if you’re from any of these places but it is also a personal preference that may not be an issue to anybody else.

I am suggesting this book to anybody that loves military fiction. It surpasses most fiction in the genre because it is well written, has deep characters and the military action is smart.  I view it as the spiritual successor of all those great novels of the eighties and nineties but with the far better insight into what was going on and superior writers. I look forward to the next chapters and its definitely on the short list of books I’ll be going back to again and again.

Lua and air defense logistics in CMANO

Lua and air defense logistics in CMANO

Holy moley it’s been months since I’ve done a blog post. Anyways had a great discussion on modeling air defense in CMANO on Kushan’s Discord and wanted to add it here so I remember the lua code in the future. Hope it helps you too.

The conversation started with structure and how you could play with sides to model an integrated air defense. Bottom line is you can have a side that is friendly to two other sides who are not friendly with each other. This makes that central side (node) important as it is the link between the tow. Destroy it and you break the link. So it is possible to model a network hierarchy of sorts with central control centers and substation.  It is pretty straightforward but I think there is a hard stop at 2 or 3 layers. If you look at Operation Lighting Strikes scenario in the included scenarios you can find this setup with the Pakistani air defense sides.

The conversation then veered to the logistics part of it and how to reload SAMs. Most SAM units have attached magazines so they’ll first shoot what’s on their mounts and then pull from their magazines. Problem is you tend to shoot through these relatively quickly and most nations store a significant number in a nearby site. The good news is that CMANO allows you to group an ammo unit to an existing unit and it will reload from it. So it is possible to add hardened bunkers, ammo trucks, ammo revetments filled with reloads to a group of air defense units and they’ll draw reloads from them. CMANO Lua does have a way for you to refill mags and mounts by code as well but I like to group the units together because it gives the player another opportunity to impact the system by hitting the central ammo dump.

Now we come to a couple of twists to this.

Let say you want model ammo trucks or helicopters delivering ordinance.  You can’t start out grouped because the ammo is loaded instantly regardless of range. So this is how you would do it.

Event: Reload unit once ammo carrier comes in range.

Trigger: Unit Enters area or maybe even unit remains in area.

Action: Lua Code (Example)

ScenEdit_SetUnit({Side=’Nicaragua’,unitname=’Chinandega Ammo’,group=’Chinandega Army Base’})
ScenEdit_SetUnit({Side=’Nicaragua’,unitname=’Huete Munitions Bunker’,group=’Huete SAM Site’})

So in this CMANO event once the ammo carrying unit enters the area trigger it fires the lua code which is a set unit using the side, unitname and group name.

Now let’s look at this a little differently.

Let’s say you want to model a slight reaction delay to surprise attack or an encounter where the defender is not at a wartime posture or might be disorganized or something like that.

Here is how I model it:

  1. Empty the mounts of mags of all units that will incur a delay. This is probably true of most MANPADS, gun positions or AAA in vehicle parks but may include exposed SAM sites.
  2.  Add ammo carrying unit. Don’t group with units (yet).
  3. Create an event which has a damage or destroy trigger to catch the first bomb hitting. Then use then use the Lua code above.

So the intent is to model the crews getting the message of an attack and then manning their systems. It is not 100 perfect but it works for me.

Hope this helps!

 

 

Scaling Forces To A Threat In CMANO Using Lua

Scaling Forces To A Threat In CMANO Using Lua

First a warning. This is using Lua code available with CMANO version 1.13 or greater. If you’re using something older all it does it make you wish you updated.

One of the bigger things I wanted to accomplish with CMANO and Lua was to devise a way to scale missions and/or mission assignments to the threat. The basic problem was that players could choose to overwhelm a patrol with greater numbers so needed a way for the static AI to evaluate a threat within an area and pick a better response to it based on some conditional logic. The responses could be adding units to the mission, adding new missions or deleting them all together. Thankfully the Lua team at CMANO came through and I’ve now got a way to do this.

My method is a two-event process. The first event which I call Air Defense Counter consists of an In Area Trigger and a Lua action with some code that runs a counter and runs some conditional logic that modifies missions based on the value of the counter. This is great but the detect trigger evaluates for everything regardless of where it is so we need to dictate an area which I do by creating a second event called Activate Air Defense Area which lets me modify an existing detect area trigger using a setter (Scenedit_SetTrigger) and some reference points as parameters. I then add some conditional logic statements to the counter code based on the current value.

Air Defense Counter Event:

Trigger: Type: Unit is detected Name: Red Unit Detected, Parameters: Aircraft, Detected By Myside, Minimum Classification Level: Unknown

Lua Action: Counter code and some conditional logic. Note the numeric value for b is a string (thus the ‘and’ around the numbers) because the CMANO Key Value Function only takes strings not numbers.

lastCount = ScenEdit_GetKeyValue(“AirdefCounter”);
lastCountN = tonumber(lastCount);
if lastCountN == nil then
lastCountN = 0;
end
lastCountN = lastCountN +1;
ScenEdit_SetKeyValue(“AirdefCounter”, tostring(lastCountN));
b=ScenEdit_GetKeyValue(“AirdefCounter”);
if b==’5′ then
ScenEdit_SetMission(‘Denmark’,’CAP 1′,{OnStation=8})
elseif b==’9′ then
ScenEdit_SetMission(‘Denmark’,’CAP 1′,{OnStation=12})
elseif b==’11’ then
ScenEdit_SetMission(‘Denmark’,’CAP 1′,{OnStation=16})
else
end

Activate Air Defense Area Event:

Trigger: Type: Scenario is Loaded. This fires everytime the scenario is loaded even if from a save.

Lua Action:

local a = ScenEdit_SetTrigger({name=’Red Unit Detected’,mode=update,area={‘rp-1154′,’rp-1155′,’rp-1156′,’rp-1157’}})
print(a)

So in summary here is what happens. Scenario loads and the Activate Air Defense Area fires which modifies the detect trigger to use four reference points (1154-1157) instead of evaluating for everything in sensor range. When an aircraft enters that zone the counter increases and if the value of the counter is 5 the Try to Keep value of the CAP 1 mission is increased to 8, if the value 9 the Try to Keep value of CAP 1 mission is set to 12 and so on and so forth. As you can see we’re scaling our air patrol to a threat.

I hope this helps. This is actually a huge add to being able to use lua to modify Command’s AI. Please let me know if you find any errors or smoother methods.  Hope to see some of it in your future scenarios.

CMANO Fooling with Fuel

CMANO Fooling with Fuel

I want to post a few examples scripts for players who want to do some scripts based on fuel but also retain these so I remember them.

First let us do a getunit in lua and see what fuel data looks like. in this case we’ll look at an AIP submarine since it has multiple fuel types.

Code:

u =ScenEdit_GetUnit({side=’Blue’,name=’Son Won Il’})
print (u.fuel)

Results:

{ [4002] = { current = 12750, name = ‘AirIndepedent’, max = 12750 }, [4001] = { current = 6000, name = ‘Battery’, max = 6000 }, [3001] = { current = 90000, name = ‘DieselFuel’, max = 90000 } }

The results are written to a table {}. The [4002] are just numeric values that correspond to a fuel type which is then followed by values for current fuel, name and max fuel.

Good to know but perhaps a setter would be more useful!

In this next example, we’re designing a scenario where ships and aircraft are already at sea or in the air and we want their fuel states to reflect this with some randomness and definitely not be at full fuel at the start. We’ll add a couple print statements to show what we’ve done.

Code:

if ScenEdit_GetUnit({side=”Vietnam”, name=”HQ 182 Hanoi”}) ~= nil then
u=ScenEdit_SetUnit({side=”Vietnam”, name=”HQ 182 Hanoi”})
m=(u.fuel[4001].max)
c=(u.fuel[4001].current)
u=ScenEdit_SetUnit({side=”Vietnam”, name=”HQ 182 Hanoi”,fuel={{4001,(math.random(m*0.6))}}})
print(m)
print(c)
end

Results:

8000
3685

The first thing done is a defensive check to make sure the unit exists (not nil). If it does then the fuel is set to a random number using the random function who’s parameter is max value multiplied by .6. We then call a print to show the max diesel fuel (m) and then print the current fuel amount (3685). You can continuously run this script over and over in the console to change the fuel to random values.

Now let’s look at this from a slightly different angle. Let’s say you want an aircraft to RTB at a certain fuel value.

You can create an event with a regular time trigger and lua code action in the event editor.

Workflow:

  1. Create a regular time trigger. Regular time just means that the event will fire at the time interval specified. In this case, I’ll create one for a second.
  2. Create a lua action.

Code

u =ScenEdit_GetUnit({side=”Blue”,unitname=”Peg #1″})
f= (u.fuel[2001].current)
if f <= 80000 then ScenEdit_SetUnit({side=”Blue”,unitname=”Peg #1″,RTB=”true”})
end

This code just checks to see if current fuel is less than 80000 liters and then if so updates the unit to RTB.

3. Create a repeatable event with this action and trigger with event shown in log turned off.

Results:

Event fires every second checking to see if the current fuel value is equal or less than 80000. If it is it sets the aircraft to RTB. You could also set a defensive line to check for nil and RTB if you want the script to stop at a certain point.

Pretty Cool huh? Hope it helps!

CMANO AI and Cruise Missile Defense

CMANO AI and Cruise Missile Defense

 

One of the bigger issues in designing realistic and challenging scenarios is that if certain national order of battles are used they may have enough cruise missiles to win the war in one salvo. The prime example is any US Carrier Strike Group in the last 30 or so years that if you assume 4 surface combatants with VLS and at least 2 Tomahawk capable submarines with a default DB3000 database load should have 200 Tomahawk cruise missiles. This is realistic and any nation with such a capability should use it to win quickly. However, the combat model is poor when the same respect isn’t paid to the defender and a planned defense against this threat and the limitations of cruise missile technology aren’t accounted for. I hope to discuss some suggestion in this article to help address this and ultimately help produce a more accurate combat model and fun game.

Shoot the Archer

The most effective strategy to defeat cruise missile attacks is to kill the shooters before they can shoot. This strategy goes back to ancient battlefields when ranged weapons first appeared but once detected the best strategy is to Braveheart it and send the entire horde over the hill to hammer and kill the archers before the can attrit your combat power. Hanging back and taking it very rarely if ever makes sense. Giving the opposing force the benefit of using their entire offensive power does. Do it.

To successfully attack you must be able to see a target and you must have combat power in place to react to it. This means getting sensors out where the shooters may be as well as positioning your attack power in places that it can be concentrated on the shooters. This means getting as many ships, subs, and aircraft up in the air and out to sea as possible either looking for targets or being positioned to shoot. You will take losses especially to your scouts but this their job and if successful it will be worth their loss many times over. It is better to lose platforms doing something than sitting on the ground waiting.

Shoot the Arrow

Shooting the arrow became a viable defensive strategy due to advances in the modern surface to air missile. CMANO models the growth in capabilities of these missiles (guidance, rates of fire, maneuverability, speed and altitude limitations) as well as the missiles and bombs they target so it just makes sense to do some quick analysis work to understand the threat and how your systems can defend against them. You do this by experimenting with the game to determine how many weapons are likely to be fired at your facilities, how successful your SAM or gun systems might be against them from detection to kill and how geographic placement impacts line of site. While this kind of homework seems obvious you would be shocked at how many scenarios have defenses that would never work against what is being fired against them. It is worth the time and leads to a better game.

Here’s an example of the kind of input and thought that I do when defending against a known Tomahawk E Strike in CMANO. You could definitely do a more detailed analysis but just addressing the basics should accomplish the goal. If you have some things you do please do let me know. I’m always looking for good approaches.

Tomahawk Capabilities

My thoughts on the Tomahawk missile’s capabilities based on what I know from gameplay and looking at it in the DB viewer is as follows:

  • The Tomahawk is relatively slow but a low flyer that can use waypoints and terrain to mask itself effectively making it relatively stealthy. It is currently fired against known fixed targets.
  • In general, it takes 2 Tomahawks to kill a building or disable a tarmac, 4 to disable a runway access point and 10-12 to kill a hardened aircraft shelter or ammo bunker. I need to keep in mind that despite target toughness any stored aircraft or munitions have a chance of getting destroyed on any penetrating hit.
  • Any launch platform will likely carry 12+ and carrier battlegroups should have 200 or so which means large salvos. it is also fair to say the Salvo’s will not come in alone but could be supported by a concerted SEAD effort.
My Defensive Capabilities
  • MANPADS, SA-2, SA-4, SA-6, SA-5, Roland, Rapier, SA-9, SA-13 have little or no chance due to altitude, speed or guidance restrictions. Ranged SAMS are not as worthless as they do have radar systems that can detect tomahawks at greater ranges than more effective but shorter ranged SAM Systems.
  • SA-3 systems can be fired but their percentage to hit a Tomahawk is 5-10% and limited firing channels.
  • HQ-61, I-Hawk, HQ-64, Crotale, SA-11 can engage but have 30-50% chance of hitting and limited firing channels (salvo sizes).
  • SA-8B, Pantsir, SA-15, SA-19 all excellent short range systems with a 45-65% chance of hitting along with more firing channels and secondary gun systems. Many of these systems are also very good against other fast guided munitions such as HARMS and may be more valuable defending other systems by setting their Weapon Release Authorization (WRA settings to do so). They generally have great radars with low range as well.
  • Patriot, SA-10, SA-17, SA-20, Aster 30, Aspide 2000, HQ-9A all excellent systems with good range and many firing channels. They generally have good long-range radars that can detect Tomahawks and other missile systems at long range as well.
  • Command accounts for missile energy so it is not in my best interest to take the longest range shot or shoot at awkward angles. I can adjust a position and WRA ranges to what makes sense. Tomahawks are slower so it may be best to get higher percentage shots than more of them (or not!). I will account for range and kill percentage in making this decision.
  • I may have aircraft that might have good capabilities seeing or killing missiles. I need to weight out orienting them toward cruise missile defense or carrying out other crucial roles. I need to position them in areas that make sense.
Line of Site Topography

I turn on the relief layer for visual queues for elevation changes and mouse over terrain for exact elevations. The higher your radar systems the better and always be wary of higher elevations blocking line of site. This includes evaluating the altitude of your aircraft patrols as well if you’re using them for low-level sweeps.

Conclusion?

Any conclusion is subjective but I’ve done the homework to place or move units to where I think they ought to be given shooter capabilities, target capabilities and line of site topography. We’ll see. If I’m wrong I learned something for the next game.

Dispersion

Parking Dispersion

Parking dispersion may be the best defense and probably should be practiced in any wartime scenario. If you look at any air base constructed since World War 1 you’ll notice vast amounts of parking spaces and if you look any Soviet Cold War era base you’ll likely see hundreds of dug out revetments in addition to hardened structures and open tarmacs. Aircraft are typically dispersed, moved and shuffled on a regular basis to prevent targeting and the stale intelligence quickly. The practice was even used in Syria recently as the Syrian’s moved many aircraft to new spots and shelters when they learned of an incoming strike.

CMANO allows you to disperse and move aircraft for the same reasons. Aircraft can be added to any individual structures (revetments, tarmacs, shelters, hangars, open parking) within a constructed airbase and the event editor with a lua script action provides a way to periodically move them given a reason (trigger). This will increase aircraft survival and force your enemy to do more reconnaissance to make their million dollar salvos worth it.

Example: I’d like to disperse aircraft to a different bunker periodically.

Workflow

  1. Create a time trigger (regular, time or random time).
  2. Create a lua action that includes the code below.
  3. Create Event and trigger and actions.
  4. Repeat if you’d like to move them to move more than once or back and forth.

Lua Script Example:

a=ScenEdit_GetUnit({side=”Great Isle”, name=”Fulcrum #1″})
b=ScenEdit_GetUnit({side=”Great Isle”, name=”Gander Hardened Aircraft Shelter 13″})
if a ~= nil and b ~= nil and a.airbornetime == “0” then
ScenEdit_HostUnitToParent({HostedUnitNameOrID=”Fulcrum #1″,SelectedHostNameOrID=”Gander Hardened Aircraft Shelter 13″})
end

This code grabs an aircraft and a shelter and assigns them to variables. A defensive if statement is then run to see that both exist and that there is no airborne time to make sure are not airborne. If it passes the HostUnitToParent function then performs the move.

Base Dispersion

US Cold War plans had American bombers and fighter planes going to dispersed airfields in the event of nuclear and conventional war. Given the vast numbers of modern airfields, airports in this country it made sense and would have made the total destruction of forces very difficult. This can also be readily practiced in any Command scenario. You may even consider just getting units up in the air and away from a ground attack as a method of dispersion.

I hope you’ve found this article helpful and it leads to a better game. If you some great suggestions of your own feel free to post or send them along and I’ll update this entry.

CMANO Lua Key Values, Counters and Behaviors

CMANO Lua Key Values, Counters and Behaviors

Command’s Lua implementation provides a powerful tool for players and designers to capture data and use it to do many things using programming logic. Users create custom variables called keys that can be used to store strings of information. The most common example is storing numeric values for counts or a variable name to call again and again throughout their code. Keys can then be used in conditional or relational logic to call on functions to change the behavior of a unit or group.

Example: After 3 P-3 Orion’s  are destroyed I’d like to roll back their patrol mission out of harm’s way by moving the reference points assigned to the mission.

Workflow

  1. Create scenario. Add sides, units, patrol mission with reference points for target side.
  2. Next create a trigger by going to editor drop down menu, selecting Event Editor and then trigger. Specify the side, target type, subtype and target class. Do not specify a specific unit.
  3. Next create an action by going back to the Event Editor drop down and selecting Actions.
  4. When the Event Actions dialog appears select Lua script from the menu at the bottom and press the create action button to open the editor.
  5. Add Lua Counter code:
  6. Build Event

Example Lua Code (Special Thanks for MichaelM for the start on this):

lastCount = ScenEdit_GetKeyValue(“Counter”);
lastCountN = tonumber(lastCount); — convert to number
if lastCountN == nil then
lastCountN = 0; — first time
end
lastCountN = lastCountN +1; — increment
if lastCountN >= 3 then
ScenEdit_SetReferencePoint({side=”Blue”, name=”1″,Lat = “-3.26133743974693”, Lon = “108.809990664818”})
ScenEdit_SetReferencePoint({side=”Blue”, name=”2″,Lat = “-3.51017256235771”, Lon = “109.750259905245”})
ScenEdit_SetReferencePoint({side=”Blue”, name=”3″, Lat = “-4.50056738642672”, Lon = “110.026941321177”})
ScenEdit_SetReferencePoint({side=”Blue”, name=”4″, Lat = “-4.70395785856429”, Lon = “109.031147829498”})
end
ScenEdit_SetKeyValue(“Counter”, tostring(lastCountN )); — save the counter

In this code a key value called Counter is created, assigned to a variable called lastCountN and then converted to a number using the “tonumber” function because keys are strings(text) types. The code then evaluates if a value exists by checking for nil and if so gives it a 0 value (zero is not nil) so that it can be used in a calculation.  The code then adds one to reflect the counter going up. We then check to see if the value is greater to or equal to three and if so move reference points using the SetReference points function. This function lets you move reference points by changing the latitude and longitude values (its a setter). The mission area is then moved to where I think it’s safe based on the latitude and longitude values I’ve specified.

Other useful things you can do in the game with counters.

  • Tracking specific unit types for scoring or a victory condition. Ex. Kill 10 Osa’s triggers a Scenedit Set Score function plus value.
  • Tracking civilian losses to impact victory conditions. Ex. Killing 10 houses triggers a Set Score function minus value.
  • Tracking target fuel storage facility losses to impact air and sea operations as well as land unit movements.
  • Tracking target destruction or losses to impact victory conditions (politics, public opinion etc.).
  • Tracking target destruction to impact morale. Loss of too much would change the quality of the units in CMANO which are configurable.
  • Costing. If you want to track the costs of units, fuel etc. and do not have the pro product this could be used.

I’m sure others will provide some other ideas but I hope this helps!

 

 

 

 

 

 

 

 

 

 

 

 

Air Base Fuel Logistics in Command: Modern Air and Naval Operations

Air Base Fuel Logistics in Command: Modern Air and Naval Operations

There has been occasional discussion on adding air base fuel logistics in Command. The valid concern from players is that fuel is a limited resource that should be a going concern for players. CMANO currently includes storage units such as tanks, bladders, bunkers and trucks but they are not actually required to refuel aircraft and likewise the aviation fuel carried on ships isn’t actually used (as of May 2017).

The reason why this was never added was that casual players would be annoyed at the added complexity of an already cerebral game and in most cases air bases are in places where aviation fuel can be shipped in quickly by truck. CMANO already includes a fairly detailed weapons logistics model where players have to account for the number of bombs, missiles and pods they have. The aircraft readiness model captures how many times they can be used in a period of time and the many reasons why in a couple of simpler variables. Casual players have been very vocal about how complicated all of this currently is and would be further pressured by adding fuel to the mix. It makes total sense why this hasn’t been added and probably won’t until a smart but painless way is implemented.

This being said if you are a modeling savage there are absolutely ways you can do this yourself using the event editor and lua and that’s what I’d like to cover.

I have two suggested methods to accomplish this:

Event Editor without Lua:

Create an event that includes a destroyed or damaged unit trigger (fuel storage unit) and change of the mission status (inactive) on one or more missions.

The upside of this method is no lua scripting is required but the downside is the OR conditions on Event triggers makes it impossible to create one event to cover complete destruction of fuel units.

Workflow

  • Create scenario sides, add units (including an air base that includes fuel storage facilities and aircraft) and missions.
  • Go to target air base side and create mission deactivations for each mission at air base.
  • Go to triggers and create discrete destroyed/damaged triggers that specify the fuel holding facilities for the target side.
  • Create events that include a mix of each. Keep in mind that triggers are currently evaluated as OR statement and actions as ANDS. So any one trigger will trigger all actions in the event list. Set up separate event s if you’d like to create more distinct relationship between the destroyed units and the missions rather than all or nothing.

Event Editor with Lua

Create an event that includes a destroyed or damaged trigger (fuel storage unit) and a lua code action that checks to see if the fuel storing facilities you specify exist every time a fuel storing unit is damaged or destroyed and then deactivating missions based on that.

The upside is you can write minimal code to create one event that covers the complete destruction of fuel units as well as more discrete impacts on specific mission. People will now think you’re good looking and smart.

Workflow

  • Create scenario sides, add units and missions.
  • Create destroyed or damaged triggers for each fuel storing unit.
  • Write Lua Action.
  • Build Event.

Lua Code Example:

a=ScenEdit_GetUnit({side=’Target’,name=’Air Base Tank 1′})

b=ScenEdit_GetUnit({side=’Target’,name=’Air Base Tank 2′})

if a == nil and b == nil then

ScenEdit_SetMission(“Target”,”Strike 1″,{isactive=”false”})

ScenEdit_SetMission(“Target”,”Strike 2″,{isactive=”false”})

end

In this case the first two lines just get the units you’d like to check. The if statement checks to see if they exist (nil means no). The ScenEdit_SetMission statements below just change the missions status (isactive) to false.
If  the side is human you may want to try a slightly different method. Reason is a human player can just reassign to a new mission and start launching aircraft again but if we set the loadout to Maintenance they cannot. A little defense programming could make that a little harder.

a=ScenEdit_GetUnit({side=’Target’,name=’Air Base Tank 1′})

b=ScenEdit_GetUnit({side=’Target’,name=’Air Base Tank 2′})

c=ScenEdit_GetSideIsHuman(“Target”)

if c==false then

if a == nil and b == nil then

ScenEdit_SetMission(“Target”,”Strike 1″,{isactive=”false”})

ScenEdit_SetMission(“Target”,”Strike 2″,{isactive=”false”})

end

if c==true then

ScenEdit_SetLoadout({UnitNameOrID=”Mustang #1″, LoadoutID=4, TimeToReady_Minutes=0, IgnoreMagazines=”True”})

ScenEdit_SetLoadout({UnitNameOrID=”Mustang #2″, LoadoutID=4, TimeToReady_Minutes=0, IgnoreMagazines=”True”})

 

end

end

The c variable in this case checks to see if the player is human or AI. If it is AI it does the mission deactivation and if human it sets the units to a maintenance load out.

Hope this helped!

Mike

** Special thanks to Kushan for pointing out the SetLoadout Code which is available as a setter now!

Forum Discussion on this here.