Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Help with adding a ship  (Read 5508 times)

Cruis.In

  • Commander
  • ***
  • Posts: 122
    • View Profile
Help with adding a ship
« on: April 14, 2019, 12:04:07 AM »

Hey everyone, I followed the steps on the wiki and here on the board to first create a ship and then add it to the markets/fleets.

What I am doing is creating a mod, so I can turn on/off this. Is this possible? I created the ship with the shipeditor found here  http://fractalsoftworks.com/forum/index.php?topic=375.0


I followed the steps here: http://fractalsoftworks.com/forum/index.php?topic=12970.0

I created a mod in the mod folder with necessary json.
at first I couldn't get star sector to start, I had a null error. I went back over and realized I had the .ship file pointing to a wrong location for the ship graphic. I changed that and voila, the game starts good after enabling my mod.

I enable the mod and load a saved game, it loads fine, wait a month but don't see the ship turning up. Not waiting long enough? I am not sure I did the edit in the faction right. I edited a hegmony.faction from ships and weapons mod.

where defiant variant is the variant i created.

Code
{
    "hullFrequency":{
        "hulls":{
            "Defiant_variant":0,
        },
    },
    "knownShips":{
        "hulls":[
            "Defiant_variant",
        ],
    },
    "knownFighters":{
        "fighters":[
        ],
    },
    "knownWeapons":{
        "weapons":[
        ],
    },
},
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: Help with adding a ship
« Reply #1 on: April 14, 2019, 12:11:12 AM »

You also need entries in default_ship_roles.json, putting the ship variant(s) in given fleet roles.
Logged

Cruis.In

  • Commander
  • ***
  • Posts: 122
    • View Profile
Re: Help with adding a ship
« Reply #2 on: April 14, 2019, 12:37:50 AM »

ok, I looked in the default roles json and it seems he put that code in the .faction file. Meaning this stuff


Code
},
"combatSmall":{
    "pigeon_attack":5,

my other question now is too, I looked at the ship in game, under variants and I see it fine, but the ship just has hardpoints so to speak, it isn't fit. So if a the faction buys this ship, or I buy it on the market it will come empty? looking at other variant ships they all have a default weapons loadout. I didn't see how to give my ships a specific weapons load out in the editor. Only to put on the types of hardpoints, whether ballistic, energy missile etc.

Logged

King Alfonzo

  • Admiral
  • *****
  • Posts: 683
  • -- D O C T O R --
    • View Profile
Re: Help with adding a ship
« Reply #3 on: April 14, 2019, 01:36:19 AM »

That has to do with the editor. From what you're telling me, you're trying to attach weapons to it using the part of the ditor that makes the ship , rather than the part of the editor that deals with variants. The ship editor tells you what kind of weapon your sship can mount, so if you hover your mouse over the weapon slot and press 't', a little info box will pop up and you can change the type of weapon you can mount. TO make a variant file that will tell the game to put weapons and stuff on it, press '2', and it should open a second editor where you can make a variant file, in which you can add capacities, vents, weapons and hullmods. Kind of like a refit screen, if you will. This is the file that the game reads from default_ship_roles to sort out how to outfit the ship.

Now, when you buy a ship, you don't buy weapons with it - just the ship. This is universal for all the ships ingame. There can be some 'built-in' weapons that are attached regardless of variant. Just press "1" in the editor, open up your ship file, hover over a weapon and press t. Then, change the weapon type to BUILT_IN. Then, press 'u', and you should be able to stick a weapon into that slot.

Hope this helps.

prav

  • Captain
  • ****
  • Posts: 388
    • View Profile
Re: Help with adding a ship
« Reply #4 on: April 14, 2019, 02:54:27 AM »

you've got hull frequency at 0, multiplying your spawn chance by zero

beyond that i think you're mixing up base hulls, .ship, which define the basic hull, and variant fits, .variant, which define loadouts for a specific hull

Defiant should be your base ship id that gets added to .faction files, while Defiant_variant is a variant for it, which is what goes in the default_ship_roles spawntable.

additionally try installing the console mod and using "spawnfleet hegemony 150" a few times, which spawns a standard hegemony fleet of fairly large size. saves on a lot of waiting

oh and start using a prefix for your stuff
Logged

Cruis.In

  • Commander
  • ***
  • Posts: 122
    • View Profile
Re: Help with adding a ship
« Reply #5 on: April 14, 2019, 12:59:08 PM »

That has to do with the editor. From what you're telling me, you're trying to attach weapons to it using the part of the ditor that makes the ship , rather than the part of the editor that deals with variants. The ship editor tells you what kind of weapon your sship can mount, so if you hover your mouse over the weapon slot and press 't', a little info box will pop up and you can change the type of weapon you can mount. TO make a variant file that will tell the game to put weapons and stuff on it, press '2', and it should open a second editor where you can make a variant file, in which you can add capacities, vents, weapons and hullmods. Kind of like a refit screen, if you will. This is the file that the game reads from default_ship_roles to sort out how to outfit the ship.

Now, when you buy a ship, you don't buy weapons with it - just the ship. This is universal for all the ships ingame. There can be some 'built-in' weapons that are attached regardless of variant. Just press "1" in the editor, open up your ship file, hover over a weapon and press t. Then, change the weapon type to BUILT_IN. Then, press 'u', and you should be able to stick a weapon into that slot.

Hope this helps.


ah I see, I was using the variant editor mode, but not before I'd loaded the ship in data mode, so when I switched there was no options to click to add the weapons.

I've also seen in variant mode I have 0/0 OP. But I put in OP in the ship data csv.


prav: gonna try this now, but the thread I quoted said the game checks for variants in the .factions file. (edit he changed it today)


ok now I put this code
Code
"shipRoles":{
"combatMedium":{
"Defiant_variant":0.3;
},
},

in my .faction file for my mod, but it still spawns way too many in  fleet of 50 strength. I mean 0.3 is the frequency why still so high?
« Last Edit: April 14, 2019, 03:56:52 PM by Cruis.In »
Logged

Cruis.In

  • Commander
  • ***
  • Posts: 122
    • View Profile
Re: Help with adding a ship
« Reply #6 on: April 14, 2019, 02:40:15 PM »

Ok I've repeated all the steps above to add a weapon. I created the .wpn file and the .csv file with stats for the two weapons I am creating and placed in appropriate folders. the editor even has a feature to load custom mod, so I point it to my mod dir, and then I can add the weapons I've created to my variant now as well.

Now that is done, I am getting the same error I had when I was pointing my .ship to the wrong directory for the graphic of the ship.  A null error. But I don't see in the editor where to point the .wpn file to the graphic for the weapon. So I am stumped. When editing the .ship file details you can point to the folder containing the ship graphic.


and lastly, since it's working now, I've got the spawn freq at 15 and about 2-3 ships spawn in the fleet when I create it. How can I be sure the ship is added to the market though? Or once they are spawning it means it will be built in market eventually?
« Last Edit: April 14, 2019, 02:50:04 PM by Cruis.In »
Logged