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 ... 388 389 [390] 391 392 ... 706

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

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5835 on: December 20, 2019, 03:06:50 PM »

  • Copied SAD_Niddhoggr.ship in data\hulls and renamed the copy SAD_Nidhoggr_P - made no changes to this, didn't even open it with anything

You need to open SAD_Nidhoggr_P.ship and change its id field to match the one in ship_data.csv. May as well change the name field there while you're at it. You'll also need to add your ship to the default_ship_roles.json in world/factions and add it to the pirates faction's known ships. I think that's everything.

I strongly suggest moving all your stuff into your own minimod. Then you won't have to do a bunch of copying and editing whenever S.A.D. updates.
Logged

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5836 on: December 20, 2019, 03:19:17 PM »

I have some Hidden hullmods that are popping up for players anyways, how do i make sure they never appear unless they are built-in?
Logged
Check out my ships

cathar

  • Lieutenant
  • **
  • Posts: 55
  • ludd is bae
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5837 on: December 20, 2019, 04:01:30 PM »

  • Copied SAD_Niddhoggr.ship in data\hulls and renamed the copy SAD_Nidhoggr_P - made no changes to this, didn't even open it with anything

You need to open SAD_Nidhoggr_P.ship and change its id field to match the one in ship_data.csv. May as well change the name field there while you're at it. You'll also need to add your ship to the default_ship_roles.json in world/factions and add it to the pirates faction's known ships. I think that's everything.

I strongly suggest moving all your stuff into your own minimod. Then you won't have to do a bunch of copying and editing whenever S.A.D. updates.

Managed to change the .ship with Wordpad (amateur hour, I know). Unfortunately now it is giving me an error about the .variant, which I thought I had changed properly. Image of the error is attached.

Did I miss something?


Also I didn't add it to the pirate faction cause I only want it to be available to myself with console for now.

I hear you about the minimod. That can happen once I figure out all the things I actually need to have in my mod for things to function ^^



NEVERMIND, apparently some things in Starsector are case sensitive and some aren't. Once I changed a lower case p for an upper case P in the .variant it works now!

Thanks for the help!

[attachment deleted by admin]
« Last Edit: December 20, 2019, 04:07:22 PM by cathar »
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5838 on: December 20, 2019, 07:01:15 PM »

I'm adding GUI sliders to a part of the new game dialog. But when I call the rules.csv row that's supposed to read their values, the sliders no longer exist (opts.hasSelector returns false). Even though I haven't left the dialog "page" where I added the sliders yet and the dialog option that calls said rule is in the same page as the sliders.
I have a working implementation of sliders elsewhere in my new game dialog, but can't tell why that one works and this doesn't.
Help plz

I have some Hidden hullmods that are popping up for players anyways, how do i make sure they never appear unless they are built-in?
Do you mean they're dropping as modspecs for players when they shouldn't? Add the "no_drop" and "no_drop_salvage" tags
(or make factions not know them, I guess)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5839 on: December 20, 2019, 07:06:39 PM »

EDIT: I have another question though, is there a way to flag ships as no-retreat? I seem to be getting some fatal errors when ships dynamically spawned in-combat retreat from the 'Full Retreat' command.

This is the aforementioned error, by the way, if it's of interest:

Code
ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.combat.ai.movement.maneuvers.RetreatManeuver.o00000(Unknown Source)
at com.fs.starfarer.combat.ai.movement.maneuvers.RetreatManeuver.o00000(Unknown Source)

Hmm - I suspect this may be due to how you're adding the ship; if this was a universal problem I'd imagine a lot of other things that work in mods, wouldn't.


I'm adding GUI sliders to a part of the new game dialog. But when I call the rules.csv row that's supposed to read their values, the sliders no longer exist (opts.hasSelector returns false). Even though I haven't left the dialog "page" where I added the sliders yet and the dialog option that calls said rule is in the same page as the sliders.
I have a working implementation of sliders elsewhere in my new game dialog, but can't tell why that one works and this doesn't.
Help plz

Do your options add any other options somewhere along the way? That would cause the old (slider) options to get cleared out. Do any of the rule commands you run return true in their doesCommandAddOptions() method? That would also cause the options to get cleared out, even if the command doesn't actually add any.

Edit: on re-reading, it sounds like the options are not, in fact, getting cleared out, so probably never mind that. But on the other hand, looking at the code, it seems... let's say unlikely? ... that the getSelector() option would return false if the right parameter was passed in and the options were *not* cleared, since the map that holds the selectors is *only* cleared when the options are cleared.
« Last Edit: December 20, 2019, 07:09:24 PM by Alex »
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5840 on: December 20, 2019, 10:14:08 PM »

I'm adding GUI sliders to a part of the new game dialog. But when I call the rules.csv row that's supposed to read their values, the sliders no longer exist (opts.hasSelector returns false). Even though I haven't left the dialog "page" where I added the sliders yet and the dialog option that calls said rule is in the same page as the sliders.
I have a working implementation of sliders elsewhere in my new game dialog, but can't tell why that one works and this doesn't.
Help plz

Do your options add any other options somewhere along the way? That would cause the old (slider) options to get cleared out. Do any of the rule commands you run return true in their doesCommandAddOptions() method? That would also cause the options to get cleared out, even if the command doesn't actually add any.

