Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 317 318 [319] 320 321 ... 706

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1700139 times)

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4770 on: August 08, 2019, 01:36:19 PM »

Not sure if this counts as a modding question, but is it possible to unlock the maximum amount of skills an officer has in the files somewhere? I've already increased the max level, but it seems they can't get more then the UI can hold. Don't mind if it clips trough the window or anything, I just want OP officers ^^

I'm not 100% sure if it just limits the skills it shows - you might still be able to level them up and add the skills, they just might not show in the officer list. Either way, though, there's no other setting to tweak, beyond the one you've already found. You *could* write some code to give them all the skills, but that's considerably more work.

Is there a simple way to change a faction's default station variant while still using the vanilla station?

Hmm, I don't think so. Might be some creative workaround, but all that comes to mind right now is a new mostly-copy-paste industries.csv entry.

Spoiler
Roughly, you need:
1) the sprite
2) a .ship file, which defines the drone's hull - engine locations, weapon locations, bounds, etc
3) a .variant file, which defines a specific loadout for the drone - i.e. the actual weapons it uses
4) a .system file, which defines the system you'll be assigning to the ship that spawns the drone


... actually, what exactly do you mean by "drone"? A ship system that launches drones, or a drone fighter wing, like the Mining Drones or the Borer Drones?

They were called drones on the files I inspected, but yeah, thats what I mean, like the Talon Interceptor Wing. Sorry I didnt make it clear enough.

Edit (Update more like): Iv been messing with the S&W editor and I have a few questions as to the usage.
I found that if you set it to "wing" edit mode, it lets you edit the CSV data of the wing fighter.

The data shown here is different from the one stored in ship_data.cvs.
Here is the code I got in ship_data.cvs, Its literally a Dassault-Mikoyan cvs with a few small changes (to see if it works, then do the actual changes once I see that it all loads)
Code
Standard Mech,INDM,,Here goes Tech/manu,,,75,25,300,,50,,,300,450,450,240,250,5,NONE,,0,0,0,,,0,0,,,,,,,,,,,,,,,,0,,,
I believe I understand how this works, both CVS(es) use the ID to call upon each other when loading, but there is one tiny thing I dont understand, when im in wing mode, I cannot edit the bounds, infact, I cannot even load an image...

My guess is that I must create the CVS, then a hull and merge both manually into one single file, correct?

On a side note, I found https://fractalsoftworks.com/forum/index.php?topic=13279.msg223716#msg223716, which I will look into when I have to edit the Jar, im guessing ill need it to actually spawn the wings into the game world; so it will come in handy.

On a side side note, this post might get a bit long, as I find stuff out and try new stuff I like to post about it; because theres nothing worse than trying to help someone and have them reply "oh well actually I already figured that out" or "Oh but I changed the method to this way so this is invalid"
[close]

I can't really speak to using the editor - not very familiar with it.

What you need:

A .ship file, with the basic data for the ship that's *not* its stats (i.e. we're defining bounds, engine glows, weapon slots, etc)
A ship_data.csv entry for the ship, with its stats (speed, OP, flux, etc)
A .variant file for the ship, which defines its loadout - weapons, etc
A wing_data.csv entry for the fighter wing, defining its parameters - number of fighters, fighter variant, etc

At that point, you should be able to run the game in devMode (data/config/settings.json; set devMode to true), press "Edit Variants" from the main menu, scroll down to any carrier, and if you click on one of its fighter bays, your fighter should show up there as an option to install. (Unless it has tags that prevent it from showing up there; make sure you copy something "normal" for the wing_data.csv row; i.e. a Talon or something.)
Logged

Alemismun

  • Ensign
  • *
  • Posts: 26
  • Im just some weeb
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4771 on: August 09, 2019, 05:18:53 AM »

Spoiler
Not sure if this counts as a modding question, but is it possible to unlock the maximum amount of skills an officer has in the files somewhere? I've already increased the max level, but it seems they can't get more then the UI can hold. Don't mind if it clips trough the window or anything, I just want OP officers ^^

I'm not 100% sure if it just limits the skills it shows - you might still be able to level them up and add the skills, they just might not show in the officer list. Either way, though, there's no other setting to tweak, beyond the one you've already found. You *could* write some code to give them all the skills, but that's considerably more work.

