ScenEdit_AddMission (SideNameOrId, MissionNameOrId, MissionType, MissionOptions)
This function adds a new mission to the side based on the supplied options
It is suggested to make the mission name unique across the scenario to ensure there are no conflicts as to the side it is applicable to
Once the core mission is added, the mission can be adjusted through a wrapper or ScenEdit_SetMission
Parameters
- SideNameOrId string The mission side name/guid
- MissionNameOrId string The mission name as this is a new mission
- MissionType MissionType The type of mission which will control what is valid for the following options
-
MissionOptions
{}
The mission specific options
- destination = string A mission destination location name/guid (This only applies to a 'Ferry' mission)
-
type =
MissionSubType
Mission sub-type (This only applies to mission types 'Patrol' and 'Strike')
-
zone =
{} of multiple
The area to operate in (This only applies to 'Patrol', 'Support', 'Mining', 'Cargo' missions)
- string The reference point guid/name
Returns
Mission A mission wrapper for the new mission or nil
otherwise.
Retaining the mission guid for updating would be desirable rather than rely on the name itself.
Example
local mission = ScenEdit_AddMission( 'USA', 'Marker strike', 'strike',{ type = 'land'} )
local missionReferencePoints={'rp-1','rp-2','rp-3'}
local mission = ScenEdit_AddMission (OPFORsideName, 'OPFOR Mission', 'Patrol', {type= 'AAW',zone= missionReferencePoints} )