Jump to content

Can AI planes land, refuel, rearm and take off again?


Recommended Posts

I am creating a training mission for myself and a group of friends. We each purchased a copy of the Normandy map, WWII Assets pack and the Spitfire plane. I want to have enemy fighters take off from a distant field, fly to us and return when their ammo or fuel runs low. I think I saw a flag to do that but I also want them to take back off after refueling.

 

Also is there any way to have a replacement plane spawn when a plane gets shot down other than defining multiple planes with delayed activation? Eventually all planes will be destroyed but as a training mission I want unlimited enemy planes to be dispatched one plane at a time.

 

Thanks.

Link to comment
Share on other sites

The only way is with LUA scripting, which is an advanced topic beyond normal mission making. I am not proficient, but I was able to make a respawning aircraft. This was a while ago, so I don't remember how it works.

 

Search this forum for scripting and MIST.

Awaiting: DCS F-15C

Win 10 i5-9600KF 4.6 GHz 64 GB RAM RTX2080Ti 11GB -- Win 7 64 i5-6600K 3.6 GHz 32 GB RAM GTX970 4GB -- A-10C, F-5E, Su-27, F-15C, F-14B, F-16C missions in User Files

 

Link to comment
Share on other sites

The easiest solution for a simple mission of this nature would be a switched condition that checks ALL OF COALITION OUT OF ZONE.

 

Download MiST from Github here:

https://github.com/mrSkortch/MissionScriptingTools/releases

 

Add a trigger to your mission, no conditions, DO SCRIPT FILE mist_4_3_74.lua which you'll find contained in the .RAR file you download from github.

 

Create a trigger zone around the combat area, then your respawn trigger will look like this.

 

Type:

SWITCHED CONDITION (bandits respawn, NO EVENT)

Conditions:

ALL OF COALITION OUT OF ZONE (Red, combatarea)

Triggered actions:

DO SCRIPT mist.respawnGroup (target1, true)

DO SCRIPT mist.respawnGroup (target2, true)

DO SCRIPT mist.respawnGroup (target3, true)

etc. etc.

 

Just create a simple 1 liner like that using the group name of whatever group you want to respawn for as many groups as you want. Whenever the bad guys leave the engagement area or are shot down, new ones will start up with the same parameters as the original groups.

Link to comment
Share on other sites

LUA scripting, which is an advanced topic beyond normal mission making.

 

Search this forum for scripting and MIST.

 

It's not really that hard if you can program, at least on the basic level. I'd personally start with

http://wiki.hoggit.us/view/DCS_mission_editor

http://wiki.hoggit.us/view/Simulator_Scripting_Engine_Documentation

 

and go without any libraries at first.

Link to comment
Share on other sites

Guys, there is also an alternative way ...

 

Apparently there are people who are unaware of the MOOSE framework, and who are using triggers, which is way too complicated.

 

You can do this using the MOOSE framework with one single command.

MOOSE hides the complexity of mission design, and lets you focus better on the functionality of your mission. The only predicate is that you need to learn a bit of lua ...

 

Have a look at the following mission:

 

https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/SPA%20-%20Spawning/SPA-121%20-%20Air%20Ops%20-%20Scheduled%20Spawns%20with%20Repeat%20on%20Landing%20with%20Limit

 

This mission will spawn 8 air units, of different types. Airplanes and Helicopters. After spawning, they immediately will return for landing at Batumi. The KA50 and the 101EB will respawn immediate after they land on the runway. The MI8 and the A10C will respawn after they have taxied to the parking spot and have shut down their engines.

 

This mission has the following code:

 

do

 -- Declare SPAWN objects
 Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 )
 Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 2, 10 )
 Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 2, 10 )
 Spawn_A_10C = SPAWN:New("A-10C"):InitLimit( 2, 10 )
 
 -- Choose repeat functionality
 
 -- Repeat on landing
 Spawn_KA_50:InitRepeatOnLanding()
 Spawn_C_101EB:InitRepeatOnLanding()
 
 -- Repeat on enging shutdown (when landed on the airport)
 Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
 Spawn_A_10C:InitRepeatOnEngineShutDown()
 
 -- Now SPAWN the GROUPs
 Spawn_KA_50:SpawnScheduled(180,0)
 Spawn_C_101EB:SpawnScheduled(180,0)
 Spawn_MI_8MTV2:SpawnScheduled(180,0)
 Spawn_A_10C:SpawnScheduled(180,0)
 
 -- Now run the mission and observe the behaviour.

end

The SPAWN class in the MOOSE framework takes care of all of the respawning after landing for you. Respawning can be done in a couple of ways. The easiest is to respawn right after landing, but respawning can also happen after engine shutdown when the planes parks at the parking spot and shuts down its engines.

 

Please follow carefully the following instructions if you wanna use this framework. Watch the videos and invest about an hour to set this up.

 

 

WARNING: This is a complete new way of modelling missions. You'll need to invest time and the reward will be more fun and design greater missions and do things you never thought were possible.

If you don't have this time, or don't want to do this effort, then suggest you try a few things out. If you like it, use, it.

 

You can forget triggers and all of that. There are many people now who have learned and don't want to go back to the ME stuff once they learned the framework and learned a bit of lua.

 

FC


Edited by FlightControl

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...