Edit: on re-reading, it sounds like the options are not, in fact, getting cleared out, so probably never mind that. But on the other hand, looking at the code, it seems... let's say unlikely? ... that the getSelector() option would return false if the right parameter was passed in and the options were *not* cleared, since the map that holds the selectors is *only* cleared when the options are cleared.
Ahh, that was it. The row had a script column call to make the rulescmd read the sliders, but also had an options column entry to advance the dialog, which was indeed why it was being cleared out. (Sorry if I explained it wrong!)
Thanks, solved now.
Logged

Hoakin Blackforge

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5841 on: December 21, 2019, 03:35:26 AM »

Hey, new to modding here, does graphicslib help to increase performance?
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1723
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5843 on: December 21, 2019, 09:34:36 AM »

Hey, new to modding here, does graphicslib help to increase performance?
Not by default, but there might be some combination of settings that allow it to increase performance. It might be worth asking about in the graphicslib thread.

For replacing CSV elements, do mods loaded later override ones loaded earlier, or the opposite?
Pretty sure mods loaded later override ones loaded earlier. Although the official answer is "unspecified"
Mod Structure & File Merging

MajorTheRed

  • Captain
  • ****
  • Posts: 288
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5844 on: December 21, 2019, 11:00:05 AM »

Hello!
I want to insert two new illustrations (for planet and station interaction) so I created the illustration folder in graphics, added the .jpeg, and added the following kid of line in the .java file of the system:
Quote
         NoraStation1.setInteractionImage("illustrations", "filgap_nora");
but I got the following error:

Quote
ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Texture [filgap_bythinia] from category [illustrations] not found

Note sure what to do... I never had a similar problem with other icons or graphics. Do I need to give a full path in the java file?

Thank you for your help! And for the previous ones, and the previous ones...
Logged

TheRiverNorth

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5845 on: December 21, 2019, 12:00:57 PM »

Hey guys :)

I'm not sure if this fits in here, but I was looking around the fleet doctrine screen and was wondering if there was any way to edit it from the outside. I tried editing the campaign.xml and set my fleet's doctrine to all 5s to see what would happen, but it wouldn't let me save the file. Thoughts?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5846 on: December 21, 2019, 12:15:36 PM »

Hello!
I want to insert two new illustrations (for planet and station interaction) so I created the illustration folder in graphics, added the .jpeg, and added the following kid of line in the .java file of the system:
Quote
         NoraStation1.setInteractionImage("illustrations", "filgap_nora");
but I got the following error:

Quote
ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Texture [filgap_bythinia] from category [illustrations] not found

Note sure what to do... I never had a similar problem with other icons or graphics. Do I need to give a full path in the java file?

Thank you for your help! And for the previous ones, and the previous ones...

Did you add the illustration to the "illustrations" section in settings.json?

Hey guys :)

I'm not sure if this fits in here, but I was looking around the fleet doctrine screen and was wondering if there was any way to edit it from the outside. I tried editing the campaign.xml and set my fleet's doctrine to all 5s to see what would happen, but it wouldn't let me save the file. Thoughts?

Hi - you probably need to run whatever text editor you're using as admin, or change the file so it's not read-only, or move it to the desktop and edit there then move it back, or some other such. This is some kind of windows thing preventing you from editing the file for... some windows reason.
Logged

MajorTheRed

  • Captain
  • ****
  • Posts: 288
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5847 on: December 21, 2019, 01:53:49 PM »

Thanks a lot, everything is working fine now!
Have a merry Christmas!
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5848 on: December 21, 2019, 09:56:32 PM »

How to show dialog while I am in CARGO core tab :(
I have a special item that could right click and remove to get some blueprints, so I want to use "show loot" to interact with showloot listener.

Here is my code before which is not related to dialog.
Code: java
    @Override
    public void performRightClickAction() {
        LockBoxData data = LockBoxData.getData();
        if (data.isTotallyUnlocked()) {
            List<DropData> dropRandomList = new ArrayList<>();

            DropData drop = new DropData();
            drop.group = "ship_bp";
            drop.chances = 6;
            dropRandomList.add(drop);
            CargoAPI extra = SalvageEntity.generateSalvage(random, 1, 1, 1, null, dropRandomList);
            extra.addSpecial(new SpecialItemData(Items.SHIP_BP, "AL_doctor"), 1f);
            CargoAPI cargo = stack.getCargo();
            cargo.addAll(extra);
        }
    }
But if I click it in others[4], it will disappear after I switch to all[1] or [2], because the cargo is not the real cargo.
Logged
My mods


TheRiverNorth

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5849 on: December 22, 2019, 02:54:54 AM »

Hey guys :)

I'm not sure if this fits in here, but I was looking around the fleet doctrine screen and was wondering if there was any way to edit it from the outside. I tried editing the campaign.xml and set my fleet's doctrine to all 5s to see what would happen, but it wouldn't let me save the file. Thoughts?

Hi - you probably need to run whatever text editor you're using as admin, or change the file so it's not read-only, or move it to the desktop and edit there then move it back, or some other such. This is some kind of windows thing preventing you from editing the file for... some windows reason.
Ah, yeah. That did the trick. Thanks!
Logged
Pages: 1 ... 388 389 [390] 391 392 ... 706