Skip to content

Commit

Permalink
Merge pull request #244 from ILLISIS/v2.0.16
Browse files Browse the repository at this point in the history
V2.0.16
  • Loading branch information
ILLISIS authored Dec 21, 2024
2 parents bee380b + 247bbd3 commit 44d833f
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 79 deletions.
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---------------------------------------------------------------------------------------------------
Version: 2.0.16
Date: 2024-12-20
Changes:
- [mods] Added remote interface to register custom Constructrons and Service Stations types.
- Added in game tips-and-tricks help articles to improve the novice user experience.
---------------------------------------------------------------------------------------------------
Version: 2.0.15
Date: 2024-12-14
Bugfixes:
Expand Down
41 changes: 40 additions & 1 deletion control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ end))
--===========================================================================--

local ensure_storages = function()
storage.constructron_names = storage.constructron_names or { ["constructron"] = true, ["constructron-rocket-powered"] = true}
storage.station_names = storage.station_names or { ["service_station"] = true }
--
storage.registered_entities = storage.registered_entities or {}
storage.constructron_statuses = storage.constructron_statuses or {}
--
Expand Down Expand Up @@ -399,6 +402,37 @@ gui_handlers.register()
--- game interfaces
--===========================================================================--

--------------------------------------------------------------------------------
--- before using the below functions please notify the maintainer of this mod
---------------------------------------------------------------------------------
--- used by:
--- Planet Maraxis
--- Spidertron Patrols
--- Construction Planner

-- remote interface to inform this mod of a new constructron type (this mod will handle the entity for you)
---@param name string
local function remote_add_ctron_name(name)
storage.constructron_names[name] = true
end

-- remote interface to inform this mod of a new station type (this mod will handle the entity for you)
---@param name string
local function remote_add_station_name(name)
storage.station_names[name] = true
end

-- remote interface to get constructron names
local function remote_get_ctron_names()
return storage.constructron_names
end

-- remote interface to get station names
local function remote_get_station_names()
return storage.station_names
end

-- notify this mod of alignments new entity to be built (if this not naturally handled by the on_event scripting)
---@param entity LuaEntity
local function remote_entity_built(entity)
---@type EventData.script_raised_built
Expand All @@ -410,6 +444,7 @@ local function remote_entity_built(entity)
entity_proc.on_built_entity(event)
end

-- notify this mod of new entities to be built (if this not naturally handled by the on_event scripting)
---@param entities LuaEntity[]
local function remote_entities_built(entities)
for _, entity in pairs(entities) do
Expand All @@ -419,5 +454,9 @@ end

remote.add_interface("ctron", {
["scan-entity"] = remote_entity_built,
["scan-entities"] = remote_entities_built
["scan-entities"] = remote_entities_built,
["add-ctron-names"] = remote_add_ctron_name,
["get-ctron-names"] = remote_get_ctron_names,
["add-station-names"] = remote_add_station_name,
["get-station-names"] = remote_get_station_names,
})
1 change: 1 addition & 0 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require("data/shortcuts")
require("data/custom_input")
require("data/styles")
require("data/cargo_buttons")
require("data/tips-and-tricks")

