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 3 ... 18

Author Topic: [0.7.2a] Omnifactory v1.11c (released 2017-03-16)  (Read 152544 times)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
[0.7.2a] Omnifactory v1.11c (released 2017-03-16)
« on: December 27, 2012, 02:02:18 AM »

Omnifactory
A not very lore-friendly mini-mod
Download version 1.11c (mirror) (requires LazyLib)
View progress and source code on BitBucket
Supports Version Checker


What this mod does:
This mod adds an advanced autofactory orbiting a random planet in a random system. Any weapon or ship you store here will be disassembled and analyzed by the factory's replicators. After analysis is complete (provided the good isn't restricted), the factory will then begin producing more of this good over time. You will need to buy any Omnifactory-produced goods at a vastly inflated price.

This gives players a choice when they find a rare ship or weapon - use it immediately and risk losing it in battle, or bring it to the Omnifactory and be forced to wait for the production run to finish, but never need to worry about finding it again.

Production time is based on the size and complexity of the blueprint. By default, weapons require a flat 5/10/20 days depending on weapon size, whereas ships use a formula based on fleet point cost and hull size - from 3 days for a Talon wing to two months for a Paragon. The factory will produce up to half of a stack of each weapon in its memory banks (20/10/5 S/M/L), and 3/3/2/2/1 of each fighter/frigate/destroyer/cruiser/capital ship. Other mods that include this factory may have different production times and limits. You can customize the Omnifactory yourself by editing data/config/omnifactory/omnifac_settings.json (any changes also affect existing games).

This mod should be compatible with all mods, including total conversions, as long as they allow you to trade with stations.

All modders have my permission to include this in their own mods. You'll only need the submarket entry and the contents of the jars folder to use the station, and a "jars" entry in your mod_info.json poining to Omnifactory.jar. You will also need to let your users know they need LazyLib active. I've tried to keep this as simple to implement as possible - just call OmniFacModPlugin.initOmniFac(SectorEntityToken token) with the station you want to act as a factory as the argument.

If a modder wishes to prevent specific mod weapons/ships from being replicated, they can copy the CSVs in data/config/omnifactory/ to their mod folder and add any IDs they want blocked.


Changelog:
Spoiler
Quote
Version 1.11c (March 16, 2017)
================================
Switched version file hosting to Bitbucket

 Version 1.11b (October 12, 2015)
==================================
Fixed spam if a restricted ship/item somehow ended up in the Omnifactory's cargo
Implemented support for multiple Omnifactories:
 - Change "numberOfFactories" in data/config/omnifactory/omnifac_settings.json;
   "randomStartingLocation" must be true for this setting to work
initOmnifactory() now sets up the storage submarket if it's not present

 Version 1.11 (July 11, 2015)
==============================
(this version is not save compatible with earlier versions)
Rewrote Omnifactory as a submarket plugin
Random starting location is disabled by default
Fixed resources being illegal even if the setting to make them required is on
Fixed weapon production limits being ludicrously high post-market update
Added console command OmnifacStatus, shows location and data for all factories
Added getKnownShips(), getKnownWings(), getKnownWeapons()
Added BlueprintData interface:
 - int getDaysToAnalyze()
 - int getDaysToCreate()
 - int getLastUpdate()
 - String getId()
 - String getDisplayName()
 - int getLimit()
 - int getTotal()
 - boolean isAnalyzed()
 - setAnalyzed(boolean isAnalyzed)

 Version 1.10c (January 29, 2015)
==================================
Added "randomStartingLocation" setting, enabled by default:
 - With this set to true, the Omnifactory will orbit a random planet or star
   in a random system, so long as that planet doesn't have a station already
Default sell price is now almost always 0, except with very large transactions

 Version 1.10b (January 9, 2015)
=================================
Added "ignoreGoodRestrictions" setting, allows replication of restricted goods
You can no longer sell restricted or already known ships/weapons to the factory
Omnifactory now includes a storage tab, unlocked by default
Added a description for the Omnifactory submarket
Buy/sell replaced with appropriate verbs based on tariff setting

 Version 1.10 (January 5, 2015)
