Author Topic: Need help creating a new hull. (GA)  (Read 983 times)

Trickey

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Need help creating a new hull. (GA)
« on: March 16, 2015, 02:25:47 PM »
On the off-chance that people still patrol this forum, I - having picked up both SR and SR2 mere weeks ago - have decided to post here for help. In the interest of taking a step towards a, perhaps, more in-depth economy mod (or to simply over-complicate/simplify my game) I have decided to create a hull that, while not totally dissimilar to the Hauler, will boast a far larger innate capacity while lacking one or two more system-space.

This said, I don't want to simply over-right the Hauler as I do use it as it is. I intend this new ship to be a 'massive' mobile refinery to go along with my miners and/or He3 harvest drones. Unfortunately, I haven't the foggiest on how to create an entirely new hull - merely how to edit an existing one (and that's shoddy, at best.)

XTRMNTR2K

  • Modder Extraordinaire
  • Delusional
  • ****
  • Posts: 1564
  • Karma: +178/-2
  • I aim to misbehave.
    • View Profile
Re: Need help creating a new hull. (GA)
« Reply #1 on: March 16, 2015, 04:43:14 PM »
Creating a new hull - or any subsystem, for that matter - is actually pretty straightforward.

I'll give you a quick rundown, assuming you are building upon Galactic Armory 1.9.4.

The subsystem files are located in x:\yourgamesdirectory\Star Ruler\Mods\galactic-armory-1.9.4\Game Data\Sub Systems. Hulls.txt contains, as the name implies, all the hulls present in the mod. If you open the file in any text editor, such as Notepad++, and scroll down you will see a subsystem entry called HaulerHull.

The first few lines look like this:

Code: [Select]
System: HaulerHull
Name: #SS_HAULERHULL_NAME
Description: #SS_HAULERHULL_DESC
Appearance: HaulerHull

The first line defines the name used internally for this subsystem. This is *not* the name shown inside the game, though!
The second and third lines contain the name and description for the subsystem as it appears in-game. Or rather, it contains a reference to the name and description, which are located in the mod's Locales/english.txt. If you add a new subsystem, you will also need to create name and description entries in that file, otherwise they won't show up in-game.

The fourth line tells the game which subsystem icon is used. These first have to be defined in materials/subsys_icons.txt, though.


If I understand you correctly, you want to create a new hull that has more storage but less internal space, right? In that case you need to have a look at these lines:

Code: [Select]
Size: (Object.Size * min(((10 + floor(Object.Scale / 100)) / 15), (13 / 15))) + vExtra
and

Code: [Select]
vCargoStore: Size * 100 * (4 - decay(pow(LEVEL_GAIN_CURVE, Level), 25) - decay(pow(LEVEL_GAIN_CURVE, Level), 125) - decay(pow(LEVEL_GAIN_CURVE, Level), 625))

The current Size gives you a minimum internal space of 10, with an increase of 1 per 100 units of scale (up to a maximum of 13). Let's assume you want it to be a minimum of 7 instead, with an increase per 100 units of scale up to a maximum of 10, in which case it would look like this:

Code: [Select]
Size: (Object.Size * min(((7 + floor(Object.Scale / 100)) / 15), (10 / 15))) + vExtra
As for the storage space, you could either tweak the numbers in the - slightly complicated-looking - formula or even come up with a (more straightforward?) formula yourself. Feel free to experiment! :)


(Oh, and if you want to add, say, Helium-3 storage to a subsystem, you'll need to add a provision for H3Storage; have a look at HydrogenStorage in subsystems/storage.txt and you'll see how that works.)


I hope that helps! If there's anything else you need, just ask. :D

Trickey

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Need help creating a new hull. (GA)
« Reply #2 on: March 16, 2015, 07:43:55 PM »
Aye, I see what you mean now. Thank you. That will certainly help most of my future endeavors, too. I would, however, like to ask you -- if possible -- where one can pick up notepad ++; currently i'm jury-rigging it through a combination of regular notepad and Open Office where applicable.

All the same, I thank you for your time.  :)

XTRMNTR2K

  • Modder Extraordinaire
  • Delusional
  • ****
  • Posts: 1564
  • Karma: +178/-2
  • I aim to misbehave.
    • View Profile
Re: Need help creating a new hull. (GA)
« Reply #3 on: March 17, 2015, 06:15:59 AM »
Aye, I see what you mean now. Thank you. That will certainly help most of my future endeavors, too. I would, however, like to ask you -- if possible -- where one can pick up notepad ++; currently i'm jury-rigging it through a combination of regular notepad and Open Office where applicable.

You can get Notepad++ here: http://notepad-plus-plus.org/

If you want to work not just with data files but with scripts as well, you can make your life a little bit easier by downloading an .xml file to help highlight things in angelscript. You can get one such set of files here; I highly recommend a manual installation and not using the .exe file, though.
Importing the highlight filter into notepad++ is done via menu Language > Define your language... > Import... , where you simply select one of the previously extracted .xml files. :)

Quote
All the same, I thank you for your time.  :)

No prob, you're welcome. :D