Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
New Terminals and New Boxes To Take There: Expanding the new Logistics system in Stormworks 1.0
By seinwave
Learn how to add new cargo terminals, types, and loads to the logistics system released in 1.0.
   
Award
Favorite
Favorited
Unfavorite
Intro
Stormworks 1.0 brought with it the highly-hyped-up logistics system, allowing players to pick up randomly-generated cargo loads and transport them to their destination dynamically. It does exactly what it says on the tin. While it's certain to come later, the devs haven't posted any documentation of this new expandable system (as of 9/17/2020).

However, the Default Cargo Container mission, with files found in the steamapps\common\Stormworks\rom\data\missions\ folder, actually gives us all the information we need to add new types of cargo to pick up and new places to take them.

All it takes is the built-in mission editor.

Please note that this guide was written five hours after the initial release of 1.0. Hopefully, all this will become deprecated once the devs expand on and document their logistics system.

Please take everything with a grain of salt. None of this has been extensively tested.

Please don't hesitate to leave a comment if you have a question, figure something new out, or notice a mistake


Adding new terminals
1.
Load a game, go to the escape menu, and click on the little flag to open the mission editor. Start a new playlist. Give it a name and save it.

Stormworks 1.0 adds a Lua button to the mission editor. You do not need to write or add any code to your mission to add terminals or new cargo types. The code in the "Default Cargo Containers" mission will pick up and fill any new terminals it detects with appropriate cargo.

New cargo terminals are needed to handle new types of cargo. The default terminals will only spawn and accept the big ISO containers. If you want to just add container-type loads, you can skip to the next section.

2.
New cargo terminals are added as Environment Mods. To add a cargo terminal at a location, add a new environment mod at that location by pressing the plus next to "Environment Mods".


Cargo terminals seem to overwrite each other. If you try to add, say, a new pallet terminal at the Sawyer Islands North Harbor, you'll overwrite the container terminal added there by the Default Cargo Containers mission. Be aware. If you don't want to overwrite terminals, only add new terminals at locations without an existing one.

3.

Cargo terminals use the new "Cargo Zone" button at the far right of the bottom bar. This is not the same as the normal zone button.

Cargo terminals need at least four Cargo Zones: One "cargo delivery" zone, one "cargo terminal marker" zone, and at least two "cargo spawn" zones. Place down four Cargo Zones.

4.

The type of cargo zone is set by clicking on a zone and typing into the "type" box in the window that pops up. In the above screen shot, you can see the cargo delivery zone has been selected. To set this zone as the delivery zone, you need to paste the following into the "Type" box of the zone:
type=cargo_delivery_zone
This'll be where cargo is counted as being 'dropped off' by the game, so make sure it's big and close to the ground.

5.

For any logistics to work, you'll need to mark one of the zones as the cargo terminal. Paste the following into the "Type" box of one of the cargo zones:
type=cargo_terminal,produces=pallet,consumes=pallet
This sets up a cargo terminal that will spawn cargo tagged as "pallet" and also accept cargo marked as "pallet". You can change "pallet" to anything, as long as you have cargo loads set up that use that type (see next section). The default terminals use "container", so if you want to pick up and drop off containers, use that.

There's probably a way to set the "produces" and "consumes" properties to a list instead of a single value so that you can accept and produce several types of cargo, but I haven't figured it out; if you do, let me know.

Be sure to type something into the "Marker Name" field and check the "Show on Map" box. The Marker Name field is used by the game to address packages to their destination. The Show On Map box just gives the player a nice marker so they know your terminal's there.

6.

You need at least two zones marked as "cargo spawn" zones.
The number of zones marked as spawn zones must always be an even number for every terminal, or the entire logistics system will crash!
. Basically, the game randomly picks a number between (number of spawn zones) and (number of spawn zones divided by 2) and spawns that number of cargo loads at each terminal; it doesn't seem to handle odd numbers well. If you get an error at line 158 in the console when starting a game, this is the reason.

Click on one of the zones you want as a cargo spawn zone and paste the following into the "Type" box:
type=cargo_spawn_location
Repeat the same for the remaining zones you want as cargo spawn zones. Make sure they're big enough to fit the loads you're trying to spawn there. Make sure they're above ground.

7.
If you used the "container" type in step 5, you're done! Save the mission, start a new game with your new mission (and the Default Cargo Container mission) enabled, and you should see your new terminal on the map.

If you used anything other than "container" for your produce or consume type in step 5, you need to add some new loads for your terminal to spawn. Go to the next section of this guide.
Adding new cargo loads
Adding new cargo loads requires you to have a vehicle you want to use as a load.

1.
You'll need to open the mission editor. If you made a mission in the previous part of the guide, you can keep using that one. Otherwise, start a new mission, name it, and save it.

2.

New cargo loads are added as "Locations". To add a new cargo load, click on the plus button next to the Locations heading and select "Ocean". Name your location something related to the cargo you want to add by clicking on the name and typing something in; this is important later, so make sure it's something memorable.