if mods["space-exploration"] then
require("data/constructron-rocket-powered")
Expand Down
66 changes: 66 additions & 0 deletions data/tips-and-tricks.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
data:extend{
-- tips-and-tricks-item-category
{
type = "tips-and-tricks-item-category",
name = "spidertron-automation",
order = "a",
},
-- tips-and-tricks-item
{
type = "tips-and-tricks-item",
name = "spidertron-automation",
tag = "[item=constructron][item=service_station]",
category = "spidertron-automation",
order = "a",
indent = 0,
is_title = true,
starting_status = "suggested",
trigger = {type = "unlock-recipe", recipe = "constructron"},
},
{
type = "tips-and-tricks-item",
name = "sa-settings",
category = "spidertron-automation",
order = "b",
indent = 1,
starting_status = "suggested",
trigger = {type = "unlock-recipe", recipe = "constructron"},
},
{
type = "tips-and-tricks-item",
name = "sa-general-jobs",
category = "spidertron-automation",
order = "c",
indent = 1,
starting_status = "suggested",
trigger = {type = "unlock-recipe", recipe = "constructron"},
},
{
type = "tips-and-tricks-item",
name = "sa-stations",
category = "spidertron-automation",
order = "d",
indent = 1,
starting_status = "suggested",
trigger = {type = "unlock-recipe", recipe = "constructron"},
},
{
type = "tips-and-tricks-item",
name = "sa-cargo-jobs",
category = "spidertron-automation",
order = "e",
indent = 1,
starting_status = "suggested",
trigger = {type = "unlock-recipe", recipe = "constructron"},
image = "__Constructron-Continued__/graphics/tips-and-tricks/cargo_ui.png"
},
{
type = "tips-and-tricks-item",
name = "sa-destroy-jobs",
category = "spidertron-automation",
order = "f",
indent = 1,
starting_status = "suggested",
trigger = {type = "unlock-recipe", recipe = "constructron"},
},
}
Binary file added graphics/tips-and-tricks/cargo_ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Constructron-Continued",
"version": "2.0.15",
"version": "2.0.16",
"title": "Constructron-Continued",
"author": "ILLISIS",
"homepage": "https://github.com/ILLISIS/Constructron-continued/",
Expand Down
18 changes: 17 additions & 1 deletion locale/en/locale.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,20 @@ min_text_field_tooltip=The amount which will trigger a cargo job.
max_text_field_tooltip=The total amount of the selected item the cargo job move.
show_all_stations_button=Show all stations
copy_station_requests_tooltip=Copy station requests to clipboard
paste_station_requests_tooltip=Paste station requests from clipboard. This will overwrite the current station requests.
paste_station_requests_tooltip=Paste station requests from clipboard. This will overwrite the current station requests.

[tips-and-tricks-item-name]
spidertron-automation=Spidertron Automation
sa-settings=Mod Settings
sa-general-jobs=General Jobs
sa-stations=Service Stations
sa-cargo-jobs=Cargo Jobs
sa-destroy-jobs=Destroy Jobs

