Skip to content

mission_task_town_rating_observer

Source: base/tealdef/mission/tasks/town_rating/mission_task_town_rating_observer.d.tl

Notes

Task that turns several town-rating tasks into one rising or falling progress value.

MissionTaskTownRatingObserver

record global base/tealdef/mission/tasks/town_rating/mission_task_town_rating_observer.d.tl:3

global record MissionTaskTownRatingObserver is MissionInterface.TaskScript<MissionTaskTownRatingObserver.State, MissionTaskTownRatingObserver.Params>

Load: local town_rating_observer = ug_require "::/mission/tasks/town_rating/town_rating_observer.tl"

Notes

Task (town_rating_observer) that sums +1 for each passing and -1 for each failing rating task every update. A positive sum adds twice its value to the progress, otherwise the progress drops by 1. It completes with success at 100 % and with failure at 0 %, starting at 50 %. A star icon drops one level every two game years.

MissionTaskTownRatingObserver.Params

record base/tealdef/mission/tasks/town_rating/mission_task_town_rating_observer.d.tl:4

record Params

Notes

Params of the task.

Used in the base game: 20 times in 2 files

base/content/mission/mission/tasks/town_rating/town_rating_observer.tl:6

local type P = MissionTaskTownRatingObserver.Params
mods/release/urbangames_campaign_mission_07/content/mission/mission/mission_story.tl:199
local state = (getTaskState("observer") as MissionInterface.TaskState<MissionTaskTownRatingObserver.State, MissionTaskTownRatingObserver.Params>).specific

Fields

Name Type Description
ratingTasks {string} Unique keys of the town_rating tasks to watch.
simTimeMinutesToComplete integer

MissionTaskTownRatingObserver.State

record base/tealdef/mission/tasks/town_rating/mission_task_town_rating_observer.d.tl:8

record State

Notes

State of the task.

Used in the base game: 20 times in 2 files

base/content/mission/mission/tasks/town_rating/town_rating_observer.tl:5

local type S = MissionTaskTownRatingObserver.State
mods/release/urbangames_campaign_mission_07/content/mission/mission/mission_story.tl:199
local state = (getTaskState("observer") as MissionInterface.TaskState<MissionTaskTownRatingObserver.State, MissionTaskTownRatingObserver.Params>).specific

Fields

Name Type Description
endTick integer Value of cumulativeRating that means 100 %.
cumulativeRating integer Current accumulated value.
success boolean true or false once the result is decided, nil before.
initialSimTimeMs integer Game time (ms) at which the current star period started.
endSimTimeMs integer Game time (ms) at which the current star period ends (two game years).
currentSimTimeMs integer Game time (ms) of the last update.
stars integer Stars still reachable (3 at start).