Fractal Softworks Forum

Starsector => Mods => Topic started by: Yunru on May 26, 2021, 05:20:29 AM

Title: [0.95a] Unpack Blueprints
Post by: Yunru on May 26, 2021, 05:20:29 AM
I don't remember if I ever released this for 0.91, but I can confirm it still works in the latest version, so here we go:
https://drive.google.com/file/d/19QVals0-Q_PsGjyn1nWTf2Roa6CQroI3/view?usp=sharing

This simple mod changes how packages work. With the mod installed using a blueprint package unlocks nothing. Instead, it gives you a single blueprint for each item in the package.

By default the only packages that are affected are those that are in vanilla, although it should be relatively easy to manually adjust mod-added packages just by changing the script they call.
Title: Re: [0.95a] Unpack Blueprints
Post by: Yunru on June 02, 2021, 09:40:11 AM
Thank you kind sir for the move!
Title: Re: [0.95a] Unpack Blueprints
Post by: 6chad.noirlee9 on June 02, 2021, 09:51:25 AM
REALLY hope the other creators pick this up.

VERY nice idea.
Title: Re: [0.95a] Unpack Blueprints
Post by: Yunru on June 02, 2021, 09:59:33 AM
REALLY hope the other creators pick this up.

VERY nice idea.
As long as the added package still calls [...]MultiBlueprintItemPlugin in the special_items.csv, you can manually change it to "data.scripts.UnpackBlueprints" and it should work without issue (although I haven't personally tested it).

If it doesn't call MultiBlueprintItenPlugin then it's doing something special and I would advise against changing it.
Title: Re: [0.95a] Unpack Blueprints
Post by: TheHalfwayXBray on June 27, 2021, 06:24:52 PM
I seem to have found a glitch with the mod, whenever I unpack a High Tech Blueprint Package, it gives me all the blueprints, but it doesn't delete the blueprint package so I can keep unpacking it to infinity. After some more testing, It might be a conflict with another mod since every Package seems to do it after being opened once.
Title: Re: [0.95a] Unpack Blueprints
Post by: shpooky on July 15, 2021, 06:17:33 PM
I seem to have found a glitch with the mod, whenever I unpack a High Tech Blueprint Package, it gives me all the blueprints, but it doesn't delete the blueprint package so I can keep unpacking it to infinity. After some more testing, It might be a conflict with another mod since every Package seems to do it after being opened once.
ive also run into this bug as well
Title: Re: [0.95a] Unpack Blueprints
Post by: Yunru on July 15, 2021, 08:27:45 PM
Hmm, once is happenstance, twice...

Could I perchance have a mod list from both of you, as I'm currently unable to reproduce it, so presumably it's a mod conflict of some sort.
(Although I'm lost as to what could be the cause, this mod specifically repoints packages to try and avoid this - nothing done to the vanilla script should be able to effect this.)
Title: Re: [0.95a] Unpack Blueprints
Post by: Raio_Verusia on August 29, 2021, 12:31:39 PM
As long as the added package still calls [...]MultiBlueprintItemPlugin in the special_items.csv, you can manually change it to "data.scripts.UnpackBlueprints" and it should work without issue (although I haven't personally tested it).

If it doesn't call MultiBlueprintItenPlugin then it's doing something special and I would advise against changing it.

I don't know if I'm doing something wrong testing this theory of yours but it's not working for Archean Order (I know, probably the worst mod to try this with lol)

It just crashes with being unable to find the script, when it finishes loading and tries to enter the menu.
Title: Re: [0.95a] Unpack Blueprints
Post by: Yunru on August 30, 2021, 06:39:50 AM
Hmm, I'd download to check it out, but that would require a nexus mods accounts.
You changed the entirety of plugin entry to data.scripts.UnpackBlueprints?
Was it originally something ending in MultiBlueprintItemPlugin?

Follow up question: Is UnpackBlueprints an active mod for you?
Title: Re: [0.95a] Unpack Blueprints
Post by: Arthur_The_Ok on August 30, 2021, 04:23:59 PM
I seem to have found a glitch with the mod, whenever I unpack a High Tech Blueprint Package, it gives me all the blueprints, but it doesn't delete the blueprint package so I can keep unpacking it to infinity. After some more testing, It might be a conflict with another mod since every Package seems to do it after being opened once.
It happens with all blueprint packages
Title: Re: [0.95a] Unpack Blueprints
Post by: Raio_Verusia on August 30, 2021, 05:27:07 PM
Hmm, I'd download to check it out, but that would require a nexus mods accounts.
You changed the entirety of plugin entry to data.scripts.UnpackBlueprints?
Was it originally something ending in MultiBlueprintItemPlugin?

Follow up question: Is UnpackBlueprints an active mod for you?

Maybe you can tell me if this is the right way to do it, but I went into AO's Special_Items.csv, ctrl f'd, clicked find all and replaced everything "MultiBlueprintItemPlugin" with (with and without quotations) "data.scripts.UnpackBlueprints" a few times and nuffin. The launcher says it's enabled but I had a similar issue with a mod failing to initialize (if that is infact happening) with Quality Captains' 1.0.8 update. I had to modify the mod.json to get that one to work, uncommenting a line but I did not check for that with this mod.

It happens with all blueprint packages

Are you using any other mods? This particular issue Yunru's been looking at I think, but they don't see an issue so if you gave a mod list they can potentially come up with a fix.
Title: Re: [0.95a] Unpack Blueprints
Post by: Yunru on August 31, 2021, 02:29:41 AM
Hmm, I'd download to check it out, but that would require a nexus mods accounts.
You changed the entirety of plugin entry to data.scripts.UnpackBlueprints?
Was it originally something ending in MultiBlueprintItemPlugin?

Follow up question: Is UnpackBlueprints an active mod for you?

Maybe you can tell me if this is the right way to do it, but I went into AO's Special_Items.csv, ctrl f'd, clicked find all and replaced everything "MultiBlueprintItemPlugin" with (with and without quotations) "data.scripts.UnpackBlueprints" a few times and nuffin. The launcher says it's enabled but I had a similar issue with a mod failing to initialize (if that is infact happening) with Quality Captains' 1.0.8 update. I had to modify the mod.json to get that one to work, uncommenting a line but I did not check for that with this mod.
Ah yeah, find and replace would explain it. MultiBlueprintItemPlugin is just the end bit of a very long address, all of which needs to be replaced, otherwise the fame will be looking in a non-existent location.
Title: Re: [0.95a] Unpack Blueprints
Post by: Raio_Verusia on August 31, 2021, 07:26:21 AM
Ah yeah, find and replace would explain it. MultiBlueprintItemPlugin is just the end bit of a very long address, all of which needs to be replaced, otherwise the fame will be looking in a non-existent location.

Haha sorry, this stuff is so far out of my expertise... I managed to figure it out thanks to this reply and it's working, thanks a whole lot!
Title: Re: [0.95a] Unpack Blueprints
Post by: Zalpha on September 08, 2021, 12:39:22 AM
BUG?

Luddic Path Blueprint Package,LP_package,package_bp,,18000,1000,1,graphics/icons/cargo/blueprint_basic.png,ui_chip_pickup,ui_bp_package_drop,data.scripts.UnpackBlueprints,LP_bp,A collection of hacks and after-market modification specs that enables heavy industry to construct the hulls more commonly used by members of the Luddic Path.,250

XIV Battlegroup Blueprint Package,XIV_package,"package_bp, no_drop",,1000000,1000,1,graphics/icons/cargo/blueprint_basic.png,ui_chip_pickup,ui_bp_package_drop,data.scripts.UnpackBlueprints,XIV_bp,A set of blueprints that enable heavy industry to produce the near-legendary hulls employed by the Hegemony-founding XIV Battlegroup. The continued existence - and location - of these blueprints is subject of many rumors.,270

All the others have section with " (text discription)  "  but this is missing it, so I added it in, like this:

Luddic Path Blueprint Package,LP_package,package_bp,,18000,1000,1,graphics/icons/cargo/blueprint_basic.png,ui_chip_pickup,ui_bp_package_drop,data.scripts.UnpackBlueprints,LP_bp,"A collection of hacks and after-market modification specs that enables heavy industry to construct the hulls more commonly used by members of the Luddic Path.",250

XIV Battlegroup Blueprint Package,XIV_package,"package_bp, no_drop",,1000000,1000,1,graphics/icons/cargo/blueprint_basic.png,ui_chip_pickup,ui_bp_package_drop,data.scripts.UnpackBlueprints,XIV_bp,"A set of blueprints that enable heavy industry to produce the near-legendary hulls employed by the Hegemony-founding XIV Battlegroup. The continued existence - and location - of these blueprints is subject of many rumors.",270

*^ I am not to sure about this now because I noticed HMI has some without the quotes as well...

I hope I did the right thing. I added in HMI's special items to the list but the mod didn't work, so my adding it didn't seem to do what I thought this mod would do and add them individually when opened. I am going to remove my added code and see if that will work by default and it doesn't have to be added into this mod. (I thought I had to add it in and will see if that works but I don't think it will).

Title: Re: [0.95a] Unpack Blueprints
Post by: Raio_Verusia on September 08, 2021, 02:20:15 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.
Title: Re: [0.95a] Unpack Blueprints
Post by: Yunru 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).
Title: Re: [0.95a] Unpack Blueprints
Post by: Zalpha 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.
Title: Re: [0.95a] Unpack Blueprints
Post by: Raio_Verusia 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. ^^
Title: Re: [0.95a] Unpack Blueprints
Post by: Raio_Verusia 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.
Title: Re: [0.95a] Unpack Blueprints
Post by: SirStargateur 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.
Title: Re: [0.95a] Unpack Blueprints
Post by: Yunru 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.
Title: Re: [0.95a] Unpack Blueprints
Post by: LinWasTaken 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?
Title: Re: [0.95a] Unpack Blueprints
Post by: Yunru 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.
Title: Re: [0.95a] Unpack Blueprints
Post by: LinWasTaken 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.
Title: Re: [0.95a] Unpack Blueprints
Post by: Yunru 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).
Title: Re: [0.95a] Unpack Blueprints
Post by: Jaghaimo 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;
}
Title: Re: [0.95a] Unpack Blueprints
Post by: Yunru 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!
Title: Re: [0.95a] Unpack Blueprints
Post by: Yunru on December 09, 2021, 04:23:38 AM
Many many, innumerable thanks to Jaghaimo.
Updated the mod to remove blueprint duplication.
Title: Re: [0.95a] Unpack Blueprints
Post by: Exasperation 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);
        }
Title: Re: [0.95a] Unpack Blueprints
Post by: Damonvi 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.