================================
(this version is not save compatible with earlier versions) (duh)
Compatibility fixes for new economy/market systems
Added Version Checker support
When added to existing save, syncs factory heartbeat to beginning of next day
Settings are global, defined in data/config/omnifactory/omnifac_settings.json
Restricted goods are defined in a CSV, merged so multiple mods can add to list
Fixed ancient bug where the wrong numbers were shown for analysis phase duration
Added "omnifactoryTariff" setting, defaults to 100%
Balance tweaks (mostly due to above default tariff):
 - You no longer earn a profit when selling to the Omnifactory
 - The prices of produced ships/weapons are vastly inflated
 - Resources still cost almost nothing to store (as there's no market demand)
Added to OmniFacSettings:
 - Set<String> getRestrictedWeapons()
 - Set<String> getRestrictedShips()
 - float getOmnifactoryTariff()

 Version 1.9 (May 9, 2014)
===========================
Many changes to the mod's code, but it should be backwards-compatible with 1.8b
New methods in OmniFac:
 - New constructor: OmniFac(SectorEntityToken station, String settingsFile)
 - OmniFacSettings getSettings()
 - String getSettingsFile()
 - setSettingsFile(String settingsFile)
New class OmniFacSettings:
 - boolean shouldShowAddedCargo()
 - boolean shouldShowAnalysisComplete()
 - boolean shouldShowLimitReached()
 - boolean shouldRemoveBrokenGoods()
 - float getShipAnalysisTimeMod()
 - float getWeaponAnalysisTimeMod()
 - float getShipProductionTimeMod()
 - float getWeaponProductionTimeMod()
 - int getRequiredCrew()
 - float getRequiredSuppliesPerDay()
 - float getRequiredFuelPerDay()
 - int getMaxHullsPerFighter()
 - int getMaxHullsPerFrigate()
 - int getMaxHullsPerDestroyer()
 - int getMaxHullsPerCruiser()
 - int getMaxHullsPerCapital()
 - float getMaxStacksPerWeapon()
Settings are reloaded from JSON every session instead of stored in the savefile
 (this also means individual settings cannot be changed through code anymore,
 and must be set as a whole using setSettingsFile() and another settings JSON)
Removed all other settings-related methods in OmniFac, with the exception of
 adding/removing restricted ships and weapons
The Omnifactory now removes weapons from ships before it consumes them
Fixed the Omnifactory and fighter wing names being displayed incorrectly

 Version 1.8b (October 5, 2013)
================================
Omnifactory is now player-owned (fixes free transfer bug, requires new game)

 Version 1.8 (September 26, 2013)
==================================
(this version is not save compatible with earlier versions)
Fixed memory leak with factory lookup, updated to new ModPlugin system
Added loadSettingsFromJSON(String filePath)
 - see data/config/omnifac_settings.json for the default Omnifactory settings
 - modders can call a different settings file for each factory

 Version 1.7c (March 19, 2013)
===============================
Fixed divide-by-zero issue when using low custom analysis time modifiers

 Version 1.7b (March 9, 2013)
==============================
Fixed NPE with addRestrictedShip() and addRestrictedWeapon()

 Version 1.7 (March 8, 2013)
=============================
(this version is not save compatible with earlier versions)
Unknown goods now must be analyzed before production can begin:
 - Adds time delay before the production run will start
 - Defaults to 1x the production time of the good, can be changed by mods
 - Set the modifier to zero to disable good analysis completely
Mods can now prevent certain ships and goods from being added to the factory.
New settings:
 - setShowAnalysisComplete(boolean showAnalysisComplete)
   Sets if the station broadcasts when good analysis is done. Defaults to true.
 - setShipAnalysisTimeModifier(float modifier)
   Sets ship blueprint analysis time modifier. Defaults to 1.0.
 - setWeaponAnalysisTimeModifier(float modifier)
   Sets weapon blueprint analysis time modifier. Defaults to 1.0.
 - addRestrictedShip(String hullId)
   Adds a hull type to the restricted list (can't be replicated).
 - removeRestrictedShip(String hullId)
   Removes a hull type from the restricted list.
 - addRestrictedWeapon(String weaponId)
   Adds a weapon to the restricted list (can't be replicated).
 - removeRestrictedWeapon(String weaponId)
   Removes a weapon from the restricted list.
Other new methods:
 - boolean isRestrictedShip(FleetMemberAPI ship)
   Returns true if this ship can't be reproduced by the Omnifactory.
 - boolean isRestrictedWeapon(CargoStackAPI stack)
   Returns true if this weapon can't be reproduced by the Omnifactory.

 Version 1.6b (March 1, 2013)
==============================
Removed bundled LazyLib, now requires LazyLib utility mod active to function

 Version 1.6 (February 10, 2013)
================================
(this version is not save compatible with earlier versions)
Updated bundled version of LazyLib
'Added <x> goods' message no longer appear by default (re-enable in AddOmniFac)
Fixed 'limit reached' message being shown multiple times for the same good

 Version 1.5 (February 2, 2013)
================================
Fixed bug when parsing hull names of certain mods' ships
Lowered the maximum number of hulls produced (was 6/5/4/3/2, now 3/3/2/2/1)
Lowered the maximum stack size of weapons produced (was 40/20/10, now 20/10/5)

 Version 1.4 (January 20, 2013)
================================
Updated bundled version of LazyLib
This is now a utility mod (can be run alongside total conversions)
Generator will attempt to pick the best spot for the station in TC systems

 Version 1.3 (January 2, 2013)
===============================
(this version is not save compatible with earlier versions)
This mod now requires LazyLib (included in the download)
Omnifactory notifications are more organized and much less spammy now.
Fixed rare divide by zero bug with certain modded fighters.
New setting:
 - setMaxStacksPerWeapon(float maxStacks)
   Sets how many stacks of each weapon to produce. Defaults to 1.0.

 Version 1.2 (January 1, 2013)
===============================
(this version is not save compatible with earlier versions)
Moved mod code into a jar (better type-safety, faster loading)
The omnifactory can now optionally require fuel, supplies and crew to function.
Added warnings when factory requirements are not met.
New methods for controlling factory settings (these are all per station):
 - setShowAddedCargo(boolean showAddedCargo)
   Sets if 'X added to station' messages appear. Defaults to true.
 - setShowLimitReached(boolean showLimitReached)
   Sets if 'Limit for X reached' messages appear. Defaults to true.
 - setRemoveBrokenGoods(boolean removeBrokenGoods)
   Sets if buggy goods should be removed from memory. Defaults to false.
 - setShipProductionTimeModifier(float modifier)
   Sets ship production time modifier. Defaults to 1.0.
 - setWeaponProductionTimeModifier(float modifier)
   Sets weapon production time modifier. Defaults to 1.0.
 - setRequiredCrew(int requiredCrew)
   Sets the minimum amount of crew for the factory to function. Defaults to 0.
 - setRequiredSuppliesPerDay(float suppliesPerDay)
   Sets factory supply consumption per day. Defaults to 0.
 - setRequiredFuelPerDay(float fuelPerDay)
   Sets factory fuel consumption per day. Defaults to 0.
 - setMaxHullsPerFighter(int maxHulls)
   Sets how many of each fighter to produce. Retroactive. Defaults to 6.
 - setMaxHullsPerFrigate(int maxHulls)
   Sets how many of each frigate to produce. Retroactive. Defaults to 5.
 - setMaxHullsPerDestroyer(int maxHulls)
   Sets how many of each destroyer to produce. Retroactive. Defaults to 4.
 - setMaxHullsPerCruiser(int maxHulls)
   Sets how many of each cruiser to produce. Retroactive. Defaults to 3.
 - setMaxHullsPerCapital(int maxHulls)
   Sets how many of each capital ship to produce. Retroactive. Defaults to 2.
Other new methods:
 - boolean isUnknownShip(FleetMemberAPI ship)
   Returns true if this station has never encountered this ship's base hull.
 - boolean isUnknownWeapon(CargoStackAPI stack)
   Returns true if this station has never encountered this weapon.

 Version 1.1 (January 1, 2013)
===============================
Fixed nasty crash bug with non-standard variant IDs
Added station tracking and lookup:
 - List OmniFac.getFactories()
 - OmniFac OmniFac.getFactory(SectorEntityToken station)
 - boolean OmniFac.isFactory(SectorEntityToken station)

 Version 1.0 (December 27, 2012)
=================================
Initial release
[close]
« Last Edit: March 16, 2017, 09:11:17 PM by LazyWizard »
Logged

arcibalde

  • Admiral
  • *****
  • Posts: 1730
    • View Profile
Re: Omnifactory v1.0 (.54, released 2012-12-27)
« Reply #1 on: December 27, 2012, 02:04:39 AM »

Nice :)
Logged
Creator of:
Relics MOD - vanilla balanced - Campaign integrated
Vanilla addon MOD - vanilla balanced - Campaign integrated
Project ONI MOD - mission only

theSONY

  • Admiral
  • *****
  • Posts: 673
  • Not a single Flux given
    • View Profile
Re: Omnifactory v1.0 (.54, released 2012-12-27)
« Reply #2 on: December 27, 2012, 02:11:04 AM »

i don't have time to check the mod right now (<sad face>) BUT . . . is it required any man power or supplies for production or is it just a fun (testing) mod ?
Logged
-the ABOMINATION - in progress

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Omnifactory v1.0 (.54, released 2012-12-27)
« Reply #3 on: December 27, 2012, 02:27:28 AM »

i don't have time to check the mod right now (<sad face>) BUT . . . is it required any man power or supplies for production or is it just a fun (testing) mod ?

No, but you do have to buy the produced goods from the station at full price. :)
Logged

maximilianyuen

  • Captain
  • ****
  • Posts: 358
    • View Profile
Re: Omnifactory v1.0 (.54a, released 2012-12-27)
« Reply #4 on: December 27, 2012, 06:49:14 AM »

great is it does work as what i am imagining :D

right now I have to mod the save file to add custom ship and weapon everytime, with this it will make life much easier

what's the max quantity of the same item will appear given time? and what's the max number of individual item?
Logged
Fleet construction in progress.

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Omnifactory v1.0 (.54a, released 2012-12-27)
« Reply #5 on: December 27, 2012, 07:32:04 AM »

Hmm. This might be interesting to use :)

