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 |
|
-
chapter_mission:new(chapter number
number,faction key
string,mission key
string,advice key
[string],infotext
[table]
) -
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
numberChapter 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
stringFaction key of the faction receiving the mission.
3
stringMission key of the chapter mission.
4
stringoptional, default value=nil
Key of advice to deliver alongside the mission.
5
tableoptional, default value=nil
table of string infotext keys to deliver alongside advice.
Returns:
chapter_missionChapter mission object
defined in ../working_data/script/_lib/lib_campaign_mission_manager.lua, line 1299
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()
-
chapter_mission:has_been_issued() -
returns whether the chapter mission has been issued.
Returns:
booleanhas 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:
booleanhas been completed
defined in ../working_data/script/_lib/lib_campaign_mission_manager.lua, line 1442
-
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:
nil
defined in ../working_data/script/_lib/lib_campaign_mission_manager.lua, line 1461