ArmA 3 Alpha: Scripting tasks for single player missions that must be completed in order


March 9th, 2013

Overview

In this scenario, the player spawns with Task 1 as their current task and it is displayed on their HUD. A secondary task, called Task 2, is not displayed on the player’s HUD or when viewing all tasks.

To complete Task 1, the player must move to Task 1’s location. Once the player has reached Task 1’s location, a success message displays and indicates the player should now complete Task 2. Task 1 is hidden from the HUD and marked completed. Task 2 is then displayed on the HUD and when viewing all tasks.

ArmA 3 Alpha: Scripting tasks that must be completed in order

Code structure

In this example, I am calling the FNC_task_1_completed function when a trigger activates. This could be changed and called, for example, when an OPFOR unit dies.

If you have a lot of code that executes when Task 1 completes, you could create a new file calledtask1Completed.sqf and use execVM “task1Completed.sqf” on the trigger instead of call FNC_task_1_completed.

The structure depends on how complicated your mission is and how you want code to be organized. With something this simple, keeping it in a single file works.

In the Editor

  1. Create a single BLUFOR spawn.
  2. Create 2 markers named Task_Marker_1 and Task_Marker_2.
  3. Create a trigger named Task_1_Trigger_Completed near Task_Marker_1 that activates when BLUFOR is present. Activation field contains: “call FNC_task_1_completed”;

Mission Files

Download mission files: Arma 3 – Ordered Tasks.zip

Create or extract the files to your mission folder.
Read more on where to find mission files in the biki.

init.sqf

briefing.sqf

Share this post