Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

How to change a plane base by using 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 >> How to change a plane base by using Lua ? Page: [1]
Login
Message << Older Topic   Newer Topic >>
How to change a plane base by using Lua ? - 9/13/2017 1:23:53 PM   
M1A2G

 

Posts: 29
Joined: 9/13/2017
Status: offline
I know that when the airport can't land a plane,the plane itself will choose a new base.I want to use Lua to let plane choose a designated base.

This is the Action that I wrote:

ScenEdit_SetUnit({side='C',name='Dragon1',base='Wuhu AB (PLAAF)',newbase='Anqing AB'})

The event has been fired,but the plane do not change the base.Can somebody tell me what's wrong with it?
Post #: 1
RE: How to change a plane base by using Lua ? - 9/13/2017 1:47:00 PM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
I think it is:
quote:

local newbase = ScenEdit_GetUnit({side='C',name='Dragon1',base='Anqing AB'})
ScenEdit_SetUnit({side='C',name='Dragon1',base=newbase})


_____________________________

Michael

(in reply to M1A2G)
Post #: 2
RE: How to change a plane base by using Lua ? - 9/13/2017 2:19:52 PM   
M1A2G

 

Posts: 29
Joined: 9/13/2017
Status: offline
The plane still doesn't change it's base...






Attachment (1)

(in reply to michaelm75au)
Post #: 3
RE: How to change a plane base by using Lua ? - 9/13/2017 3:44:01 PM   
stilesw


Posts: 1497
Joined: 6/26/2014
From: Hansville, WA, USA
Status: offline
One other way is to create a ferry mission to the base you want the plane to call home. Then, have some event trigger the plane being assigned to the mission. After it lands the new base will be its home.

Set up one-way ferry mission to Newbase, say "RTB Newbase" with no aircraft assigned.
Dragon1 is on some other mission.
Dragon1 (or something else) triggers an event which causes Dragon1 to be reassigned:

ScenEdit_AssignUnitToMission("Dragon1", "RTB Newbase")

I've used this several times, hope it helps.

-Wayne Stiles



< Message edited by stilesw -- 9/13/2017 3:45:43 PM >

(in reply to M1A2G)
Post #: 4
RE: How to change a plane base by using Lua ? - 9/14/2017 1:00:57 PM   
M1A2G

 

Posts: 29
Joined: 9/13/2017
Status: offline
When this action actives,will the plane RTB immediately ?

If it will,this is a good way not the best way.(Some planes may fight against enemies at that time)

But anyway,thanks for your reply.

(in reply to stilesw)
Post #: 5
RE: How to change a plane base by using Lua ? - 9/14/2017 3:32:19 PM   
stilesw


Posts: 1497
Joined: 6/26/2014
From: Hansville, WA, USA
Status: offline
quote:

When this action actives,will the plane RTB immediately ?
If it will,this is a good way not the best way.(Some planes may fight against enemies at that time)


Yes, the subject aircraft will immediately be assigned to the RTB mission and head to the selected base. If you are concerned about the aircraft that is assigned to the RTB mission engaging enemies then you can set the RTB mission to "Hold" for all ROE actions when you create it. Using Lua you can also set the Rules of Engagement (ROE) for any other aircraft (or group or mission) that you may be concerned about.

-Wayne

(in reply to M1A2G)
Post #: 6
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> How to change a plane base by using 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.676