Schall Transport Group


Put transport subgroup into a separate new “Transport” group tab, containing all vanilla and most modded vehicles. Designed for players who have lots of modded vehicles cluttering the “Logistics” tab. (Locale: English, Deutsch, 正體中文, 简体中文, Português Brasileiro, Русский) To fellow modders: Please consider putting your modded vehicles in this group as well! Only minor modifications are needed. Instructions included in FAQ.

Utilities
3 years ago
0.17 - 1.1
22.2K
Transportation Trains

FAQ

Q: If my mod supports using this “Transport” 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 an example. Those modded items are put into the proper "vehicles-railway" and "vehicle-equipment-defense" subgroups only if this mod is loaded, so this mod is purely optional. Players can still play with Schall Armoured Train without this mod.

Q: I have tons of modded vehicles, vehicle-only equipment (or other stuff) 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.

Q: Why not this mod just set all the subgroups of all major vehicle 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 vehicle 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 "? SchallTransportGroup", to make sure the load order is correct.

Here is an example:

"dependencies": ["base >= 0.17.35", "? SchallTransportGroup", "SchallTankPlatoon >= 0.17.5"]

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 = "vehicles-military"

Or pick the appropriate subgroup instead. The list of subgroups are as below:

  • transport (the vanilla subgroup): Contains miscellanous items, e.g., spidertron-remote.
  • train-transport (another vanilla subgroup): Contains miscellanous items, e.g., rails, signals, stations.
  • vehicles-railway: All rail vehicles, e.g., train locomotives and wagons.
  • vehicles-civilian: Non-combat vehicles, e.g., vanilla car.
  • vehicles-military: Combat vehicles, e.g., tanks, Spidertrons.
  • vehicle-equipment: Most vehicle-only equipment, e.g, vehicle battery from Schall Tank Platoon. But excluding military and defense equipment.
  • vehicle-equipment-military: Vehicle-only military equipment, e.g., vehicle energy shields from Schall Tank Platoon. But excluding defense equipment.
  • vehicle-equipment-defense: Vehicle-only defense equipment, e.g., gun pods from Schall Gun Pod.

Advanced: Conditional assignment

You would want your mod to both work with and without “Schall Transport Group” mod installed, right?
Then you would need conditional assignment of subgroups, based on whether “Schall Transport Group” mod is present or not.

First declare a local variable that will temporarily store the subgroup name, which assigns to vanilla subgroup "transport".

local subgroup_vehmil = "transport"

Next, detect if “Schall Transport Group” mod is present. If yes, set the variable to the desired subgroup name.

if mods["SchallTransportGroup"] then
subgroup_vehmil = "vehicles-military"
end

Then use the variable subgroup_vehmil in your item prototype definition, like:

subgroup = subgroup_vehmil

Creating New Subgroups

You may also create new subgroups if you want. An example (taken from Schall Tank Platoon) as follows:

{
type = "item-subgroup",
name = "vehicles-military-1",
group = "transport",
order = "d-1",
},

An option in Schall Tank Platoon allows creating new subgroups for each tier of tanks. With some minor conditional statements, it turns the tab like the following picture:

So this mod does NOT limit you on what subgroups you should use, but merely provides a common framework for all vehicle 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

Group

  • 1 group:
    • transport
  • (2 changed, 6 new) subgroup:
    • transport (was under "logistics" group, now under "transport" group)
    • train-transport (was under "logistics" group, now under "transport" group)
    • vehicles-railway
    • vehicles-civilian
    • vehicles-military
    • vehicle-equipment
    • vehicle-equipment-military
    • vehicle-equipment-defense

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
transport a Vanilla Anything not vehicles nor equipment. Default for all items that were in vanilla transport subgroup.
train-transport a-t Vanilla >= 1.0.0 Anything not vehicles nor equipment, train-related. Default for all items that were in vanilla train-transport subgroup.
vehicles-railway b This mod Vehicles on rails. Locomotive, wagons.
water_transport2 b-2 Cargo Ships Vehicles on water ways. Behaves like trains, as water ways are rails over water.
vehicles-civilian c This mod Vehicles not intended for combat. Car.
hovercrafts c-2 Hovercrafts Amphibious vehicles. Hovercraft.
vehicles-military d This mod Vehicles for combat. Tank, Spidertron.
vehicles-military-1 d-1 Schall Tank Platoon Military vehicles of Tier MK1.
vehicles-military-2 d-2 Schall Tank Platoon Military vehicles of Tier MK2.
vehicles-military-3 d-3 Schall Alien Tech Military vehicles of Tier MK3.
vehicle-equipment j This mod Any equipment not military, defense equipment. Vehicle batteries, power sources.
vehicle-equipment-military m This mod >= 1.0.1 Not defense equipment, military-related. Vehicle shields.
water_equipment q-2 Cargo Ships Includes non-equipment items, e.g., port, signal buoys.
vehicle-equipment-defense r This mod Defense equipment. Gun pods.