Q: If my mod supports using this “Circuit” group tab, would it make players fail to load without it?
A: No, you can use conditional statements to set which subgroup the modded item belongs to. Schall Armoured Train is a perfect example, to my another group tab mod Schall Transport Group.
Q: I have tons of modded circuit components (say, new combinators) that wants to be put new subgroups, can I do that?
A: Yes, you may create new subgroups if you want to. Simply set it
group = "transport" with a proper
order then it will work. Schall Tank Platoon is an example on creating custom subgroups, to my another group tab mod Schall Transport Group.
Q: Why not this mod just set all the subgroups of all other circuit components mods?
A: It is because I feel it is not the best way to do that, and maybe a bit disrespectful to fellow modders. They may have their preferred way to handle things, like using further subgroups to show things nicely. Furthermore, setting subgroups of their items may actually disrupt and prevent fellow modders to work with this mod.
So I leave this mod purely as a common and basic framework for everyone. No code will be included to directly alter any modded items (not even those from my other circuit components mods!)
Still the best way is for fellow modders to add conditional assignments to their own items, who know their own mods the best.
Instructions to Fellow Modders
Adding Optional Dependency
Your mod should work with or without this mod. So first of all, in "info.json" of your mod folder, please add an optional dependency
"? SchallCircuitGroup", to make sure the load order is correct.
Here is an example:
"dependencies": ["base >= 0.18.0", "? SchallCircuitGroup"]
Putting into a Subgroup
This mod has already done most of the job for you. You simply need to set the subgroup where your item should belong to, like the following:
subgroup = "circuit-combinator"
Or pick the appropriate subgroup instead. The list of subgroups are as below:
circuit-network(the vanilla subgroup): Contains miscellanous items, e.g., wires, cables.
circuit-connection: Connection controls, e.g., vanilla power switch.
circuit-combinator: All combinators, e.g., vanilla arithmetic combinator, decider combinator, constant combinator.
circuit-visual: Outputs circuit signals as visual perception to players, e.g., lamps.
circuit-auditory: Outputs circuit signals as auditory perception to players, e.g, vanilla programmable speaker.
There are three extra subgroups for each of the vanilla combinator types. They can also be used at any time, but those vanilla combinators are moved in only if mod option "Individual combinator subgroups" is enabled.
Advanced: Conditional assignment
You would want your mod to both work with and without “Schall Circuit Group” mod installed, right?
Then you would need conditional assignment of subgroups, based on whether “Schall Circuit Group” mod is present or not.
First declare a local variable that will temporarily store the subgroup name, which assigns to vanilla subgroup
local subgroup_circom = "circuit-network"
Next, detect if “Schall Circuit Group” mod is present. If yes, set the variable to the desired subgroup name.
if mods["SchallTransportGroup"] then
subgroup_circom = "circuit-combinator"
Then use the variable
subgroup_circom in your item prototype definition, like:
subgroup = subgroup_circom
Creating New Subgroups
You may also create new subgroups if you want. An example as follows:
type = "item-subgroup",
name = "circuit-combinator-4",
group = "circuit",
order = "c-4",
Then you can assign
subgroup = "circuit-combinator-4" to your custom combinator in prototype declarations.
So this mod does NOT limit you on what subgroups you should use, but merely provides a common framework for all circuit components modders to use! If you feel a new subgroup I have missed and should be included in this common framework, please state in the Discussion section!
Full List of New (or Changed) Items
- 1 group:
- (1 changed, 7 new) subgroup:
- circuit-network (was under "logistics" group, now under "circuit" group)
List of Subgroups Used by Compatible Mods
If your mod has any new subgroups created, you may write me the details in the Discussion section. I will keep updating this page, so trying to minimize "competition" over the order space between different mods!
|Subgroup||Order||Created by||Item types||Examples / Remarks|
|circuit-network||a||Vanilla||Anything not actually placed entities.||Default for all items that were in vanilla circuit-network subgroup.|
|circuit-connection||b||This mod||Connection controls.||Power switch.|
|circuit-combinator||c||This mod||Any combinators.|
|circuit-combinator-arithmetic||c-1||This mod||Arithmetic combinators.||Arithmetic combinators.|
|circuit-combinator-decider||c-2||This mod||Decider combinators.||Decider combinators.|
|circuit-combinator-constant||c-3||This mod||Constant combinators.||Constant combinators.|
|circuit-visual||e||This mod||Visual perception to players.||Lamps.|
|circuit-auditory||f||This mod||Auditory perception to players.||Programmable speaker.|