Hello fellow Space Captains,
I have a small Mod for you. Using this you can replace NPC random block composed ships by those masterworks of people on the steam workshop.
The mod was actually very easily applied and judging by the already available global functions supplied by Avorion this mod may be obsolete in the near future.
How it works
The supplied config file describes 3 factions. Every faction in the game will be assigned one "style" of those and every new ship or station that spawns for that faction will use one of the supplied workshop designs for that. There are some categories already that ships can apply to, like "Defender" NPC ships will be Cruiser and "Attacker" NPCs will be BattleShip. If a faction config does not supply a version for a category, the default ship will be used. And if that also fails the block generator of Avorion will be used.
How to install
Simply extract the content of the supplied ZIP file to the directory of Avorion. Overwrite the files in the script folder when requested.
The default I supply you with works with a handy and small Steam Workshop Collection:
https://steamcommunity.com/sharedfiles/filedetails/?id=1524022688
How you can use your own collection or another will be explained.
How to install on a server
Pretty much the same except that I have no clue how to download Workshop files on a dedicated server other than manually uploading them ;)
You can basically put them anywhere on your server file system and change the config.lua accordingly. But I've found it to be convenient to test the faction client side first and then put everything on the server. Therefore use the Steam Standard structure and copy your steam workshop folder content in the same structure to the server:
steam/steamapps/workshop/content/445220/[ships here]
How to edit it
In the folder "mods/factionships" you will find a file called config.lua. This file contains the configuration for NPC factions and what workshop ships it should use. The default content is composed of 3 factions. If you add or remove a new faction section make sure to set the FactionCount property in the top of the file accordingly.
To get the right files and the Steam Workshop entries you can go through all the ships/stations you want to use in Steam and add entry ID to the config.
You can find the Workshop entry ID in the top of your steam window. The folder on your filesystem has the same name. Be careful to look whether the file in the folder is called plan.xml. I encountered files called design.xml.
Known Issues
- Adding a new faction mid-game will most likely end up mixing styles for existing factions. The faction styles are as of now applied by the faction index property.
- Some ship categories of pirates or bosses may not be reflected by the config files yet.
- turrets blueprints are not used yet.
Files modified
- plangenerator.lua
- shipgenerator.lua
- pirategenerator.lua
Permissions
Feel free to use and expand all files of this mod as it pleases you, as this already modifies Avorion files. I hope you can achieve fun stuff and will share it with the community :)
WorkShopShips_v1.0.zip