Blackheart_Six 284 Posted September 25, 2023 SCENARIO FRAMEWORK (SF): MOVE TASK Difficulty: High This topic will cover the following subject(s): Creating a randomized move task system for non-AI (Players). As part of my Patrol Operations - ARLAND 1 scenario, I created a randomize move system to simulate performing a dismounted patrol using the SF taskMove.et. The SF will spawn one move task at the start of the mission. You proceed to the first check point and complete the move. At each intersection the framework will randomly select one of the directions to proceed and create a new check point task. This will continue until Mission Complete determined by you. The SF Entities used are Area.et, LayerTaskMove.et and SlotMoveTo.et. Unless otherwise noted, use default values of each scripted component of that entity. There is no enfusion scripting required. For our example, I will use a 3 way intersection, with 4 Check Points. A. INITIAL SETUP Drag and drop an Area.et at each of the road intersections you want the patrol to follow (1, 2, 3, and 4). Drag LayerTaskMove.et to the hierarchy panel, and drop it on each Area.et. This sets the coordinate of the entity to 0,0,0 and centers it in the Area.et. Drag a SlotMoveTo.et to the hierarchy panel, and drop into each LayerTaskMove.et. This sets the coordinate of the entity to 0,0,0 and centers it in the LayerTaskMove.et. Your hierarchy should look like below when finished. One for each intersection. Area1.et LayerTaskMove1.et SlotMoveto1.et Area2.et LayerTaskMove2.et SlotMoveto2.et Area3.et LayerTaskMove3.et SlotMoveto3.et Area4.et LayerTaskMove4.et SlotMoveto4.et Add 2 more slotMoveTo.et to LayerTaskMove2.et. I renamed the SlotMoveTo.et the name of the intersection you are going to. You are not allowed to have duplicate names so adjust your naming conventions accordingly. Area1.et LayerTaskMove1.et SlotMovetoA2.et Area2.et LayerTaskMove2.et SlotMoveto1.et SlotMoveto3.et SlotMoveto4.et Area3.et LayerTaskMove3.et SlotMovetoB2.et Area4.et LayerTaskMove4.et SlotMovetoC2.et In the below diagram, you enter at Area 4 (START POINT) and move to Area 2 at the 3 way intersection, the SF will randomly select one of the 3 options, SlotMoveTo1, SlotMoveTo3, or SlotMoveTo4. 1 <--------------> 2 <--------------> 3 | | 4 (START POINT) B. CREATE MOVE TASKS a. Area.et setup Highlight each Area.et one at a time. Highlight the SCR_ScenarioFrameworkArea in the Object Properties panel. In Debug, check both boxes to show debug shapes. Uncheck both boxes when you've completed your work. In Trigger and change the Area Radius to what ever size you like. I set mine to 15.00 meters to cover the entire intersection. Uncheck Once. b. LayerTaskMove.et setup Highlight each LayerTaskMove.et one at a time. Highlight the SCR_ScenarioFrameworkLayerTask in the Object Properties panel. In Children change Spawn Children to RANDOM_ONE. In Activation and change Activation Type to ON_TRIGGER_ACTIVATION. In Task enter the Task Title and Task Description. c. SlotMoveTo.et setup Highlight the SCR_ScenarioFrameworkSlotExtraction in the Object Properties panel. In Debug, check both boxes to show debug shapes. Uncheck both boxes when you've completed your work. In Plugins expand SCR_ScenarioFrameworkPluginTrigger. Set the Area Radius to 10 meters. Make sure it is smaller then the area radius set in a4. Uncheck Once. In OnTaskFinish expand Actions On Finished. Press the + button, enter in the search box Wait. Select SCR_ScenarioFrameworkActionWaitAndExecute (I use this SCR so there is a delay between task finished(old), and task created(new)). Expand Wait and Execute, set Delay In Seconds to 5 seconds. In Actions, press the + button, enter in the search box Spawn and select SCR_ScenarioFrameworkActionSpawnObject. Expand Spawn Objects. In Name Of Objects To Spawn Activation press the + button. In the 0 field enter the name of the LayerTaskMove.et of the intersection the SlotMoveTo.et will take you to. NOTE: For our scenario example above, the start point is at 4 (Area4.et) and we will move to 2 (Area2.et). We will enter LayerTaskMove2 in the 0 field for step 10. Each SlotMoveTo.et will be different depending on the scenario and the name of the components. Complete steps a, b, and c for each intersection you have placed the components. For our example we will enter the following in the 0 field of step 10. SlotMoveToA2 = LayerTaskMove2 SlotMoveTo1 = LayerTaskMove1 SlotMoveTo3 = LayerTaskMove3 SlotMoveTo4 = LayerTaskMove4 SlotMoveToB2 = LayerTaskMove2 SlotMoveToC2 = LayerTaskMove2 At this point if you have done everything correctly, when you spawn in and enter Area 4 it create a task to move to Area 2. Move to Area 2, and it will create a task to move to either Area 1, 3 or 4. Share this post Link to post Share on other sites