(note: I guess this means that somewhere out there, all the cargo loads are spawning once into the ocean and immediately sinking to the bottom. Weird.)

3.

Click on the new location you just added and edit it. Use the "Add Vehicle" button to add the vehicle you want to use as cargo to the location.

4.

Name the vehicle something using the "Marker Text" field. I don't know if this used anywhere, but it seems neater.

5.

Copy the following text into the "Tag" field:
type=cargo_package,cargo_type=pallet,theme=civilian,probability=0.75
You won't be able to see or scroll over the whole thing once copied. It should be there; you can verify by opening the playlist.xml file in your AppData\Roaming\Stormworks\data\missions\YourMissionName folder.

Dissecting this snippet:
type is what marks this as a potential cargo type for the logistics system, much like the cargo zones in the previous section.
cargo_type is the 'class' of cargo this cargo type is considered. As discussed previously, all the default terminals only use cargo_type=container, so if you're not adding custom terminals you need to include this.
theme is uh... the theme? I don't know what exactly this is used for, or if it's used at all; presumably it'd be used so that oil spawns at oil rigs, medical supplies at hospitals, etc. I use 'civilian' in all mine; the default containers also have theme=hospital,theme=oil, and theme=military (!!!).
probability is the probability. Not sure of what though; it could be the chance this container actually shows up if spawned, or just a weighting value. I haven't dissected the code enough. probability=0.75 works just fine.

6.
Save your mission.

If you used cargo_type=container, you should be good to go. Start a new game with your mission (and the Default Cargo Containers mission) enabled, and you should be able to see your new load at the default terminals.

If you used anything else as your cargo type, you'll need to add a new terminal that uses that type. See the first section of this guide if you haven't already.
10 Comments
seinwave  [author] Oct 5, 2020 @ 6:29am 
Yeah I re-read your comments and realized what you meant; that you can't get those places spawning cargo in your own mission, not that you needed a base to modify.

I ran into the same issues trying to make a second cargo mission. It seems like sometimes perfectly-okay setups just won't spawn cargo unless some set of hidden conditions are met. I had to restart making missions a couple times to get them to work again.

Also yeah they definitely used the an XML editor or something. That might be something worth trying: try pasting the "tags" for each zone and object into the playlist.xml file for the mission, instead of trying to paste them in the editor. I have a sneaking suspicion that the editor can't handle long pastes properly, even though they seem to work fine

GrumpyOldMan Oct 5, 2020 @ 5:39am 
Also was taking a look at the stock cargo mission, makes you wonder how they got it set up like that, with the zones all exactly of the same size. The built in editor definitely didn't play any part in this, heh. Can't even copy paste stuff with it.
GrumpyOldMan Oct 5, 2020 @ 5:36am 
Thanks for the offer.
I've already reduced the amount of custom terminals to the three working ones.
Got the dean hall quarry working, still no clue why.
Sometimes the spawn zones need to touch the ground to get it working, sometimes you'd need to lift them above ground so the bounding box is still visible.
Seems erratic at most, especially without any error messages to help debugging.

Curious how far the developers will take that system, if at all.
seinwave  [author] Oct 4, 2020 @ 8:16am 
@GrumpyOldMan I've noticed some trouble in getting custom cargo set up in the latest patches. I've got an example custom cargo mission that adds cargo to Holt Town and the quarry that seems to still be working on my side, try running that? You can probably edit it and make the changes you're looking for
GrumpyOldMan Oct 3, 2020 @ 9:37pm 
On a sidenote, there are sometimes custom cargo pieces with Holt Town as destination, so the cargo terminal apparently is registered in the system, however it won't spawn any cargo.
GrumpyOldMan Oct 3, 2020 @ 9:34pm 
This 1.0 cargo system seems to be very odd with barebones functionality.

I've been goofing around with the 1.0 cargo system for a few days now, I can't figure out why on certain places it seems to be impossible to get the cargo zones going.
Holt Town, Harrison Airbase and Dean Hall Quarry all won't spawn any cargo.

Tried every combination I could think of, default container cargo, custom cargo, making sure zone count is even, no dice.

Also been as exact as possible, to the letter. Other cargo locations set up in the same mission are spawning custom cargo just fine.

Any clues?
whitew01f Sep 21, 2020 @ 11:33pm 
okay mission making has gotten easier with this guide. Just need to figure out how to replace cargo terminal with hospital and container with NPC's and maybe vessels. oh, and thanks for the measurements and nice formatting.
seinwave  [author] Sep 21, 2020 @ 7:11am 
@KBB, I believe it's not ISO or AISO. It's 11x11x29. Someone else has done some work to figure this out, you can check it out at https://steamcommunity.com/sharedfiles/filedetails/?id=2234632281
SpaceMechanic[NeWB] Sep 21, 2020 @ 5:21am 
Thank you for this wonderful guide! 10/10!
KBB Sep 20, 2020 @ 10:45pm 
What are the dimensions on the containers? Really hoping it’s close in size to Nacon ISO/AISO