hadesian

  • Admiral
  • *****
  • Posts: 2058
  • It's been one of those days...
    • View Profile
Re: Omnifactory v1.0 (.54a, released 2012-12-27)
« Reply #6 on: December 27, 2012, 02:22:54 PM »

Very very interesting... this is actually what I'd like to see as 'secret' tech you find in systems in teh full game.
Logged
Changes as of May 24, 2013
  • Reinvented Starsector.
  • That is all.

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Omnifactory v1.0 (.54a, released 2012-12-27)
« Reply #7 on: December 27, 2012, 03:38:40 PM »

Interesting. :) I'm sure a lot of us will find this useful and fun, thanks!
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

ValkyriaL

  • Admiral
  • *****
  • Posts: 2145
  • The Guru of Capital Ships.
    • View Profile
Re: Omnifactory v1.0 (.54a, released 2012-12-27)
« Reply #8 on: December 27, 2012, 03:42:21 PM »

This might just give my shipyard station a purpose, if i can somehow have the shipyard build ships instead of convoys delivering to it.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Omnifactory v1.0 (.54a, released 2012-12-27)
« Reply #9 on: December 27, 2012, 05:27:36 PM »

what's the max quantity of the same item will appear given time? and what's the max number of individual item?

For weapons, one item per 5/10/20 days (based on weapon size), and the station will stop producing the item once it reaches a full stack (so 40/20/10, again dependent on weapon size).

