Space Engineers

Space Engineers

How to add your own AI/NPC cargo ships - Tutorial Companion
34 Comments
InventorAndCreator Dec 17, 2021 @ 4:12pm 
Could You Update This?
Krathewarrior Jul 28, 2020 @ 10:10am 
When I loaded up a game with my mod F11 said it had a critical error any help?:steamsad:
Krathewarrior Jul 28, 2020 @ 8:26am 
I'm thinking making a mod but how out of date is your tutorial for this mod?
en3he Jan 18, 2020 @ 6:18am 
very well done :crimson:
Presumptuous Spacemans Jan 11, 2020 @ 2:52pm 
Thats epic
Splitsie  [author] Jan 11, 2020 @ 2:17pm 
It's still mostly correct, I will be working with Lucas on a new tutorial soon as I plan to incorporate the use of his new RivalAI project, but starting with this and then breaking down any of my Assertive mods or Lucas's mods should give you a good start on where to go
Zodarkmal Jan 11, 2020 @ 2:16pm 
@Splitsie @Meridius_IX / Lucas Is this still valid? if not a update would be fantastic! i have a whole library i would love to add to a custom world im making.
Presumptuous Spacemans Mar 9, 2019 @ 11:20pm 
does this still work? because its saying theres an error spawning the spawn group.
Trogdorfubar Oct 30, 2018 @ 10:36am 
@Meridius_IX / Lucas Thanks I'll take a look at that and try to figure this out on my own with out badgering people too much.
Meridius_IX / Lucas  [author] Oct 30, 2018 @ 6:00am 
@Trogdorfubar - Those are the main differences (I think). Keep in mind that the (Inst-1) and (Atmo) are the old spawner tags. While they'll still work with the new spawner, the new tags have all sorts of excellent features. Once you get a bit more comfortable with working in SpawnGroup files, I suggest you check it out - a link to the Admin and Modders guide can be found on the spawner workshop page
Meridius_IX / Lucas  [author] Oct 30, 2018 @ 6:00am 
@Trogdorfubar - It's fairly similar to how the other encounters are setup. I'll give you some quick steps (sorry if not too details, just woke up):

- Station must have cockpit/control seat (used for orientation)
- Station must be static when saved as prefab (if already stuck in ground, you're good to go)
- In spawngroups file, instead of using the (Atmo) tag in the SubtypeId, you'll use (Inst-1), (Inst-2), or (Inst-3) - for small, med, large.
- In the prefab position (X,Y,Z), you'll have to set Y manually. This takes some experimentation to get right, otherwise the station might spawn too deep or too shallow. The Encounters Setup mod has some commands that let you spawn a prefab nearby and set the Y directly - it's really good for troubleshooting this.
Trogdorfubar Oct 29, 2018 @ 11:12pm 
First I want to thank you for this. Myself and two friends are building modded factions useing this as the starting point. Our end goal is useing the factions along with grind to learn to add a form of progression to the game. We are planning to also build some ground facilities and space stations as well. I figure a space station would work fine, just spawn it as a space ship/cargo ship without a speed and low probablity of spawn. Ground stations I have no idea where to start.

Since you, Splitsie, have created that assertive installation mod and Meridius created the framework I was hoping one of you could point me in the right direction to figure this out.
Splitsie  [author] Oct 28, 2018 @ 9:28pm 
If there's an immediate crash there's likely something wrong in what's written into the mod ie. missing formatting (that's what I usually find has caused my problems, at least once I've torn out half my hair trying to work it out) :P
RabidDuckSauce Oct 28, 2018 @ 6:07pm 
So I tried this but whenever I try to load into a game with the mod the entire game crashes right away. Am I doing something wrong?
Jexsam Sep 16, 2018 @ 8:35pm 
Cool! I'm fine just preloading it with a fixed set of loot. Mostly I was trying to find out if I could fudge it by just not filling the containers to capacity to make sure it could still fly. Since these ships will only fly in straight lines and aren't intended to be workhorses, it's nice to know I only have to make sure it can carry whatever loot I want in it. Sure, if a player downs it and tries to load it full of iron, it'll drop like a stone, but part of the fun of commandeering a ship is customizing it to suit your needs anyway. ;D
Meridius_IX / Lucas  [author] Sep 16, 2018 @ 6:33pm 
Howdy, I've got some answers for you:

1. You're correct in your assumption; as long as you include the mods as as dependancies in your mod, you'll be all set!

2 & 3. Random cargo is possible, but is a weird one to work with, the system is works on is not the most intuitive... It involves creating a ContainerTypes.sbc file with details of the random loot that can be generated. Then you need to take the SubtypeId of the ContainerType definition you've created and manually edit it into a field on the prefab (I believe you also need to create the field as well - its part of whatever container you choose to add this to). My advice would be to prefill it with whatever loot you'd like it to have, and that way you can test the weight and know for sure it'll work as well.
Jexsam Sep 16, 2018 @ 6:17pm 
So I'm starting to build a cargo ship or two to throw into a private game I'm setting up, and I had two questions:

1. If I use mods while building the ships, then so long as those mods remain installed, the ships should spawn properly, correct? I feel like this is obvious but I want to be absolutely sure, so when publish it for them to download I can list dependencies so anyone else who finds it knows what they need.

2. The video says use Realistic weight settings to build ships. I assume this is because loot on board these cargo ships isn't random, but instead is preset for each cargo ship. So basically, I'd load it with loot when I build it, save the blueprint, and it'll spawn with that loot when I load it up into the mod. Is this correct?

And a third general question: when loading a cargo ship with items to test how much it'll lift, what's a good material to use? I've been using cobalt ore but I'm unsure if there's a better material to test this sort of thing with.
ZMPL69 Aug 22, 2018 @ 2:15am 
Oke. Super thanks Meridius_IX for all the help and info :D
Meridius_IX / Lucas  [author] Aug 21, 2018 @ 11:42am 
You'd only need to ensure your custom NPC has an antenna that's named using a name specified in the PirateAntennas.sbc file :)
ZMPL69 Aug 21, 2018 @ 11:38am 
Thanks a lot!! :D
Just 1 little question. (sorry sorry)
Do I need to configure the NPC ships who can spawn drones in the XML file or do I need to just rename one antenna on the ship?
Meridius_IX / Lucas  [author] Aug 21, 2018 @ 8:35am 
Howdy! I can answer a few of these:

