Author Topic: How to make a faction pack  (Read 198 times)

TESL4

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    172
    • View Profile
on: March 21, 2020, 01:37:46 AM
I am attempting to make a faction pack with the Neulance Armada ships I am currently making.  Unfortunately I am a complete noob when it comes to mods and creating them.  Would anyone be able to show a step by step approach or link one?  I would research and learn it myself, but after working 12 hr shifts on nights I don't have any mental fortitude to try and learn something new.  Any help would be appreciated.
« Last Edit: March 21, 2020, 01:42:01 AM by TESL4 »



SneakyTacts

  • Sr. Member
  • ****
  • Status:
    Offline
    Posts:
    259
    • View Profile
on: March 21, 2020, 04:31:05 AM
I also don’t know how to create one, but here’s what someone on Reddit said when it was in the beta branch:
“...create a new mod in the main menu - you'll get the option to make it a faction pack. Look at the folder and the files to see what to put where.”
Sounds fairly simple, if that’s the true process.



TESL4

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    172
    • View Profile
on: March 21, 2020, 05:02:16 AM
I'll give it a try.  I made the mod but couldn't figure out how to actually add ships and designate roles and things. 



deep

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    102
    • View Profile
on: March 21, 2020, 06:15:43 AM
There is a limit to the number of turrets for faction-packed ships.
I think it's probably the same as a random generator.
It seems to be 10 at most.
If the ship has a turret base, it is placed on the turret base.
However, the turret base edge is ignored.
If there is no turret base, it seems to be placed randomly.

The ship block is valid.
If the ship has a shield generator, it can be launched into the iron zone.
The energy of a ship looks infinite like NPC.

cheering ;D
Please use it as a sample.
https://steamcommunity.com/sharedfiles/filedetails/?id=2012662704



SneakyTacts

  • Sr. Member
  • ****
  • Status:
    Offline
    Posts:
    259
    • View Profile
on: March 21, 2020, 05:47:52 PM
I've just followed the directions I quoted, and at first glance, it seems confusing because of all the text. But the more I read, the more I realized that the code comments are all just very simple instructions. Thanks, Deep, for providing your pack as an example; looking between yours and my default files made it easier to understand. I'll now summarize how I understand each of the simple variables in the two files.

To locate Deep's faction pack after subscribing, go to this file location: C:\Program Files (x86)\Steam\steamapps\workshop\content\445220\2012662704
It's probably the same for you.

After creating and naming your new faction pack from the mods menu in Avorion, find it here: C:\Users\YOURNAME\AppData\Roaming\Avorion\mods

Start in the 'modinfo' LUA file. I use Microsoft's Visual Studio to open files like this.

Start from the top.
id - Steam determines this when it's uploaded to the workshop, as I understand it. Just be sure there aren't two folders with your faction pack name in your computer.
name - Deep simply made this the (misspelled) acronym of his pack ("FPSF")
title - The name on the workshop.
type = "factionpack", as opposed to "mod".
description - describe it briefly so people know it when they hover their mouse in the mod menu—that's my guess.
authors - just your steam name.
version - other mod makers use this value from other mods to define compatibility and incompatibility by versions.
dependencies - just read the example list they made. Deep didn't need to edit, and I doubt you will.
the last four - probably don't need to edit those. Read if you want.

You're done with 'modinfo'!
Now open the other file, 'factionpack'.
Here you will decide which ships to include, and organize them by type. Have a look at the different types of ships the game wants: "ships", carriers, freighters, miners, fighters, and all station types.
Read lines 10 and 11. They say to put all the .xml files of your chosen ships into the same folder that has the two files. Every ship you have made is saved in C:\Users\YOURNAME\AppData\Roaming\Avorion\ships, and it makes three files. Deep put all three files of each ship into the folder, which doesn't seem like a bad idea.
Here's how Deep wrote each list: {"awing.xml","awingr.xml","ywing.xml","xwing.xml"}
Spaces, tabs, and returns don't affect the list, but you need to follow the basic format of {"name.xml", "name2.xml"}

The minDist and maxDist must refer to the distances from the center that your ships will appear at.

Your faction pack becomes immediately load-able in the Avorion mod menu as soon as it's created. Just enable it. Remember, though, that I've never done this before. TLDR; the instructions in the two generated files are simple to understand. Subscribe to Deep's pack to see that it's not hard.



TESL4

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    172
    • View Profile
on: March 22, 2020, 01:25:19 AM
WOO! Thank you so much, both of you!  Tomorrow is my day off and I plan on using your instructions!  Thank you so much again!  I hope others will find this useful as well.



SneakyTacts

  • Sr. Member
  • ****
  • Status:
    Offline
    Posts:
    259
    • View Profile
on: March 22, 2020, 02:18:20 AM
WOO! Thank you so much, both of you!  Tomorrow is my day off and I plan on using your instructions!  Thank you so much again!  I hope others will find this useful as well.
You’re welcome! I really hope it works.



TESL4

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    172
    • View Profile
on: March 23, 2020, 03:04:54 AM
That was actually pretty easy.  I'm not sure its working though.  I couldn't find my ships used anywhere in the 320-150 range.  Not sure how to upload it to the workshop either to show it



deep

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    102
    • View Profile
on: March 23, 2020, 12:15:59 PM
For their tests, the range is "minDist = 50,"
maxDist = 450,.
The starting faction uses them.
If there is no error in LUA, it is a high probability.
About 60%.
Other than that, it is hard to find them. :-\


Misspelling is my passive skill. :'(



SneakyTacts

  • Sr. Member
  • ****
  • Status:
    Offline
    Posts:
    259
    • View Profile
on: March 23, 2020, 01:31:41 PM
That was actually pretty easy.  I'm not sure its working though.  I couldn't find my ships used anywhere in the 320-150 range.  Not sure how to upload it to the workshop either to show it

Do the minDist and maxDist variables have the “--“ dashes before them? Maybe you forgot to let them not be code comments. For now I think you should let the range go to 500 just so you can better check if they exist. Maybe try to find Deep’s ships to get an idea about where yours are.



deep

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    102
    • View Profile
on: March 23, 2020, 03:02:29 PM


A turret base of less than 10 is a formidable enemy.
Random turret placement is a formidable enemy.
Please be careful.
They destroy design. :-\
« Last Edit: March 23, 2020, 03:04:11 PM by deep »



TESL4

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    172
    • View Profile
on: March 24, 2020, 01:17:50 AM
I figured it out, it was a dumb mistake on my part lol. 

I feel like that ship in particular will have the most issues since most of its turret hardpoints are sloped, and from what I've read turrets don't get put on sloped hardpoints.  I'm so glad that you were able to find some of my ships though!  Idk why But I haven't been able to see any custom ships from ship packs in my universes at all.  Kinda annoying.