For ships, it produces up to 6/5/4/3/2 of each fighter/frigate/destroyer/cruiser/capital it has encountered. Right now, production time uses the following formula: one hull per (fleet point cost * hull size) / 2 days, with a minimum production time of hull size * 3 days.

Each good has its own timer, so while it might take twenty days to make a large weapon, you could have several different weapons being produced at the same time. The same goes for ships.

This might just give my shipyard station a purpose, if i can somehow have the shipyard build ships instead of convoys delivering to it.

I haven't commented the code yet (I just started on this mod yesterday), so if you need help figuring anything out, feel free to ask. :)
« Last Edit: December 27, 2012, 05:30:57 PM by LazyWizard »
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Omnifactory v1.0 (.54a, released 2012-12-27)
« Reply #10 on: December 27, 2012, 05:30:42 PM »

What mod class is it?  Utility, Total Conversion, or a regular mod? ;D It's new and untested, but it sounds good.  Just starting a new game with it, I started with my trusty Wolf, bought a Lasher and turned the Wolf in to the autofactory.  MOAR WOLVES!!!  The enemy shall be crushed. >:D
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Omnifactory v1.0 (.54a, released 2012-12-27)
« Reply #11 on: December 27, 2012, 05:39:38 PM »

What mod class is it?  Utility, Total Conversion, or a regular mod? ;D It's new and untested, but it sounds good.  Just starting a new game with it, I started with my trusty Wolf, bought a Lasher and turned the Wolf in to the autofactory.  MOAR WOLVES!!!  The enemy shall be crushed. >:D

