Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

? Withdraw carrier based on A/C [Lua?)

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> ? Withdraw carrier based on A/C [Lua?) Page: [1]
Login
Message << Older Topic   Newer Topic >>
? Withdraw carrier based on A/C [Lua?) - 7/6/2017 12:19:32 PM   
AlGrant


Posts: 807
Joined: 8/18/2015
Status: offline

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

_____________________________

GOD'S EYE DISABLED.
Post #: 1
RE: ? Withdraw carrier based on A/C [Lua?) - 7/6/2017 2:01:02 PM   
mikmykWS

 

Posts: 11531
Joined: 3/22/2005
Status: offline
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







_____________________________


(in reply to AlGrant)
Post #: 2
RE: ? Withdraw carrier based on A/C [Lua?) - 7/6/2017 2:34:15 PM   
AlGrant


Posts: 807
Joined: 8/18/2015
Status: offline
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

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!

< Message edited by AlGrant -- 7/6/2017 2:42:28 PM >


_____________________________

GOD'S EYE DISABLED.

(in reply to mikmykWS)
Post #: 3
RE: ? Withdraw carrier based on A/C [Lua?) - 7/6/2017 3:03:23 PM   
mikmykWS

 

Posts: 11531
Joined: 3/22/2005
Status: offline
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

_____________________________


(in reply to AlGrant)
Post #: 4
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> ? Withdraw carrier based on A/C [Lua?) Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.102