Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.98a is out! (03/27/25)

Author Topic: [0.98a] bananaFactory v.20250416  (Read 7940 times)

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
[0.98a] bananaFactory v.20250416
« on: February 07, 2025, 09:00:51 PM »


disclaimer
Spoiler
this is a mod in progress. it is not as clean or stable as i would wish it to be.
there may be bugs, it may delete your save, it may call KGB to invade your home and steal your cookies. proceed with caution.

there may be sweeping API changes, as necessary. i will attempt to mitigate those to a minimum, to the best of my abilities.
there is not, and will never be a github/gitlab repository. best i can offer is a pastebin page for some specific scripts by request.
all source code is included in the mod archive. additionally, as it is written in plain java 7, it can be easily decompiled. ALWAYS VERIFY

in the event of any questions/misunderstandings please do not hesitate to contact me here via DM, or on discord.
[close]

what and why
Spoiler
Once upon a time i had an idea, for another mod i am working on, to add a ship that can build other ships, a mobile shipyard. After looking at available fleet production mods, of which there were two total, and finding them severely lacking, i decided to make my own take on that concept. Unfortunately, at the time i lacked the skills to actually make it a reality, so the idea was shelved indefinitely, but not forgotten.
Years later this was born, after countless revisions and complete rewrites.
bananaFactory is a highly versatile and flexible framework, to facilitate in-the-fleet production of literally anything you can imagine. It is designed to be easily expandable with zero coding knowledge required, and even more expandable with some intermediate java skills. What it ultimately does is add a campaign layer ability to player, which can be used to open custom production ui.
The production works, fundamentally, by treating every hullmod on every ship in player fleet as a separate production facility that can produce one <thing> at a time. The actual <things> to be produced are pulled from a merged json file. The time it takes to produce <thing>, as well as raw resources it would consume in the process, are pulled from the same json.
By itself bananaFactory does nothing. it is intended to be a framework that can be used by other mods.
For most items that actually exist in the game - i.e. ships, weapons, fighter wings, commodities, special items - whether vanilla or added by mods - all that is needed for bananafactory to produce them is for some mod to include data/config/bananaFactory_productionCosts.json with a relevant recipe in it. Anything that can be produced by bananafactory is handled by a specific defaultRecipe plugin, defined in the recipe. For aforementioned items, the plugins that handle adding and removing wares, calculating prices etc etc, are already provided. This does not require hard dependency on bananafactory, or any compiled code at all.
Additionally,  for more interesting things, like pushing jangala into the sun or teleporting player fleet to some specific planet, would require a custom plugin that would extend defaultRecipe and override relevant methods.
[close]

UI overview
Spoiler


1. custom data selector. all fields must be valid(green).
1.1 factory(hullmod) and fleetmember(ship) selection. present for all recipes. determines which ship will be producing it.
1.2 additional custom data requested by the recipe

2. recipe selection. select what you want to produce.
2.1 search bar. will only display recipes and products, for which searched text is contained in any fields. i.e. "large" will display all ships that have large weapons.
2.2 category. each recipe must belong to a specific category, defined in the plugin. ships/weapons/commodities are self-explanatory, others are added for thematic purposes, so as to not stick everything into "everything else" category.
2.3 recipe header (foldable). each recipe can have multiple products.
2.4 product card. represents individual product/item/action/event that will be created when the recipe is completed.
2.5 design type/manufacturer. added by request, technically search bar already covers that.

3. pre-production overview, displays required resources and some other info.

4. production queue
4.1 individual ship header (foldable)
4.2 individual factory(hullmod) header (foldable)
4.3 production order card. contains various controls. will remain in the list after production is complete.

each individual factory can produce one order at a time, and will switch to the next one after previous either can't be started, or is completed.
the resources are substracted from player cargo when production starts, and will be refunded if order is cancelled before completion.
[close]

compatibility/integration
Spoiler
provided is an example mod that showcases most of the possible features: https://www.mediafire.com/file/vsufjrm52ok4faq/BFdemo-20250417.zip/file

as a minimum, to have your mod make use of bananafactory, you need to at least have a data/config/bananaLib_recipes.json included, with the recipe specified inside, see the example.
additionally, if you want any fancy features, you need to include bananaLib as a dependency in your codebase, and extend `bananaLib.recipes.defaultRecipe`

--write more stuff here--
[close]

changelog
Spoiler

20250416
- fixed cancelled job refund not working correctly
- fixed transient script/listener being saved in save
20250415
- preliminary update for 0.98
- reworked for sidebarLib 20250415
- some internal optimization to make it produce less lag(hopefully)

[close]


