2) Arma Reforger Mission Making ‐ Scenario Framework (Basic) | Creating the Mission - Herbiie/Arma-Reforger---ScenarioFrameworkTutorialBasic GitHub Wiki
Picking a location
Use the WASD keys to move the camera around and find a suitable place for your mission. I'm going to have players start at the nearby Industrial unit and clear the small hamlet by Periwinkle Pond:
Create a Start Position
Now we're going to decide where our players will spawn in. As we will be extracting here, we need to make it fairly obvious, so I am going to placed once of the pre-made compositions for conflict there - using these premade ones is easy, although they retain actions for conflict that will just do nothing (so you may have an option to request vehicle, for example, but nothing will happen if you use it).
Create new Layer
First we need to keep things tidy so will be creating a new layer in the hierarchy by right clicking our world and select 'CreateLayer':
I'm just going to call this layer 'start':
We now need to make this layer our 'active' layer whilst we working in it, so right click the new layer and select 'Set as Active':
Make the Start Location
You still have the terrain 'slots' on the camera like in game master, so I'm going to use the small one by the industrial unit to create my start point.
At the bottom of the screen you have the 'Resource Browser' - this is where we find any prefabricated resoruces (or prefabs) to drag into the game:
In this case I'm going to go to ArmaReforger>Prefabs>Compositions>Slotted>SlotFlatSmall and select Antenna_S_US_01.et:
Which I will drag onto the map on my small flat slot:
This has now created a little tent with an antennae, for our start location (so players can find it more easily when they'r extracting to it):
We also need to add a spawn point, so our players can spawn in. Again in the Resource Browser go to ArmaReforger>Prefabs>MP>Spawning and find SpawnPoint_US.et:
Drag this onto the map where you'd like your spawn point to be, in my case in the entrance to the tent:
Now if you were to click the preview icon (the green play button at the top) you'd be able to spawn in at our little base!
The Scenario Framework
Now we're ready to make our first objective - but first I'll talk through the basic concept of the scenario framework.
There is a basic hierarchy of three components in the scenario framework - areas, layers, and slots.
Areas
The best way I can describe areas is having them be a particular objective - in my example, the small hamlet. They're quite broad and can be activated/deactivated dynamically, so you could have a world filled with different areas each with tasks to be completed in them.
Layers
Layers sit underneath Areas, and are best thought of as the tasks within an objective. So, in my example the area will be the small hamlet, and within that objective there will be a task to clear the hamlet, and another task to extract back to the start location. Each of thes tasks will be layers.
Slots
Within layers are Slots - these actually spawn things like triggers, or AI, or markers.
There are a number of other things, such as logics, but for this tutorial we'll be making do with the basics of Area, Layer and Slot.
Creating the Objective
So as I've said a couple of times my mission is going to be to clear the hamlet and then extract back to the start point. For this I'm going to need an area and two layers, with quite a few slots.
The first thing I'm going to do is create a new layer called 'Mission', just to keep things tidy:
And I'll set it as active.
Create the Area
Within this layer I'm going to drop an area. These canbe found in the Resource Browser under ArmaReforger>Prefabs>ScenarioFramework>Components and are called Area.et:
Click and drag this anywhere on the map - although for sanity's sake I've put it near the objective:
This is our area! You can do an awful lot with these, but for now I'll only mention the Activation Type. Under Object Properties click on SCR_ScenarioFrameworkArea:
Now scroll down and find the Activation menu, and under that the Activation Type line:
The default is set to 'ON_INIT,' which means as soon as the mission starts the area is created. We're going to be using two different activation types, ON_INIT and ON_TRIGGER_ACTIVATION, which means that the area/layer/slot won't be activated until it is spawned in by a trigger.
For such a simple mission, we're not going to be messing around with the area, so just leave everything as the default setting, except for 'Faction Key' which will need setting to 'US':
Create Clear Area Task
Now we need to create our first layer - we can do an empty layer or, we can add some present LayerTasks. In this case, we want LayerTaskClearArea.et, found in the same place as Area.et (You might able to skip this step as the TaskClearArea prefab makes the same thing, so I've just got an extra layer - but it works so ah well):
Click and drag this anywhere on the map, but again for sanity's sake near the hamlet. Once its been created, we need to make it a 'child' of Area1 in the Hierarchy. Do this by clicking and dragging the entitiy in the hierarchy screen onto Area1:
So it looks like this:
Now we need to add our clear area task - and again there is a nice prefab to do this. In the resource browser go to ArmaReforger>Prefabs>ScenarioFramework>Compositions>LayerTasks and find TaskClearArea.et:
Click and drag this onto the hamlet, and you will get a big purple sphere! This is the area that need to be cleared:
In the hierarchy, you'll see it has created two entities, TaskClearArea1 and SlotClearArea1 - TaskClearArea1 creates the task in the map screen, and SlotClearArea1 creates the trigger that checks to see if the area is clear. Drag TaskClearArea1 to make it a child of LayerTaskClearArea1:
First, we're going to set the task name and description. Click on TaskClearArea1 in the hierarchy:
Then in Object Properties click on SCR_ScenarioFrameworkLayerTaskClearArea:
Scroll down until you find the Task menu, and fill out the Task Title and Task Description:
We can also change the size of the trigger area, by clicking on SlotClearArea1 in the hierarchy:
Then under Object Properties SCR_ScenarioFrameworkSlotClearArea:
Scrolling down to plug ins and changing the Area Radius under SCR_ScenarioFrameworkPluginTrigger:
I'll also point out the Debug menu here, which has two option, 'Show Debug Shapes During Runtime' and 'Show Debug Shapes in Workbench':
If show shapes during runtime is ticked, players will be able to see the big purple sphere when they're playing. If show shaped in workbench is ticked, then you will be able to see the big purple sphere in the workbench whilst editting the mission, but it won't be there when players are actually playing.
So, now we have a trigger that will activate when the player is in the hamlet and there are no USSR troops there either.
Creating AI
We need someone to fight!
There is a type of slot called SlotAI that spawns an AI group. Go to the resource browser, ArmaFreorger>Prefabs>ScenarioFramework>Components and find SlotAI.et:
Click and drag this entity onto the map where you want your AI to spawn:
And again make this a child of LayerTaskClearArea1 by dragging it on the hierarchy tab:
Once its selected, go to Object Properties and click on SCR_ScenarioFrameworkSlotAI:
And scroll down to the asset menu, where we will tell Reforger what AI group we want to spawn. Click on the two dots next to Object to Spawn:
In the menu that pops up, navigate to ArmaReforger>Prefabs>Groups>OPFOR and select Group_USSR_RifleSquad.et:
Click OK, and this slot will now spawn a USSR Rifle Squad! But what if I'm playing on my own? Or with lots of people? What can I do?
Have no fear! The Scenario Framework has a nifty built in balance system. Still on SlotAI1, scroll down until you find the Balance menu:
If you check the Balance on Players Count box, the Scenario Framework will see how many players are connected when the slot is initialised, and scale the number of AI it spawns accordingly. You can also set a mininum number of AI to spawn by Min Units in Group.
This comes into play when the slot is initialised - so, for this mission it spawns the AI as soon as the game starts, and therefore if one player joined and spawned, then ten more joined, it would have spawned the AI believing that there is only one player to balance against. The simplest way to get around this is to have a 'Move to area' task at the start that then spawns the actual task, so the AI will spawn once you reach the general area of the mission. I'll be going into how to make tasks when spawn another is completed when I go through the exfil task.
For now, though, this is a basic tutorial and so I've ticked the Balance on Players Count box and set the minimum units to 2:
This AI will automatically spawn a Defend waypoint on itself, but to give us a bit more control we're going to create our own Defend waypoint and assign the squad to it.
In the Resource Browser, go to ArmaReforger>Prefabs>ScenarioFrameworks>Components again and find SlotWaypoint.et:
Drag this onto the map where you want the AI to defend, and make it a child of LayerTaskClearArea1 again:
Under Object Properties select SCR_ScenarioFrameworkSlotWaypoint:
Scroll down again and you'll have a Waypoint Menu which just has one line saying Waypoint and a button that says set class. Click on set class:
From the list select SCR_ScenarioFrameworkWaypointDefend:
This will change the entity on the map to a Defend Waypoint and will give you a blue circle to show the completion radius - which for a defend waypoint is the area to be defended. You can change this radius by changing the value next to 'Completion Radius' in the Waypoint menu:
Now we need to tell our AI to use that waypoint. Click back on SlotAI1 on the hierarchy:
And under Object Properties select SCR_ScenarioFrameworkSlotAI:
Scroll down and find that Waypoints menu, then click where it says set class next to Waypoint set:
This will add a new line called Layer Name. This is a bit confusing, as we need to put the name of the slot in here - not the name of the layer!
Click on the little + icon next to Layer Name:
Then in the new line, type in the name of the waypoint slot - in this case, SlotWaypoint1:
We now have an AI squad defending the hamlet!
Create Exfil Task
Now we've got our objective set up so we have a task that is complete when the hamlet is clear of enemy forces. You can click the preview button if you want to play through this.
We're going to create a new Layer Task, a LayerTaskMove. In the resource browser, go to ArmaReforger>Prefabs>ScenarioFramework>Components and find LayerTaskMove.et:
Drag this onto the map and make it a child on Area 1 in the Hierarchy:
Now, we don't want this layer spawning right away - we want it to spawn in only when the Clear Area task has been completed. So we need to change its Activation Type, that I mentioned earlier. Select LayerTaskMove1 and go to Object Properties, and select SCR_ScenarioFrameworkLayerTask:
And scroll down to the activation menu, where the activation type will be SAME_AS_PARENT, meaning it will be ON_INIT as Area1, its parent, is set to ON_INIT:
Click on the drop down and change this to be ON_TRIGGER_ACTIVATION:
This layer and its childen will now not spawn until it is activated by a trigger, which we will set up after we've created the layer.
Now we need to add the exfil task, so in the resource browser go to ArmaReforger>Prefabs>scenarioFramework>Compositions>LayerTasks and find TaskExfil.et (As with the other LayerTask, I think this creates the Layer and the slow, making the LayerTaskMove1 not actually required, all the slots can just sit under TaskExfil1):
Drag this onto the map over our start location (where we want the players to extract to):
And we will get another beautiful purple sphere:
In the hierarchy, make this a child of LayerTaskMove1:
The first thing we will need to do is to stop the purple spheres from showing during runtime - as the default has them on for some reason. With TaskExfil1 selected click on SCR_ScenarioFrameworkLayerTask in Object Properties:
Scroll down to debug and un-tick Show Debug Shapes During Runtime:
Do the same for SlotExtraction1:
The default for the extraction is that you will need 75% players in the pruple sphere for 20 seconds to win. You can change the radius by changing Area Radius, change how long they need to be in the extraction area by changing Activation Countdown Timer, and change what % of players you need extracted under Minimum Players Needed Percentage (I'd advise a 100% for organised play - leave no man behind!):
Ending the Game
We now need to set it so that when this trigger is finished, the game ends!
Make sure that SlotExtraction1 is selected in Hierarchy and SCR_ScenarioFrameworkSlotExtraction is in Object Properties, then scroll down to OnTaskFinish:
Click on the + icon next to Actions On Finished:
Select from the menu SCR_ScenarioFrameworkActionEndMission:
Tick the box that says 'OVerride Game Over Type' and select EDITOR_FACTION_VITORY from the drop down:
Now when the exfil task is complete, the game will end.
We don't want things to be as easy as all that, so I'm going to add another SlotAI and SlotWaypoint to make an AI squad that comes and cuts you off.
So, find SlotAI.et under ArmaReforger>Prefabs>ScenarioFramework>Compositions>LayerTasks and drag it to where you want the AI to spawn, then make it a child of LayerTaskMove1:
Under Object Properties go back to SCR_ScenarioFrameworkSlotAI:
And then under the Asset menu click the two dots next to Object to Spawn:
I'm going to go for another rifle squad:
I'm also going to put the Balance on Players Count on again, and set the minimum units to 3:
I'm then going to create a SlotWaypoint and put it by the extract location, before again making it a child of LayerTaskMove1:
Under Object Properties, select SCR_ScenarioFrameworkSlotWaypoint:
And under Waypoint I'm going to click set class:
And I'm going to select SCR_ScenarioFrameworkWaypointMove:
You could also consider a WaypointAttack here instead.
Go back onto SlotAI2:
Then under Object Properties onto SCR_ScenarioFrameworkSlotAI:
Then scroll down to Waypoints and click set class next to Waypoint set:
Click the + icon next to Layer Name:
And type in SlotWaypoint2:
Now when the AI spawn in they will start running to cut you off from your extract!
Activating the Exfil Layer
Currently, the exfil task will never be spawned in as there is nothing activating it.
We want it to activate once the clear area task has been finished. The way we do this is by going back onto LayerTaskClearArea1 and select SlotClearArea1:
Then under Object Operations selecting SCR_ScnearioFrameworkSlotClearArea:
Then we scroll down and find the OnTaskFinish menu:
Then click the + icon next to Actions on Finished, to add a new action that will occur when the task is finished:
Select SCR_ScenarioFrameworkActionSpawnObjects from the list:
Then click the + icon next to Name of Objects To Spawn on Action:
Then type into the box that appears, LayerTaskMove1 - the layer that we want to spawn once the clear area task has been completed:
And that's it - we now have a working mission where players have to clear the hamlet, then extract back to their start point! Click on the green play button to preview it. If the AI don't move - double check your navmeshes, make sure that both are selected! I spent about four hours yesterday trying to work out why waypoints weren't working, only to discover that I'd forgotten to select a NavMesh.