Is there a simple way to change a faction's default station variant while still using the vanilla station?

Hmm, I don't think so. Might be some creative workaround, but all that comes to mind right now is a new mostly-copy-paste industries.csv entry.

Spoiler
Roughly, you need:
1) the sprite
2) a .ship file, which defines the drone's hull - engine locations, weapon locations, bounds, etc
3) a .variant file, which defines a specific loadout for the drone - i.e. the actual weapons it uses
4) a .system file, which defines the system you'll be assigning to the ship that spawns the drone


... actually, what exactly do you mean by "drone"? A ship system that launches drones, or a drone fighter wing, like the Mining Drones or the Borer Drones?

They were called drones on the files I inspected, but yeah, thats what I mean, like the Talon Interceptor Wing. Sorry I didnt make it clear enough.

Edit (Update more like): Iv been messing with the S&W editor and I have a few questions as to the usage.
I found that if you set it to "wing" edit mode, it lets you edit the CSV data of the wing fighter.

The data shown here is different from the one stored in ship_data.cvs.
Here is the code I got in ship_data.cvs, Its literally a Dassault-Mikoyan cvs with a few small changes (to see if it works, then do the actual changes once I see that it all loads)
Code
Standard Mech,INDM,,Here goes Tech/manu,,,75,25,300,,50,,,300,450,450,240,250,5,NONE,,0,0,0,,,0,0,,,,,,,,,,,,,,,,0,,,
I believe I understand how this works, both CVS(es) use the ID to call upon each other when loading, but there is one tiny thing I dont understand, when im in wing mode, I cannot edit the bounds, infact, I cannot even load an image...

My guess is that I must create the CVS, then a hull and merge both manually into one single file, correct?

On a side note, I found https://fractalsoftworks.com/forum/index.php?topic=13279.msg223716#msg223716, which I will look into when I have to edit the Jar, im guessing ill need it to actually spawn the wings into the game world; so it will come in handy.

On a side side note, this post might get a bit long, as I find stuff out and try new stuff I like to post about it; because theres nothing worse than trying to help someone and have them reply "oh well actually I already figured that out" or "Oh but I changed the method to this way so this is invalid"
[close]

I can't really speak to using the editor - not very familiar with it.

What you need:

A .ship file, with the basic data for the ship that's *not* its stats (i.e. we're defining bounds, engine glows, weapon slots, etc)
A ship_data.csv entry for the ship, with its stats (speed, OP, flux, etc)
A .variant file for the ship, which defines its loadout - weapons, etc
A wing_data.csv entry for the fighter wing, defining its parameters - number of fighters, fighter variant, etc

At that point, you should be able to run the game in devMode (data/config/settings.json; set devMode to true), press "Edit Variants" from the main menu, scroll down to any carrier, and if you click on one of its fighter bays, your fighter should show up there as an option to install. (Unless it has tags that prevent it from showing up there; make sure you copy something "normal" for the wing_data.csv row; i.e. a Talon or something.)
[close]

How do you make ship files? Given that you dont use the ship editor, I assume you just calculate it mathematically and then write it down on the file itself? I just wanna know since I was able to do most but not all of the work with the ship editor and I need to finish it via another method, the code is in the spoiler-folder below (in case you wanted to see it), I was not able to add engines or built-in weapon slots.
Spoiler
Code
{
  "bounds": [
    -15.5,
    -22,
    -18.5,
    -11,
    -18.5,
    11,
    -15.5,
    22,
    17,
    19.5,
    10,
    9,
    10,
    -9,
    17,
    -19.5
  ],
  "center": [
    22,
    18.5
  ],
  "collisionRadius": 29.5,
  "coversColor": "\r",
  "engineSlots": [],
  "height": 37,
  "hullId": "IND_JunkMech",
  "hullName": "Junk Mech",
  "hullSize": "FIGHTER",
  "shieldCenter": [
    0,
    0
  ],
  "shieldRadius": 33,
  "spriteName": "graphics/ships/IND_JunkMech.png",
  "style": "LOW_TECH",
  "viewOffset": 0,
  "weaponSlots": [],
  "width": 44
}
[close]