credits and acknowledgements
Spoiler
myself (@banano_of_doom_7070) - most of the code.
creature - original idea that inspired me years ago.
@jujuteux, @rksharkz, @sirhartley, @kaysaar, @j0hnshm0, @tomatopaste_, @arthr, @crablobab, @willthefunperson, @ontheheavens, @steelsirokos - for truly invaluable help with great many things i struggled to understand over the years.
@audaxludos - for accidentally inventing a way to render interactive UI in campaign above core ui, without interactionDialog. Without him none of this would be possible.
@lortuss, @demto, @annihil4te, @mae1strom - for thoroughly testing this nonsense to ensure that it actually works, and does what it is supposed to do.
the rest of spaceport corvus, for providing moral support.
[close]
« Last Edit: April 16, 2025, 05:53:44 PM by banano of doom »
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] bananaFactory v.20280208
« Reply #1 on: February 07, 2025, 09:01:03 PM »

reserved
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] bananaFactory v.20280208
« Reply #2 on: February 07, 2025, 09:01:10 PM »

reserved
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] bananaFactory v.20250208
« Reply #3 on: February 09, 2025, 05:54:26 AM »

update
20250209
-fixed crash when trying to open UI while not having any production-capable ships in fleet
20250208
-initial release
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] bananaFactory v.202502012
« Reply #4 on: February 11, 2025, 07:00:32 AM »

update


202502012
-fixed hullmod tooltip rendering not working
-fixed canAfford always being true
-fixed prod item queue swapping not working
-fixed crash when trying to open UI while not having any production-capable ships in fleet AGAIN (for real this time)
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] bananaFactory v.20250213
« Reply #5 on: February 13, 2025, 01:49:34 AM »

update
20250213
- minor adjustments to remaining time display
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

Tecrys

  • Admiral
  • *****
  • Posts: 624
  • repair that space elevator!
    • View Profile
Re: [0.97] bananaFactory v.20250213
« Reply #6 on: February 13, 2025, 05:14:07 AM »

other modders would keep this power to themselves. Banano, you truly are the modder of the people
*kneeling emoji
Logged
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] bananaFactory v.20250216
« Reply #7 on: February 15, 2025, 04:09:40 PM »

update
20250216
- fix for hullmods not deactivating(and the effects, like blocking abilites, still applying) when production is paused
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

mkire

  • Commander
  • ***
  • Posts: 115
    • View Profile
Re: [0.97] bananaFactory v.20250216
« Reply #8 on: February 15, 2025, 11:16:27 PM »

how can i change what opens the interface? crtl+1 is for swapping ability bars for me
Logged

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] bananaFactory v.20250216
« Reply #9 on: February 16, 2025, 01:48:11 AM »

how can i change what opens the interface? crtl+1 is for swapping ability bars for me
huh, i guess that's an oversight on my part
i forgot that ability bar swap even a thing
anyways, the keys are pulled from data/config/settings.json, in the sidebarLib mod's folder
also ability swap triggers on both left and right control, but sidebar secondary action triggers only on left control
« Last Edit: February 16, 2025, 02:51:03 AM by banano of doom »
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] bananaFactory v.20250217
« Reply #10 on: February 17, 2025, 02:12:57 AM »

update
20250217
- fixed ui and production freezing after participating in battle
- fixed chash when swapping item order
- fixed recipe product list requiring save load to update. now updates on ui open
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] bananaFactory v.20250302
« Reply #11 on: March 02, 2025, 06:19:06 AM »

update
20250302
- fixed jobs getting stuck in schedule when member that was doing them disappeared for some reason or another. now job becomes INVALID when that happens, and can be removed properly.
- fixed price calculation to account for things that are not commodities. wtf was that?
- fixed canAfford function AGAIN
- various fixes to address random null crashes
- reworked recipe loading process, now recipe json is loaded entirely as-is and stored in the recipe plugin. as a result all values can be accessed, not just ones that were specifically parsed on load.
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.98a] bananaFactory v.20250416
« Reply #12 on: April 16, 2025, 05:38:37 PM »

update
20250416
- fixed cancelled job refund not working correctly
- fixed transient script/listener being saved in save
20250415
- preliminary update for 0.98
- reworked for sidebarLib 20250415
- some internal optimization to make it produce less lag(hopefully)
« Last Edit: April 16, 2025, 05:42:43 PM by banano of doom »
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

Velleos

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: [0.98a] bananaFactory v.20250416
« Reply #13 on: April 20, 2025, 05:28:10 AM »

Can anyone provide download links to the .97a versions of the banano forge, factory, and library mods?  .98a is running considerably worse for me but I still want to try these mods out.

Edit- Thanks.  I appreciate it.
« Last Edit: April 21, 2025, 02:08:12 AM by Velleos »
Logged

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.98a] bananaFactory v.20250416
« Reply #14 on: April 20, 2025, 04:32:34 PM »

Can anyone provide download links to the .97a versions of the banano forge, factory, and library mods?  .98a is running considerably worse for me but I still want to try these mods out.
i think these were the last versions before 0.98? not sure tho
they have significantly more bugs that has since been fixed, and as such no support will be provided
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned