diff --git a/SPA - Spawning/SPA-400 - OnSpawnGroup/SPA-400 - OnSpawnGroup.lua b/SPA - Spawning/SPA-400 - OnSpawnGroup/SPA-400 - OnSpawnGroup.lua new file mode 100644 index 0000000000..7de37e0fd3 --- /dev/null +++ b/SPA - Spawning/SPA-400 - OnSpawnGroup/SPA-400 - OnSpawnGroup.lua @@ -0,0 +1,28 @@ +------------------------------------------------------------------------- +-- SPA-400 - OnSpawnGroup +------------------------------------------------------------------------- +-- Documentation +-- +-- SPAWN: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Core.Spawn.html##(SPAWN).OnSpawnGroup +-- +------------------------------------------------------------------------- +-- Join the game master slot. The 2nd A-10 will start following the +-- 1st A-10 around. +------------------------------------------------------------------------- +-- Date: Feb 2023 +------------------------------------------------------------------------- + +local group1 = SPAWN:New("Aerial-1") + :OnSpawnGroup( + function(grp) -- this anonymous function will be called with the already spawned GROUP object for group one + local group2 = SPAWN:New("Aerial-2") + :OnSpawnGroup( + function(grp2) -- this anonymous function will be called with the already spawned GROUP object for group two + local task = grp2:TaskFollow(grp,{x=100,y=0,z=100}) -- create a DCS task structure + grp2:SetTask(task,1) -- set this as only task for group two + end + ) + :Spawn() -- Spawn group two + end + ) + :Spawn() -- Spawn group one \ No newline at end of file diff --git a/SPA - Spawning/SPA-400 - OnSpawnGroup/SPA-400 - OnSpawnGroup.miz b/SPA - Spawning/SPA-400 - OnSpawnGroup/SPA-400 - OnSpawnGroup.miz new file mode 100644 index 0000000000..53d94e4963 Binary files /dev/null and b/SPA - Spawning/SPA-400 - OnSpawnGroup/SPA-400 - OnSpawnGroup.miz differ diff --git a/SPA - Spawning/SPA-400 - OnSpawnGroup/pack.ps1 b/SPA - Spawning/SPA-400 - OnSpawnGroup/pack.ps1 new file mode 100644 index 0000000000..bbac66e7c1 --- /dev/null +++ b/SPA - Spawning/SPA-400 - OnSpawnGroup/pack.ps1 @@ -0,0 +1,10 @@ +$dir = split-path -parent $MyInvocation.MyCommand.Definition +cd $dir +$file = Split-Path $dir -leaf + +$dir +$file + +cd "_unpacked" +. 7z a -r -y -tzip "..\$file.miz" * +cd .. diff --git a/SPA - Spawning/SPA-400 - OnSpawnGroup/unpack.ps1 b/SPA - Spawning/SPA-400 - OnSpawnGroup/unpack.ps1 new file mode 100644 index 0000000000..c208a31858 --- /dev/null +++ b/SPA - Spawning/SPA-400 - OnSpawnGroup/unpack.ps1 @@ -0,0 +1,7 @@ +$dir = split-path -parent $MyInvocation.MyCommand.Definition +cd $dir +$file = Split-Path $dir -leaf +Remove-Item .\_unpacked -Force -Recurse +md "_unpacked" +cd "_unpacked" +. 7z x -r -y "..\$file.miz" *