? Withdraw carrier based on A/C [Lua?) (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios



Message


AlGrant -> ? Withdraw carrier based on A/C [Lua?) (7/6/2017 12:19:32 PM)


Working on a scenario where I'd like to order a carrier group (carrier plus escorts) to withdraw if its aircraft losses go above a certain level, rather than sit there as a big juicy target.

I know that we can use the doctrine settings to order a unit to withdraw based on the level of main attack weapon (or damage etc), but can the same be done to a carrier based on the number of remaining aircraft ?

My guess is this will need Lua not my strong point!

Cheers




mikmykWS -> RE: ? Withdraw carrier based on A/C [Lua?) (7/6/2017 2:01:02 PM)

Hi Al

Example of Counter code. In this case you may want to assign the initial value based on a total number and then as losses occur subtract.

http://www.mikmyk.com/uncategorized/cmano-lua-key-values-counters-and-behaviors/

Example of withdraw code in Spratly Spat. Withdraw is just reassigning to another mission.

quote:



a=ScenEdit_GetSideIsHuman("Task Force Guardian")
if a==false then
ScenEdit_AssignUnitToMission('TG Guardian', 'TF Guardian Retreat')
end


Give it a shot.

If you get hung up let me know. Busy but will help!

Mike









AlGrant -> RE: ? Withdraw carrier based on A/C [Lua?) (7/6/2017 2:34:15 PM)

Cheers Mike,

I had assumed that it would involve some sort of counter and something like assigning to a new mission area or RTB to home base.
I'll give this a shot and see how long it takes for me to reach the point of [sm=00000018.gif]

An AI controlled carrier (along with some shore based a/c) is going to need to conduct strikes against a fairly well defended force.
If it loses enough of its aircraft I want it to pull back ........ not essential to the scenario but could be useful for other scenarios so something worth getting my head around how it works!




mikmykWS -> RE: ? Withdraw carrier based on A/C [Lua?) (7/6/2017 3:03:23 PM)

Yeah the blog posts are really about me archiving useful scripts so I remember them and only do the heavier development work once and only have to modify. The goal is to come up with a set of things that should be included in most of my scenario so I can just reference that instead and insert where needed. Hopefully, with everybody plugging away at this we'll all have stuff at hand when needed. So please let me know if you get in a real jam with this. I'll help.

My current project is scaling defenses etc. based on threats. MichaelM has just made that happen by allowing us to count units in a specific area by modifying the detect trigger via lua. Now that we have that we can just add some if's and conditions to say what happens when the threat is x, y, etc. That's really valuable.

Mike




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.609375