Change mission when unit lands, how do you get it to take off?

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
Whicker
Posts: 664
Joined: Tue Jun 19, 2018 9:54 pm

Change mission when unit lands, how do you get it to take off?

Post by Whicker »

If I have a mission to ferry a unit to a 2nd base, and then an event that checks for unit remains in area set to that base, and then an action that changes that units mission and sets it to ready, shouldn't the AC take off?

I can only get this to work if the plane is in the air, and I set the 2nd base as its home, and then tell it to RTB. It will land, and the mission will change, it is set to ready and then it takes off. Perfect.

But if the plane is on the ground at base 1, and I assign it to a ferry mission to base 2, the event triggers and the mission changes when it lands, it gets set to ready but it just sits there and won't take off.

This is the same as this thread, with maybe a simpler example.
tm.asp?m=4513210

in the attached scen there is a plane taking off on a ferry mission to the away base. It will land and have its mission changed and get set to ready but won't take off.

Launch another AC from the home base (might need to manually launch the one already at the away base for the event to work properly but that is another question) and change its home base to the away base, and tell it to RTB. It should land and then take off again 15 minutes later or so.

Why don't they work the same? seems like something about the home base setting.


Attachments
testferrymissions.zip
(11.08 KiB) Downloaded 4 times
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Change mission when unit lands, how do you get it to take off?

Post by michaelm75au »

I tried this with the latest beta build and it works okay. Looking back over the changes, there is a fix in regard to Lua driven mission changes not always waking up the mission.
Have you tried to create the new mission as 'inactive'. Then change the plane to new mission, and then activate it???
Michael
hasler
Posts: 39
Joined: Mon Jul 31, 2017 8:28 pm

RE: Change mission when unit lands, how do you get it to take off?

Post by hasler »

I have figured it out. So there appears to be a bug if the mission is a one way ferry. The Mission change will not wake up. I reset my mission to be a cycle and the follow on worked. A thing of note though the Aircraft keeps its original base as the point of origin after it takes off again. So I will mess with it again when get some more time, RL is hitting me hard this weekend. Am I correct in believing I can set a new base with the ScenEdit_SetUnit command?
Post Reply

Return to “Lua Legion”