Chapter Missions

The chapter mission system is a simple wrapper for the traditional method of packaging chapter missions. It triggers the mission within an intervention to better control the flow of events on-screen, and optionally plays advice and infotext that can add flavour.

This system is due a rewrite to allow them to use mission_manager's and also allow chapter missions to be constructed from strings at runtime.

Loaded in Campaign loaded in campaign
Back to top

Creation

chapter_mission:new(
  number
chapter number,
  string
faction key,
  string
mission key,
  [string
advice key],
  [table
infotext]
)

Creates a chapter mission object. This should happen in the root of the script somewhere, so that the object is declared and set up by the time the first tick happens so that it can be properly restarted from a savegame.

Parameters:

1

number

Chapter number. All numbers from 1 to n should be accounted for, where n is the last chapter in the sequence. When a chapter mission completes it automatically starts the next chapter mission in the sequence.

2

string

Faction key of the faction receiving the mission.

3

string

Mission key of the chapter mission.

4

string

optional, default value=nil

Key of advice to deliver alongside the mission.

5

table

optional, default value=nil

table of string infotext keys to deliver alongside advice.

Returns:

  1. chapter_mission Chapter mission object

defined in ../working_data/script/_lib/lib_campaign_mission_manager.lua, line 1299

Back to top

Usage

Once a chapter_mission object has been created with chapter_mission:new, functions on it may be called in the form showed below.

Example - Specification:

<chapter_mission_object>:<function_name>(<args>)

Example - Creation and Usage:

local chapter_one_mission = chapter_mission:new(1, "wh_main_emp_empire", "wh_objective_empire_01")
chapter_one_mission:manual_start()
Back to top

Querying

chapter_mission:has_been_issued()

returns whether the chapter mission has been issued.

Returns:

  1. boolean has been issued

defined in ../working_data/script/_lib/lib_campaign_mission_manager.lua, line 1434

chapter_mission:has_been_completed()

returns whether the chapter mission has been completed.

Returns:

  1. boolean has been completed

defined in ../working_data/script/_lib/lib_campaign_mission_manager.lua, line 1442

Back to top

Starting

chapter_mission:manual_start()

Manually starts the chapter mission. It should only be necessary to manually start the first chapter mission in the sequence - the second will start automatically when the first is completed, and so on.

Returns:

  1. nil

defined in ../working_data/script/_lib/lib_campaign_mission_manager.lua, line 1461

Last updated 07/02/21 06:39:14