mission_boot_util¶
Source: base/tealdef/mission/mission_boot_util.d.tl
Notes
Helpers that turn a task-data factory and a list of boot tasks into the script module that the mission or guide-system game script boots from.
MissionBootUtil¶
record global base/tealdef/mission/mission_boot_util.d.tl:3
global record MissionBootUtil
Load: local mission_boot_util = ug_require "::/mission/mission_boot_util.tl"
Notes
Builds the script module (vtable factory and boot function) of a mission or guide-system story from a task-data factory.
Details
The story is a function taskKey -> MissionTaskUtil.StaticTaskInfo. Each task lists its
followup tasks; bootTasks are the first ones. Task keys are local to the story; the boot
util turns them into unique keys with MissionTaskUtil.makeTaskKey(taskKey, scriptKey).
Example
-- urbangames_campaign_mission_01: mission/mission.tl
local mission_boot_util = ug_require "::/mission/mission_boot_util.tl" as MissionBootUtil
local taskDataFactory = ug_require "mission_story.tl" as function(taskKey : string) : MissionTaskUtil.StaticTaskInfo
return mission_boot_util.makeMission({
scriptKey = "urbangames_campaign_mission_01::/mission/mission.script",
taskDataFactory = taskDataFactory,
bootTasks = {
{ taskKey = "check_entities" },
{ taskKey = "intro" },
{ taskKey = "intro_cutscene" },
{ taskKey = "non_bulldozable" },
},
})
Functions
makeMission(config : MissionConfig) : Module base/tealdef/mission/mission_boot_util.d.tl:22
Call as mission_boot_util.makeMission
Notes
Builds the module of a mission story; vtables provide getTaskInfo from the static taskInfo.
| Parameter | Type | Description |
|---|---|---|
config |
MissionConfig |
Mission configuration. |
Returns Module: Module to export as mission from the script named in scriptKey.
Used in the base game: 9 times in 9 files
base/content/mission/mission/tutorial/tutorial.tl:5
mods/release/urbangames_campaign_mission_03/content/mission/mission/mission.tl:6
mods/release/urbangames_campaign_mission_07/content/mission/mission/mission.tl:6
mods/release/urbangames_campaign_mission_02/content/mission/mission/mission.tl:6
mods/release/urbangames_campaign_mission_06/content/mission/mission/mission.tl:6
mods/release/urbangames_campaign_mission_01/content/mission/mission/mission.tl:6
… and 3 more files.
makeGuide(config : GuideConfig) : Module base/tealdef/mission/mission_boot_util.d.tl:23
Call as mission_boot_util.makeGuide
Notes
Builds the module of a guide-system story; vtables provide getGuideInfo from the static guideInfo.
| Parameter | Type | Description |
|---|---|---|
config |
GuideConfig |
Guide configuration. |
Returns Module: Module to export as guide_system from the script named in scriptKey.
Used in the base game: 6 times in 6 files
base/content/mission/mission/guide_system/main/guide_system.tl:5
base/content/mission/mission/tutorial/guide_system/guide_system.tl:5
mods/release/urbangames_campaign_mission_03/content/guide_system/guide_system/guide_system.tl:5
mods/release/urbangames_campaign_mission_07/content/guide_system/guide_system/guide_system.tl:5
mods/release/urbangames_campaign_mission_02/content/guide_system/guide_system/guide_system.tl:5
mods/release/urbangames_campaign_mission_01/content/guide_system/guide_system/guide_system.tl:5
MissionBootUtil.MissionConfig¶
record base/tealdef/mission/mission_boot_util.d.tl:4
record MissionConfig
Notes
Configuration of a mission story for makeMission.
Used in the base game: 1 time in 1 file
base/content/mission/mission/mission_boot_util.tl:107
Fields
| Name | Type | Description |
|---|---|---|
scriptKey |
string |
Script that exposes the module as mission (e.g. "urbangames_campaign_mission_01::/mission/mission.script"); also the root of the task keys. |
bootTasks |
{MissionTaskUtil.FollowupDef} |
Tasks added when the mission starts. |
Functions
taskDataFactory(taskKey : string) : MissionTaskUtil.StaticTaskInfo base/tealdef/mission/mission_boot_util.d.tl:6
Notes
Returns the static description of a task key, or nil for unknown keys.
| Parameter | Type | Description |
|---|---|---|
taskKey |
string |
Task key local to the story. |
Returns MissionTaskUtil.StaticTaskInfo: Static task description.
MissionBootUtil.GuideConfig¶
record base/tealdef/mission/mission_boot_util.d.tl:10
record GuideConfig
Notes
Configuration of a guide-system story for makeGuide.
Used in the base game: 1 time in 1 file
base/content/mission/mission/mission_boot_util.tl:127
Fields
| Name | Type | Description |
|---|---|---|
scriptKey |
string |
Script that exposes the module as guide_system; also the root of the task keys. |
bootTasks |
{MissionTaskUtil.FollowupDef} |
Guide tasks added at start. |
skipIfStartedAsMission |
boolean |
Does not add the boot guides when the game was started as a mission. |
Functions
taskDataFactory(taskKey : string) : MissionTaskUtil.StaticTaskInfo base/tealdef/mission/mission_boot_util.d.tl:12
Notes
Returns the static description (with guideInfo) of a guide task key.
| Parameter | Type | Description |
|---|---|---|
taskKey |
string |
Task key local to the story. |
Returns MissionTaskUtil.StaticTaskInfo: Static task description.
MissionBootUtil.Module¶
record base/tealdef/mission/mission_boot_util.d.tl:17
record Module
Notes
Script module returned by makeMission / makeGuide; exported by the story's .script file so the framework can call it by name.
Used in the base game: 2 times in 1 file
base/content/mission/mission/mission_boot_util.tl:107
Functions
getVTable(taskKey : string, uniqueKey : string) : MissionInterface.TaskVTable<any, any> base/tealdef/mission/mission_boot_util.d.tl:18
Notes
Builds the vtable of a task (target of TaskConfig.getVTableScriptFn).
| Parameter | Type | Description |
|---|---|---|
taskKey |
string |
Task key local to the story. |
uniqueKey |
string |
Unique task key. |
Returns MissionInterface.TaskVTable<any, any>: Vtable of the task.
spawnBootTasks(taskKey : string, ctx : MissionInterface.TaskContext<any, any>, missionApi : MissionInterface.MissionTaskApi) base/tealdef/mission/mission_boot_util.d.tl:19
Notes
Adds the boot tasks (when taskKey is nil) or the follow-ups of taskKey whose condition holds. Target of BootstrapDesc.bootstrapScriptFn.
| Parameter | Type | Description |
|---|---|---|
taskKey |
string |
nil for the boot tasks, otherwise the completed task's key. |
ctx |
MissionInterface.TaskContext<any, any> |
Context of the completed task (nil at boot). |
missionApi |
MissionInterface.MissionTaskApi |
API used to add the tasks. |