mission_task_substitute_constructions¶
Source: base/tealdef/mission/tasks/utility/mission_task_substitute_constructions.d.tl
Notes
Task that replaces or refreshes constructions.
MissionTaskSubstituteConstructions¶
record global base/tealdef/mission/tasks/utility/mission_task_substitute_constructions.d.tl:3
global record MissionTaskSubstituteConstructions is MissionInterface.TaskScript<MissionTaskSubstituteConstructions.State, MissionTaskSubstituteConstructions.Params>
Load: local substitute_constructions = ug_require "::/mission/tasks/utility/substitute_constructions.tl"
Notes
Task (substitute_constructions) that replaces, refreshes or rebuilds constructions with a new file or new params, optionally giving them to the player, then completes.
MissionTaskSubstituteConstructions.Params¶
record base/tealdef/mission/tasks/utility/mission_task_substitute_constructions.d.tl:4
record Params
Notes
Params of the task.
Used in the base game: 1 time in 1 file
base/content/mission/mission/tasks/utility/substitute_constructions.tl:6
Fields
| Name | Type | Description |
|---|---|---|
newConstruction |
ResName |
Construction file of the replacement. |
baseName |
string |
Name of the new constructions, numbered "<baseName> <n>" (default "Construction"). |
transferOwnershipToPlayer |
boolean |
Gives the constructions to the player afterwards. |
useRefreshFn |
boolean |
Refreshes each construction with newConstruction (api.engine.util.proposal.refreshConstruction) instead of rebuilding it. |
useReplaceFn |
boolean |
Replaces each construction with new params (createProposalReplaceConstruction) instead of rebuilding it. |
Functions
getEntities(readOnlyApi : MissionInterface.MissionTaskReadOnlyApi) : {Engine.Entity} base/tealdef/mission/tasks/utility/mission_task_substitute_constructions.d.tl:7
Notes
Returns the constructions to substitute.
| Parameter | Type | Description |
|---|---|---|
readOnlyApi |
MissionInterface.MissionTaskReadOnlyApi |
Read-only mission API. |
Returns {Engine.Entity}: Construction entities.
getRuleCapacityMultiplier(entity : Engine.Entity, readOnlyApi : MissionInterface.MissionTaskReadOnlyApi) : {integer : number} base/tealdef/mission/tasks/utility/mission_task_substitute_constructions.d.tl:8
Notes
Returns the ruleCapacityMultiplier construction param of a new construction.
| Parameter | Type | Description |
|---|---|---|
entity |
Engine.Entity |
Construction being replaced. |
readOnlyApi |
MissionInterface.MissionTaskReadOnlyApi |
Read-only mission API. |
Returns {integer : number}: Index -> multiplier.
makeReplaceParams(params : table) : table base/tealdef/mission/tasks/utility/mission_task_substitute_constructions.d.tl:12
Notes
Builds the new construction params for useReplaceFn.
| Parameter | Type | Description |
|---|---|---|
params |
table |
Current construction params. |
Returns table: New construction params.
MissionTaskSubstituteConstructions.State¶
record base/tealdef/mission/tasks/utility/mission_task_substitute_constructions.d.tl:14
record State
Notes
State of the task.
Used in the base game: 1 time in 1 file
base/content/mission/mission/tasks/utility/substitute_constructions.tl:5
Fields
| Name | Type | Description |
|---|---|---|
isComplete |
boolean |
The substitution was done. |
entities |
{Engine.Entity} |
Constructions that were substituted. |