It's a regular mod for now since the generator assumes Corvus exists (and thus wouldn't be compatible out of the box with certain total conversions). With the modding API changes in the next hotfix I will be able to upgrade it to a utility mod.

Also, you can never have enough Wolves! ;D

Very very interesting... this is actually what I'd like to see as 'secret' tech you find in systems in teh full game.

I'm planning on maintaining this past the multi-system update. It would make a good hidden bonus in some out-of-the-way sector. :)

I was considering writing lore for the mod - it could be an illegal pre-Collapse installation used by some corporation to reverse engineer their competitors' products. Thoughts?
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1060
    • View Profile
Re: Omnifactory v1.0 (.54a, released 2012-12-27)
« Reply #12 on: December 27, 2012, 08:06:08 PM »

What mod class is it?  Utility, Total Conversion, or a regular mod? ;D It's new and untested, but it sounds good.  Just starting a new game with it, I started with my trusty Wolf, bought a Lasher and turned the Wolf in to the autofactory.  MOAR WOLVES!!!  The enemy shall be crushed. >:D

It's a regular mod for now since the generator assumes Corvus exists (and thus wouldn't be compatible out of the box with certain total conversions). With the modding API changes in the next hotfix I will be able to upgrade it to a utility mod.

Also, you can never have enough Wolves! ;D

Very very interesting... this is actually what I'd like to see as 'secret' tech you find in systems in teh full game.

I'm planning on maintaining this past the multi-system update. It would make a good hidden bonus in some out-of-the-way sector. :)

I was considering writing lore for the mod - it could be an illegal pre-Collapse installation used by some corporation to reverse engineer their competitors' products. Thoughts?

I wouldnt called an illegal but maybe in hands of the factory being in the hands of a neutral faction (payed by heg) are the only reason why there isnt a full scale war on the system making it the main reason why the tri are in the system (protecting their interest and maybe acquire them as well), since it is a factory with a huge benefit to "steal" other factions tech.
« Last Edit: December 27, 2012, 08:10:45 PM by silentstormpt »
Logged

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Omnifactory v1.0 (.54a, released 2012-12-27)
« Reply #13 on: December 28, 2012, 09:45:22 AM »

Added your script to my Ironclads. Now let`s the alien ship production begin!!!

Dr. Death[Lexx]

  • Lieutenant
  • **
  • Posts: 88
  • Solar Engineer
    • View Profile
Re: Omnifactory v1.0 (.54a, released 2012-12-27)
« Reply #14 on: December 30, 2012, 04:17:17 AM »

LazyWizard...this is great, downloading, testing, enjoying it.
Logged
Pages: [1] 2 3 ... 18