1. Wheeled Vehicles: While you could technically spawn them with this method (they'd have to fall out of the sky and parachute to deploy safely), getting them to traverse the terrain is a whole other story. I don't know of any scripts that would allow them to travel safely across whatever terrain they land on.

2. Yep, these ships can also use antenna spawns if configured to do so!

3. If you want the ships to spawn in space, simply remove the <IsPirate> tags. However, if you also have the '(Atmo)' tag included in the SpawnGroup SubtypeId field, then the ship will be able to appear in atmosphere and in space (which may be fine if the ship is capable of flight in both environments)

4. The server would need to have the mod with your custom NPC loaded for it to appear.

Hope this helps!
ZMPL69 Aug 21, 2018 @ 8:24am 
Hello :D
This tutorial is really usefull and the video is really great!! :D
But!! Newby I am, I've some questions. ^_^
1) Can I also use this to spawn wheeled vehicles on planets?
2) Is it possible to let the spawned NPC ships, spawn 2 or 3 drones? Like with antenna's or something... ? xD
3) Because you need to use the <IsPirate>true</IsPirate> tags for atmospheric ships only. What tag do you need to use for Space only ships?
4) Can I use my edited NPC on a owned server with this mod? :O
VOILA !!
I'm really sorry for al those questions. I just can't find a good answer elsewhere. :/
AND I'm sorry if my english isn't really good xD (it's no my native language)
TheMidnightCrow Aug 6, 2018 @ 4:49pm 
ok thanks
Splitsie  [author] Aug 6, 2018 @ 4:39pm 
I haven't heard about it being broken, but I have noticed some behaviours around that sort of thing with mods being weird at times since the last update. I guess for now you'd just be stuck with doing it manually if it is broken :/

I'm not sure of anything in particular you'd need to troubleshoot in order to check if it's working. I'd suggest heading over to the Modular Encounters Collection discord server as someone (including Lucas) may be better able to point you in the right direction
TheMidnightCrow Aug 6, 2018 @ 12:13am 
I can't get /FillGrids to work, is the mod broke or and i doing it wrong?
Puppeteer Aug 3, 2018 @ 1:07am 
Ok, good to know:steamhappy:
Splitsie  [author] Aug 2, 2018 @ 5:25am 
The stations are pretty similar to this, only needing to set their elevation conditions. It's been a while since I toyed with that, but I'm working on designs for my own base pack. Maybe when I've finished it I'll do a video showing them off and how to set things up :)
Puppeteer Aug 2, 2018 @ 3:51am 
Do you think you could make one for stations on planets as well as custom factions?
Meridius_IX / Lucas  [author] Mar 17, 2018 @ 6:43am 
Dinkledonklebinglebangle Mar 17, 2018 @ 5:54am 
what link is it to the mod for /FillGrids?
Splitsie  [author] Jan 16, 2018 @ 8:18pm 
Good point and done :)
superhappyalien Jan 16, 2018 @ 6:06pm 
Good idea but You Should Rename this how to make Ai / NPC cargoships.
Splitsie  [author] Jan 11, 2018 @ 9:01pm 
At the moment, it'll be out tomorrow. I'm going to be away so I needed to get everything set up early :)
Ulfsark Jan 11, 2018 @ 8:42pm 
video unavailable...