IF it is based on the actual pixel location (as I assume, though that 29.5 in the col radius scares me), ill have a version were I add the weapon and engine slots manually in the zip file at the end of this post.
(Note, I got no idea what "contrailSize" dictates, I can more or less imagine but its the details that im lacking.)
Turns out im stupid and I can use the editor to get the position so I can manually add a location to the weapons, oops.

A pair of sidenotes:
To anyone reading this, given that it is a public forum and you can see this, install Libre Office, its fantastic for CSV files and it saves the headache of having to upload stuff to google sheets.
Also, this post is a bit hard to read, mainly because it is written in real-time as I do stuff, so I make sure to document everything as it happens.

As I edit the wing_data.csv file, I come across the following questions:
1. What does "role(number)" mean? (Such as: Fighter2, Bomber6)? Is it some form of behavioural designation?
2. How does rarity work? It seems only a few fighters have a spawnrate set to them, yet they all spawn.
3. Does a tier do anything? Like locking it out of specific low-level enemies?
4. What about "attackPositionOffset"? I assume it is the angle at which the choice to fight (such as shooting missiles sideways??)
5. What about "refit"? I assume this affects the damage done to the fleet if this wing is added to a ship mid-flight?

As far as I can tell, all I need is the files you mentioned, yet when I try to run it I get:
Code
227952 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NumberFormatException: For input string: "
"
java.lang.NumberFormatException: For input string: "
"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.fs.starfarer.loading.ShipHullSpecLoader.o00000(Unknown Source)
at com.fs.starfarer.loading.ShipHullSpecLoader.?00000(Unknown Source)
at com.fs.starfarer.loading.SpecStore.?O0000(Unknown Source)
at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

From what I can tell, this does not appear to originate from my mod...?

EDIT: Forgot the zip lol
https://filebin.net/c8714tkahxyatcfu

Oh and also, given that you are an admin I thought id tell you this, the IP logger on the forum seems to be getting my IP wrong, not sure why.
« Last Edit: August 09, 2019, 05:21:58 AM by Alemismun »
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4772 on: August 09, 2019, 05:45:39 AM »

Your wing_data.csv has a bunch of garbage in it (column AC in spreadsheet editor)
e.g.
Code: csv
id,variant,tags,tier,rarity,fleet pts,op cost,formation,range,attackRunRange,attackPositionOffset,num,role,role desc,refit,base value,,,,,,,,,,,,,number
IND_JunkMech,IND_JunkMech_variant,"fighter4, fighter, low, lowtech_bp",0,,3,2,V,4000,450,,4,FIGHTER,Fighter,5,1500,,,,,,,,,,,,,1
,,,,,,,,,,,,,,,,,,,,,,,,,,,,2
,,,,,,,,,,,,,,,,,,,,,,,,,,,,3
,,,,,,,,,,,,,,,,,,,,,,,,,,,,4
,,,,,,,,,,,,,,,,,,,,,,,,,,,,5
,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
,,,,,,,,,,,,,,,,,,,,,,,,,,,,7
,,,,,,,,,,,,,,,,,,,,,,,,,,,,8
,,,,,,,,,,,,,,,,,,,,,,,,,,,,9
,,,,,,,,,,,,,,,,,,,,,,,,,,,,10
,,,,,,,,,,,,,,,,,,,,,,,,,,,,11
,,,,,,,,,,,,,,,,,,,,,,,,,,,,12
,,,,,,,,,,,,,,,,,,,,,,,,,,,,13
,,,,,,,,,,,,,,,,,,,,,,,,,,,,10
,,,,,,,,,,,,,,,,,,,,,,,,,,,,10
Logged

Alemismun

  • Ensign
  • *
  • Posts: 26
  • Im just some weeb
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4773 on: August 09, 2019, 09:40:59 AM »

