-
Notifications
You must be signed in to change notification settings - Fork 3
structureList
-
easyEdit
-
structureList
This module can be used to add new structureLists to the game, or fetch existing ones.
Each island has a structureList associated with it, that describes which structures can spawn on the island.
-
tableadd(string structureList_id, string base_structureList_id)
To add a new structureList, start by calling this function. Use a unique structureList_id for your structureList to avoid potential collisions with structureLists from other mods.
You can create a structureList with a default base by leaving base_structureList_id empty, or you can use the id of an existing structureList to get a better base to start from. Anything you change after that, will only affect your own structureList.
Example - structureList with a default base:
local structureList = easyEdit.structureList:add("structureList_example")Example - structureList based on the vanilla structureList:
local structureList = easyEdit.structureList:add("structureList_example", "vanilla")This will return a structureList object, which you can build on using table fields and methods found on this page.
-
tableget(string structureList_id)
Returns the structureList object for an existing structureList with this structureList_id.
| Vanilla StructureList id |
|---|
"vanilla" |
string
The unique id for this structureList.
table
A list of structure id's for structures rewarding power. Use copy or addAssets instead of setting this field directly.
table
A list of structure id's for structures rewarding reputation. Use copy or addAssets instead of setting this field directly.
table
A list of structure id's for structures rewarding cores. Use copy or addAssets instead of setting this field directly.
-
voidaddAssets(table structure_id_table)
Adds all the structures referred to in the provided structure_id_table. All structures will be entered into the correct tables (PowAssets/RepAssets/TechAssets) according to their respective Reward types (see: CreateStructure).
Example:
structureList:addAssets{
"Str_Power",
"Str_Nimbus",
"Str_Battery",
"Str_Power",
"Str_Robotics",
"Str_Research",
"Str_Bar",
"Str_Clinic",
}This is the vanilla structure list.
-
voidcopy(table other_structureList)
Copies structureList variables from another structureList to this structureList.
Example:
-- First you must create an structureList object.
local structureList = easyEdit.structureList:add("structureList_example")
-- Then you must fetch the structureList object of an existing structureList.
local other_structureList = easyEdit.structureList:get("vanilla")
-- Finally you can copy the variables from the other structureList to yours.
structureList:copy(other_structureList)