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 [2]

Author Topic: [0.95a] Unpack Blueprints  (Read 60022 times)

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #15 on: September 08, 2021, 04:29:42 AM »

Starsector's CSVs are comma separated, thus if a description has a comma in it, it needs quotation to say "this isn't a new field".

If it doesn't have a comma in its description, it doesn't need quotation (although adding quotation won't break anything).

Zalpha

  • Commander
  • ***
  • Posts: 185
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #16 on: September 08, 2021, 11:33:30 AM »

BUG?

I'm not sure what you're trying to do or what you did but if you're editing unpack's files to add another mod's special_items.csv to unpack, stop right there. If you want HMI's BPs to unpack like Vanilla's, go to HMI/data/campaign/special_items.csv

Once that is open, check the list of BPs and see if they call "MultiBlueprintItemPlugin". If they do, select that entire call (example from Magellan: "com.fs.starfarer.api.campaign.impl.items.MultiBlueprintItemPlugin") replace it with "data.scripts.UnpackBlueprints" no quotations.

Thank you, I was going about it all wrong, now I understand. Hopefully I will get it right this time!   

Edit: I am an idiot. I must of done something wrong because I got an crash error and log report (tried to figure out the log error but could not). Anyway, I replaced the edited files and will try again but I thought I can ask for help here. Just to make sure I am doing it right and which is the right way.

HMI Junkship Package,hmi_junk_package,package_bp,0.5,10000,1000,1,graphics/icons/cargo/blueprint_lowtech.png,ui_chip_pickup,ui_bp_package_drop,com.fs.starfarer.api.campaign.impl.items.MultiBlueprintItemPlugin,hmi_junk_bp,Enables heavy industry to construct literal trash that could be misconstrued as space ships often found in Hazard Mining Incorporated and Scavenger fleets.,200

Does it become like this?:

HMI Junkship Package,hmi_junk_package,package_bp,0.5,10000,1000,1,graphics/icons/cargo/blueprint_lowtech.png,ui_chip_pickup,ui_bp_package_drop,data.scripts.UnpackBlueprints,hmi_junk_bp,Enables heavy industry to construct literal trash that could be misconstrued as space ships often found in Hazard Mining Incorporated and Scavenger fleets.,200

or like this?:

HMI Junkship Package,hmi_junk_package,package_bp,0.5,10000,1000,1,graphics/icons/cargo/blueprint_lowtech.png,ui_chip_pickup,ui_bp_package_drop,com.fs.starfarer.api.campaign.impl.items.data.scripts.UnpackBlueprints,hmi_junk_bp,Enables heavy industry to construct literal trash that could be misconstrued as space ships often found in Hazard Mining Incorporated and Scavenger fleets.,200


I tried the first option, maybe I accidentally removed a comma by mistake or removed more than just what I was supposed too or something or I was completely wrong. I will try the first option again, and if that doesn't work I will the second option and hope I get it right.

^ I was before editing in notepad++ with word wrap on. I switched over to working with it in Excel and it is much easier now.

Edit 2:  I got it working and it worked out great. I am going to slowly go through my mods making the changes but not to quickly like I did before and got the error, I wasn't sure at that point which mods messed it up so I replaced the few that I had edited. Now that I know what I am doing and have it working I will slowly patch them up as I come across the blueprints.

It is super awesome to open them up and read each ships description. The base game should totally incorporate this mod.
« Last Edit: September 08, 2021, 01:04:22 PM by Zalpha »
Logged

Raio_Verusia

  • Ensign
  • *
  • Posts: 26
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #17 on: September 08, 2021, 01:54:07 PM »

Edit 2:  I got it working and it worked out great. I am going to slowly go through my mods making the changes but not to quickly like I did before and got the error, I wasn't sure at that point which mods messed it up so I replaced the few that I had edited. Now that I know what I am doing and have it working I will slowly patch them up as I come across the blueprints.

I'm glad you got it working! I had trouble too but Yunru helped me figure it out so I figured I'd pass it on. ^^
Logged

Raio_Verusia

  • Ensign
  • *
  • Posts: 26
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #18 on: September 13, 2021, 01:51:01 PM »

Starsector's CSVs are comma separated, thus if a description has a comma in it, it needs quotation to say "this isn't a new field".

If it doesn't have a comma in its description, it doesn't need quotation (although adding quotation won't break anything).

Oh, thank you I had no idea, and I missed this.
Logged

SirStargateur

  • Ensign
  • *
  • Posts: 13
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #19 on: September 14, 2021, 08:37:38 PM »

Doesn't work well with some mod probably, I was having a blueprint that never "depop" and so could generate infinite number of blueprint.
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #20 on: September 14, 2021, 08:41:44 PM »

Doesn't work well with some mod probably, I was having a blueprint that never "depop" and so could generate infinite number of blueprint.
Yes, that does seem to be an elusive phantom that I can't seem to track down.

As you said, it's most likely a mod conflict (somehow), but I don't play with that many (Faction) mods, so I wouldn't even know where to start looking.

LinWasTaken

  • Commander
  • ***
  • Posts: 189
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #21 on: October 09, 2021, 01:40:22 PM »

i tried this mod out and it got tedious very quickly, is it* safe to disable the mod mid-playthrough?
« Last Edit: October 12, 2021, 02:31:43 AM by linas0123 »
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #22 on: October 10, 2021, 04:05:26 AM »

Tedious is a... surprising adjective. What about it generates the tedium, may I ask?

And yes, it should be 100% safe to disable.

LinWasTaken

  • Commander
  • ***
  • Posts: 189
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #23 on: October 12, 2021, 02:30:01 AM »

I may be doing something wrong but whenever i unpack a blueprint set i have to individualy right click every single blue print to check if any were new/not learnt yet. then i have to sell the already learnt ones by clicking all of them individualy again.
and before you say "just mouse over to see if it's already learnt or not" it takes about 1.5 sec each for the window to pop up telling you if you've already learnt the tech or not. while clicking them takes 0.5 each. hence it got tedious.
PS : i mean no disrespect, its a great mod its simply not for me. and sorry for the late responce.
« Last Edit: October 12, 2021, 02:32:29 AM by linas0123 »
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #24 on: October 12, 2021, 02:39:57 AM »

Hmm, that should still display when you mouse over the package before unpacking it.

Regardless, it's no problem if it's not for you (this mod wouldn't even exist if we had some sort of blacklist, for instance).

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #25 on: December 09, 2021, 02:59:14 AM »

Bug Report

When you have learned all blueprints in a pack, vanilla marks it as "all are known" and makes it unclickable. As your mod overwrites right click, it will add a bp for each one but the original package will not be removed.

Quick fix is to also override areAllKnown:
Code
	@Override
protected boolean areAllKnown(List<String> ships, List<String> weapons, List<String> fighters) {
return false;
}
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #26 on: December 09, 2021, 03:31:20 AM »

Ohhh, that might be it! Thank you, I've not been able to make any progress on cracking this one!

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #27 on: December 09, 2021, 04:23:38 AM »

Many many, innumerable thanks to Jaghaimo.
Updated the mod to remove blueprint duplication.

Exasperation

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #28 on: March 20, 2022, 10:27:16 PM »

Bug report: the tooltip duplicates the original tooltip as well as providing the updated tooltip with the result that the information about which blueprints are in the package is repeated and for larger packages some of the tooltip gets pushed off the screen.  This is because calling super.createTooltip() from UnpackBlueprints calls MultiBlueprintItemPlugin.createTooltip() when what is wanted is BaseSpecialItemPlugin.createTooltip().  Fortunately, the actual logic in BaseSpecialItemPlugin.createTooltip() is pretty simple, so you can fix this by replacing
Code
    public void createTooltip(TooltipMakerAPI tooltip, boolean expanded, CargoTransferHandlerAPI transferHandler, Object stackSource) {
        super.createTooltip(tooltip, expanded, transferHandler, stackSource);

        float pad = 3f;
        float opad = 10f;
        float small = 5f;
in UnpackBlueprints with
Code
    public void createTooltip(TooltipMakerAPI tooltip, boolean expanded, CargoTransferHandlerAPI transferHandler, Object stackSource) {
        float pad = 3f;
        float opad = 10f;
        float small = 5f;

        tooltip.addTitle(getName());

        String design = getDesignType();
        Misc.addDesignTypePara(tooltip, design, opad);

        if (!spec.getDesc().isEmpty()) {
            Color c = Misc.getGrayColor();
            tooltip.addPara(spec.getDesc(), c, opad);
        }
Logged

Damonvi

  • Ensign
  • *
  • Posts: 18
    • View Profile
Re: [0.95a] Unpack Blueprints
« Reply #29 on: October 07, 2022, 02:32:34 PM »

sorry to revive such a dead thread, but if i wanted to "enable" a mod that hasnt already been whitelisted by a mod creator, what line of code do i need to replace in order to make this mod function with X mod?

for instance, i have a few duplicate blueprint packs that i've already learned, for mods that arent "supported". i could take these packs to the prism freeport, and turn them in for points, but if i could unpack them, i could use the individual blueprints instead, and either get a bunch more points with the freeport, or use them with the Industrial Evolution mod, and reverse engineer ships that i dont have blueprints for already, and overwrite the plethora of blueprints i would get from unpacking the pack.


so here's what im looking at. i have 2 of these "Ork" packs from the Bultach Coalition mod that i've already learned.

here's the code in the special_items.csv

Quote
name,id,tags,tech/manufacturer,rarity,base price,stack size,cargo space,baseRaidDanger,icon,sound id,sound id drop,plugin,plugin params,desc,order
Skrapper Full Database,ork_project_package,package_bp,Skrapper,3,30000,1000,1,,graphics/icons/cargo/blueprint_basic.png,ui_chip_pickup,ui_bp_package_drop,com.fs.starfarer.api.campaign.impl.items.MultiBlueprintItemPlugin,ork_project_bp,ork thingie ,240

which of all of this do i replace with "data.scripts.UnpackBlueprints", like stated in a previous post?

this way, i can repeat the process for other mods that arent inherently "supported out of the box" by this mod.
Logged
Pages: 1 [2]