Your wing_data.csv has a bunch of garbage in it (column AC in spreadsheet editor)
e.g.
Code: csv
id,variant,tags,tier,rarity,fleet pts,op cost,formation,range,attackRunRange,attackPositionOffset,num,role,role desc,refit,base value,,,,,,,,,,,,,number
IND_JunkMech,IND_JunkMech_variant,"fighter4, fighter, low, lowtech_bp",0,,3,2,V,4000,450,,4,FIGHTER,Fighter,5,1500,,,,,,,,,,,,,1
,,,,,,,,,,,,,,,,,,,,,,,,,,,,2
,,,,,,,,,,,,,,,,,,,,,,,,,,,,3
,,,,,,,,,,,,,,,,,,,,,,,,,,,,4
,,,,,,,,,,,,,,,,,,,,,,,,,,,,5
,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
,,,,,,,,,,,,,,,,,,,,,,,,,,,,7
,,,,,,,,,,,,,,,,,,,,,,,,,,,,8
,,,,,,,,,,,,,,,,,,,,,,,,,,,,9
,,,,,,,,,,,,,,,,,,,,,,,,,,,,10
,,,,,,,,,,,,,,,,,,,,,,,,,,,,11
,,,,,,,,,,,,,,,,,,,,,,,,,,,,12
,,,,,,,,,,,,,,,,,,,,,,,,,,,,13
,,,,,,,,,,,,,,,,,,,,,,,,,,,,10
,,,,,,,,,,,,,,,,,,,,,,,,,,,,10

I tried deleting the numbers that were not in usage, it still gave me the error.
I deleted the entire row and I still got the error... what else should I try?

Edit: I check this page about 20 times a day, I really gotta find more ways to spend time.
« Last Edit: August 09, 2019, 05:44:34 PM by Alemismun »
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4774 on: August 09, 2019, 06:49:44 PM »

Ah, checked the log and found that the problem was in IND_JunkMech.ship. The coversColor tag is corrupted (not sure if bug in ship editor or it got there later).
Code
  "coversColor": "\r",
