modding:constructionbasics
Differences
This shows you the differences between two versions of the page.
Both sides previous revision
Previous revision
Next revision
|
Previous revision
Next revision
Both sides next revision
|
modding:constructionbasics [2020/06/12 10:12] yoshi [UpdateFn] |
modding:constructionbasics [2020/06/20 11:01] yoshi ↷ Page name changed from modding:constructions to modding:constructionbasics |
</code> | </code> |
==== UpdateFn ==== | ==== UpdateFn ==== |
In this function, the construction is configured and specified. You can use the content of the table ''params'' to configure the construction. It also contains the selection of the user parameters you have specified in the ''params'' list above. See the [[:modding:constructiontypes||list of construction types]] to find out, which additional properties are available in the ''params'' table depending on the construction type. | In this function, the construction is configured and specified. You can use the content of the table ''params'' to configure the construction. It also contains the selection of the user parameters you have specified in the ''params'' list above. See the [[:modding:constructiontypes|list of construction types]] to find out, which additional properties are available in the ''params'' table depending on the construction type. |
| |
The ''updateFn'' returns a data struct with several mandatory and many optional properties. They are described below. Please note, that the return data struct is refered as ''result''. | The ''updateFn'' returns a data struct with several mandatory and many optional properties. They are described below. Please note, that the return data struct is refered as ''result''. |
* ''bulldozeCost'' is paid when the construction is demolished. | * ''bulldozeCost'' is paid when the construction is demolished. |
* ''maintenanceCost'' is paid monthly to maintain the infrastructure. | * ''maintenanceCost'' is paid monthly to maintain the infrastructure. |
| |
| === Label List === |
| For models with ''"CUSTOM"'' typed labels, the content can be provided here: |
| <code lua> |
| result.labelText = { |
| [12] = { "Label", "SomeText"} |
| } |
| </code> |
| |
| The ''labelText'' list contains a mapping of keys to value lists. The key number equals the id of the model in ''result.models'' that should be provided with some custom label texts. The list contains the strings. The first string is for the first label of the model, the second for the second model and so on. |
| |
\\ | \\ |
| |
<div page_next>[[:modding:constructiontypes|Construction Types]]</div> | <div page_next>[[:modding:constructiontypes|Construction Types]]</div> |
modding/constructionbasics.txt · Last modified: 2021/07/04 01:11 by yoshi