[tips-and-tricks-item-description]
spidertron-automation=Spidertron Automation, formally called Constructron-Continued.\n\n[font=default-bold]Automated Spidertrons[/font];\nhave the ability to move, set logistic requests, construct, deconstruct, repair, upgrade entities/blueprints and destroy enemies of any size, anywhere on the map with items from your logistic network for the ultimate fire and forget automation and megabase quality of life experience with unmatched scaling potential.\n\n[font=default-bold]What is a Constructron?[/font]\nIt's literally an automatic Spidertron. There is no black magic or man behind the curtain. All behavior can be done in the base game.\n\n[font=default-bold]What is a Service Station?[/font]\nIt's a limited roboport with just a logistic zone that serves as a home point for Constructrons. Additionally, you can use more Stations to identify other networks, Constructrons will check each Station for items that it is lacking.\n\n[font=default-bold]How do I set it up?[/font]\nStep 1) Research Spidertrons\nStep 2) Place a Service Station inside your logistic network\nStep 3) Place one or more Constructrons\nStep 4) Setup the equipment grid for the Constructron(s)\nStep 5) Place a ghost or blueprint (anywhere on the map).\n\nAs long as all the required items are available in your logistic network the Constructron(s) will move to the ghost and build it.\nDeconstruction and Upgrades will also be handled by Contructrons automatically.\n\n[font=default-bold]How do I manage jobs?[/font]\nJobs, job status, settings and more can be managed from the Constructron GUI. The default hotkey combination to open the GUI is SHIFT+C+C. Alternatively you can find the mods button in the shortcut bar.\n\n[font=default-bold]What do the colors mean?[/font]\nWhite = Idling\nBlue = Constructing\nRed = Deconstructing\nGreen = Upgrading\nPurple = Repairing\nBlack = Destroy\n\n[font=default-bold]Things the mod can do:[/font]\nConstruct and rebuild entities that die\nDeconstruct\nUpgrade\nRepair\nDestroy (hunt biters)\nTransport items from station to station.\n\n[font=default-bold]Things the mod cannot do:[/font]\nMagically build ghost entities in the middle of a lake without a path to get there(or landfill ghosts)\nSpawn items from thin air. If you lack items, the factory must grow.
sa-settings=The mod settings can be accessed via the Constructron GUI (SHIFT+C+C) > Settings.\n\nMost settings are set per surface which is selectable by the surface drop down.\n\nThe player can hover over the value fields to display the tooltips of what each setting does.
sa-general-jobs=The set of jobs enabled by default are Construction, Deconstructruction, Upgrade and Repair.\n\nConstruction jobs are triggered when the player places a ghost or blueprints multiple ghsots.\nDeconstruction jobs are triggered when the player marks an entity for deconstruction.\nUpgrade jobs are triggered when the player marks an entity to be upgraded.\nRepair jobs are triggered automatically if an entity is damaged.\n\nExample use case:\nThe player places a [item=service_station] within the logistic network, generally this is the within the mall, the player then places a [item=constructron] and equips it with roboports and power generation equipment. The player is ready to proceed with building ghosts and / or blue prints of any size any where on the map. Constructrons will read the ghsots that are placed and calculate the items required to build the ghosts and a path to get there.\n\nItems must be available within the stations logistic network. Constructrons will wait for all items to be delivered before proceeding however you can cancel the item request and it will build what it can and come back for the rest once the items become available in the logistic network(s) where a station exists.
sa-stations=[item=service_station] define the home point for a [item=constructron].\n\nService stations also act as a potential item pickup point for Constructrons if an item is not available in the Constructrons original home point. This is particularly useful for auxilery factories that are separate from your mall (eg a dedicated landfill factory).\n\nStations can request certain items to be brought to it if the logistic network it is based in has less than a certain amount via the use of Cargo Automation jobs (see this tip category).\n\nMultiple stations in the same logistic network do not really serve any purpose other than proximity drop points for Cargo Automation jobs.\n\nThe nearest station to an idle Constructron (colored white) will be selected as the initial home point for a job.\n\nStations are otherwise a fully functioning roboport although limited in range.
sa-cargo-jobs=Set cargo requests on [entity=service_station] you would like cargo devliered to. [entity=constructron]'s will automatically deliver items to the station when the request threshold is met. Jobs are prospected every 10 seconds. \n\nYou must have a Constructron service station in the logistic network the items are available from and a station in the logistic network you want the items to be taken to. The source and destination station must not be in the same logistic network. \n\n[font=default-bold]Instructions:[/font]\nStep 1) place a Constructron service station in the source network\nStep 2) place a Constructron service station in the destination network\nStep 3) Ensure logistic robots are in both source and destination networks\nStep 4) Open the destination station's GUI and click Cargo Automation\nStep 5) Add the item(s) you would like brought to this station by Constructrons\nStep 6) Set the request threshold which is the minimum amount that should be in this network. Jobs will trigger when the item count is lower than this value\nStep 7) Set the request amount which is the amount of the specified item to bring when the request threshold is reached
sa-destroy-jobs=Destroy jobs are [entity=constructron]'s offensive ability and are mainly designed to keep an area clear of enemies rather than actually do the clearing.n\nDestroy jobs can be enabled in the Constructron GUI (SHIFT+C+C) > Settings. Ensure you have selected the desired ammunition type and count Constructrons will take on jobs (note: this will take effect on all jobs, not just destroy jobs. This doubles as Constructron's defensive option for other jobs in general).\n\nOnce Destroy jobs are enabled, upon radar sector scanning finding an enemy spawner or unit, a destroy job will be created and a Constructron assigned.\n\nThe player may manually trigger a Destroy job by using the selection tool (SHIFT+C) with the SHIFT+RIGHT CLICK SELECT combination.
Loading

0 comments on commit 44d833f

Please sign in to comment.