Removing that fixes the error, although it crashes again later during startup (the mod plugin referenced in the modinfo doesn't actually exist).
Logged

Alemismun

  • Ensign
  • *
  • Posts: 26
  • Im just some weeb
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4775 on: August 10, 2019, 03:59:46 AM »

Ah, checked the log and found that the problem was in IND_JunkMech.ship. The coversColor tag is corrupted (not sure if bug in ship editor or it got there later).
Code
  "coversColor": "\r",
Removing that fixes the error, although it crashes again later during startup (the mod plugin referenced in the modinfo doesn't actually exist).

Well do I feel stupid now... Thank you. Very much so, I probably would have never figured this one out on my own.

At that point, you should be able to run the game in devMode (data/config/settings.json; set devMode to true), press "Edit Variants" from the main menu, scroll down to any carrier, and if you click on one of its fighter bays, your fighter should show up there as an option to install. (Unless it has tags that prevent it from showing up there; make sure you copy something "normal" for the wing_data.csv row; i.e. a Talon or something.)
And just like that it works!

It shows up in the edit variant thing but I have not been able to see whether or not it spawns on markets, I guess ill find out if I test for long enough.

Now that all seems to work, im gonna start adding more and more mechs to my mod.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4776 on: August 10, 2019, 08:21:41 AM »

Nice! To make it available for sale, you'll need to make it available to the faction that controls the market, via its .faction file.
Logged

froppyfropfrop

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4777 on: August 10, 2019, 09:47:56 AM »

Suppose you made a custom industry for a custom faction. For player planets I want that industry to be locked behind the appropriate blueprint, and said blueprints to be available from the nation's markets. How would I accomplish this, if at all?

I could find lots of info on how to do this for ships and items, but not buildings, and I can't seem to find a way to tag my industry to be part of a blueprint pack.

If that's impossible:
Do all industries just *have* to be available to the player?

If not, how would I mark an industry such that a player can never construct it? (i.e. make it a unique planetary feature)
« Last Edit: August 10, 2019, 10:05:06 AM by queendaenyori »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4778 on: August 10, 2019, 10:12:52 AM »

Take a look at com.fs.starfarer.api.impl.campaign.econ.impl.PlanetaryShield

Code: java
@Override
public boolean isAvailableToBuild() {
if (!Global.getSector().getPlayerFaction().knowsIndustry(getId())) {
return false;
}
return market.getPlanetEntity() != null;
}

The BaseIndustry implementation of that method doesn't check whether the player knows the industry blueprint, i.e. by default industries are available, and ones that aren't (like PlanetaryShield or LionsGuardHQ) implement this method in the appropriate way for that use case. The LionsGuardHQ method just returns false, for example.

There's no "blueprint pack" item for industries, there's just a base industry blueprint item. The way to create a blueprint for a specific industry with code is something like:

cargo.addSpecial(new SpecialItemData("industry_bp", "planetaryshield"), 1);

Replacing "planetaryshield" with your industry id. "industry_bp" is the id of the base industry blueprint item, defined in data/campaign/special_items.csv.

You could also have an industry blueprint drop via drop_groups.csv (or code to create a drop group); the "commodity" column for this would be this:

item_industry_bp:planetaryshield

item_ says it's a special item
industry_bp is the id of the item
After the : follows the special data parameter, same as the second parameter in new SpecialItemData("industry_bp", "planetaryshield")
Logged

Alemismun

  • Ensign
  • *
  • Posts: 26
  • Im just some weeb
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4779 on: August 10, 2019, 11:42:27 AM »

Nice! To make it available for sale, you'll need to make it available to the faction that controls the market, via its .faction file.
I assume I must go to each individual faction file (which there seems to be quite a few of, I didnt know half of them) and add the item's ID... But where?

Code
"knownFighters":{
I assume this is which fighter they have a chance of spawning with? Or do they actually have to have the item itself beforehand?
Or perhaps adding it to the list above will actually make it spawn in their markets, which if so, since it uses tags, it should already work because I tagged the fighter as "lowtech_bp".
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4780 on: August 10, 2019, 11:57:58 AM »

Yeah, that's the section. If you've got the tag, then, yeah, you're right, it should already show.
Logged

Alemismun

  • Ensign
  • *
  • Posts: 26
  • Im just some weeb
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4781 on: August 10, 2019, 12:45:26 PM »

Yeah, that's the section. If you've got the tag, then, yeah, you're right, it should already show.
I have a question, how do I assign a specific gun to a fighter hull?
I wanna give my mech a dual machinegun and 2 missile launchers, I assume this must be done via the hull file itself, but im not sure on the details.
Code
"weaponSlots": [
    {
      "angle": 0,
      "arc": 60,
      "id": "WS 001",
      "locations": [
        29.5,
        -29.5
      ],
      "mount": "HIDDEN",
      "size": "SMALL",
      "type": "BALLISTIC"
    },
    {
      "angle": 0,
      "arc": 5,
      "id": "WS 002",
      "locations": [
        27.5,
        31.5
      ],
      "mount": "HIDDEN",
      "size": "SMALL",
      "type": "BALLISTIC"
    },
    {
      "angle": 0,
      "arc": 5,
      "id": "WS 003",
      "locations": [
        27.5,
        41
      ],
      "mount": "HIDDEN",
      "size": "SMALL",
      "type": "BALLISTIC"
    }
  ],
What do I do?[/s]

EDIT: IM STUPID
I forgot variants were a thing. My bad.
« Last Edit: August 10, 2019, 01:28:06 PM by Alemismun »
Logged

Inventor Raccoon

  • Captain
  • ****
  • Posts: 451
  • Digging through trash for a hydroflux catalyst
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4782 on: August 10, 2019, 01:19:24 PM »

Fighter weapons are usually assigned in the .variant file rather than being built into the hull itself.
Logged

Alemismun

  • Ensign
  • *
  • Posts: 26
  • Im just some weeb
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4783 on: August 10, 2019, 02:54:37 PM »

Yet another question arises, how do I change the respawn timer on fighters? My OP fighter respawns too quick, which makes it impossible for the enemy to attack.

Edit 2: How do I make my fighter fire its missile from a distance? He keeps getting ontop of the enemy in order to fire its torpedo, its madness.
« Last Edit: August 10, 2019, 03:00:42 PM by Alemismun »
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4784 on: August 10, 2019, 04:23:08 PM »

Yet another question arises, how do I change the respawn timer on fighters? My OP fighter respawns too quick, which makes it impossible for the enemy to attack.

"refit time" in wing_data.csv. It's the time, in seconds, it takes the carrier to build a new fighter if one is lost. Higher number = slower replacement.

How do I make my fighter fire its missile from a distance? He keeps getting ontop of the enemy in order to fire its torpedo, its madness.

What's the range of the torpedo weapon, and is it guided? What do you have set for the fighter's "engagement range" in wing_data.csv?
Logged
Pages: 1 ... 317 318 [319] 320 321 ... 706