diff --git a/Wrapper/Group/GRP-200-Follow-Group/GRP-200-Follow-Group.lua b/Wrapper/Group/GRP-200-Follow-Group/GRP-200-Follow-Group.lua new file mode 100644 index 0000000..13cab92 --- /dev/null +++ b/Wrapper/Group/GRP-200-Follow-Group/GRP-200-Follow-Group.lua @@ -0,0 +1,36 @@ +--- +-- Author: FlightControl +-- Created: 20.10.2018 +-- Contributors: kaltokri +-- Modified: 24.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html +-- +-- # Description: +-- +-- In this two planes will be spawned. +-- The second one will follow the first one. +-- +-- # Guide: +-- +-- 1. Start the mission and watch the planes moving. + +-- Create spawn objects from groups: +local SpawnPlane1 = SPAWN:New("Plane 1") +local SpawnPlane2 = SPAWN:New("Plane 2") + +-- Spawn the groups into the world: +local GroupPlane1 = SpawnPlane1:Spawn() +local GroupPlane2 = SpawnPlane2:Spawn() + +--Create a task for Plane 2 (follow GroupPlane1 at Vec3 offset): +local PointVec3 = POINT_VEC3:New( 100, 0, -100 ) -- This is a Vec3 class. +local FollowDCSTask = GroupPlane2:TaskFollow( GroupPlane1, PointVec3:GetVec3() ) + +-- Activate Task with SetTask. +-- PushTask will push a task on the execution queue of the group. +-- SetTask will delete all tasks from the current group queue and executes this task. +-- We use SetTask this time: +GroupPlane2:SetTask( FollowDCSTask, 1 ) diff --git a/Wrapper/Group/GRP-200-Follow-Group/GRP-200-Follow-Group.miz b/Wrapper/Group/GRP-200-Follow-Group/GRP-200-Follow-Group.miz new file mode 100644 index 0000000..6831542 Binary files /dev/null and b/Wrapper/Group/GRP-200-Follow-Group/GRP-200-Follow-Group.miz differ