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
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 ?
what's the max quantity of the same item will appear given time? and what's the max number of individual item?
This might just give my shipyard station a purpose, if i can somehow have the shipyard build ships instead of convoys delivering to it.
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
Very very interesting... this is actually what I'd like to see as 'secret' tech you find in systems in teh full game.
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! ;DVery 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?
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.
Say, LazyWizard. Could you maybe merge messages? Have a single message that says something like "Omnifactory inventory update: blah_laser (12/20), some_missile_thing (4/10), ...", etc?
Not 100% sure how the message display deals with line-wrapping, so there might still need to be some cleverness to deal with that, but it'd help cut down on the spamminess of the mod's messages, without actually cutting out information.
Maybe even add a mid level of output, where it just says "Omnifactory constructed new weapons" or the like?
It might also be neat if you could specify supplies or fuel per weapon / ship constructed, rather than per day. Though that might get unreasonably clunky / unintuitive in terms of what order things get constructed in when there aren't enough supplies to build everything at once, so it may not be worth the trouble.
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.
New version is up. Notifications are organized alphabetically and much less spammy now. Get it here (http://www.mediafire.com/file/7el7c0c2up30r38/Omnifactory_1.3.zip).
Changelog:SpoilerQuoteVersion 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.[close]
It's a lot more difficult to develop a game compare to modding, especially regarding creating extensive, big free Apis.New version is up. Notifications are organized alphabetically and much less spammy now. Get it here (http://www.mediafire.com/file/7el7c0c2up30r38/Omnifactory_1.3.zip).
Changelog:SpoilerQuoteVersion 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.[close]
I am willing to pay again if starfarer will updated at this speed XD
New version is up. Notifications are organized alphabetically and much less spammy now. Get it here (http://www.mediafire.com/file/7el7c0c2up30r38/Omnifactory_1.3.zip).
Changelog:SpoilerQuoteVersion 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.[close]
I am willing to pay again if starfarer will updated at this speed XD
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
Will this mod work with other mods in terms that I put a ship/weapon from a different mod into the factory, will it produce that ship/weapon?
Does the station have a limit to the number of different things it can produce? like 20 different ships and 40 different weapons, after that anything new you sell to the station will not get produced?
How does the priorities work? if I put in 3 ships and 4 weapons at the same time, what will it produce first? will it produce everything at the same time? or does it prioritize based on complexity?
easy weapons/ships first, once those are done starts producing harder things etc.?
definately a very interesting mod that I will be downloading and trying.. now :P
Will this mod work with other mods in terms that I put a ship/weapon from a different mod into the factory, will it produce that ship/weapon?
Does the station have a limit to the number of different things it can produce? like 20 different ships and 40 different weapons, after that anything new you sell to the station will not get produced?
How does the priorities work? if I put in 3 ships and 4 weapons at the same time, what will it produce first? will it produce everything at the same time? or does it prioritize based on complexity?
easy weapons/ships first, once those are done starts producing harder things etc.?
definately a very interesting mod that I will be downloading and trying.. now :P
1.yes it does ... at least for weapons i can confirm.
think it does for hulls , too
2. Everything will be produced at the same time but takes a different time to produce it ( small goes faster then medium or large mounts )
cool addition, will be my 2nd mod which will be permanently activ.
Will this mod work with other mods in terms that I put a ship/weapon from a different mod into the factory, will it produce that ship/weapon?
Does the station have a limit to the number of different things it can produce? like 20 different ships and 40 different weapons, after that anything new you sell to the station will not get produced?
How does the priorities work? if I put in 3 ships and 4 weapons at the same time, what will it produce first? will it produce everything at the same time? or does it prioritize based on complexity?
easy weapons/ships first, once those are done starts producing harder things etc.?
definately a very interesting mod that I will be downloading and trying.. now :P
1.yes it does ... at least for weapons i can confirm.
think it does for hulls , too
2. Everything will be produced at the same time but takes a different time to produce it ( small goes faster then medium or large mounts )
cool addition, will be my 2nd mod which will be permanently activ.
1. Yes it does for hull too, I've been happily replicating Neutrino's Super bomber ;D
May I implement this in U'sC? :)
Does the station have a limit to the number of different things it can produce? like 20 different ships and 40 different weapons, after that anything new you sell to the station will not get produced?
May I implement this in U'sC? :)
Feel free. :)Does the station have a limit to the number of different things it can produce? like 20 different ships and 40 different weapons, after that anything new you sell to the station will not get produced?
There's no limit on how many blueprints it can store. However, the station is still bound by the cargo limits of vanilla Starsector, so it will stop producing new resources if its inventory becomes completely full (this is very visible with ships; I may have to lower the default number produced per hull for the next patch).
is it possible to remove a blueprint from the omnifactory?
What happens if there is already something orbiting opposite the abandoned storage facility? I'm using Fleet Control Mod (http://fractalsoftworks.com/forum/index.php?topic=3758.0) which places a civilian mining station opposite the abandoned storage facility. Would the omnifactory just occupy the same space?
Is there any way to change this? :Di 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. :)
Is there any way to change this? :Di 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. :)
Is there any way to change this? :Di 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. :)
package data.scripts.world;
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.SectorGeneratorPlugin;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import java.util.*;
@SuppressWarnings("unchecked")
public class AddOmniFac implements SectorGeneratorPlugin
{
private static final String STATION_NAME = "Omnifactory";
private static final String STATION_FACTION = "neutral";
// Responsible for creating the spawnpoint and adjusting factory settings
// If you wish to modify a default, uncomment and change the relevent line
private static void initStation(SectorEntityToken station, StarSystemAPI system)
{
OmniFac factory = new OmniFac(station);
// Should the player be able to freely take goods from the factory?
//station.getCargo().setFreeTransfer(false);
// Sets if 'X added to station' messages appear. Defaults to true.
//factory.setShowAddedCargo(true);
// Sets if 'Limit for X reached' messages appear. Defaults to true.
//factory.setShowLimitReached(true);
// Sets if buggy goods should be removed from memory. Defaults to false.
//factory.setRemoveBrokenGoods(false);
// Sets ship production time modifier. Defaults to 1.0.
//factory.setShipProductionTimeModifier(1.0f);
// Sets weapon production time modifier. Defaults to 1.0.
//factory.setWeaponProductionTimeModifier(1.0f);
// Sets the minimum amount of crew for the factory to function. Defaults to 0.
//factory.setRequiredCrew(0);
// Sets factory supply consumption per day. Defaults to 0.
//factory.setRequiredSuppliesPerDay(0f);
// Sets factory fuel consumption per day. Defaults to 0.
//factory.setRequiredFuelPerDay(0f);
// Sets how many of each fighter to produce. Retroactive. Defaults to 3.
//factory.setMaxHullsPerFighter(3);
// Sets how many of each frigate to produce. Retroactive. Defaults to 2.
//factory.setMaxHullsPerFrigate(2);
// Sets how many of each destroyer to produce. Retroactive. Defaults to 2.
//factory.setMaxHullsPerDestroyer(2);
// Sets how many of each cruiser to produce. Retroactive. Defaults to 1.
//factory.setMaxHullsPerCruiser(1);
// Sets how many of each capital ship to produce. Retroactive. Defaults to 1.
//factory.setMaxHullsPerCapital(1);
// Sets how many stacks of each weapon to produce. Defaults to 0.5.
//factory.setMaxStacksPerWeapon(0.5f);
system.addSpawnPoint(factory);
}
// This will try to create the station in the following places (in order):
// 1. If the system is Corvus, at Corvus IV
// 2. If not Corvus, a planet with no existing satellites
// 3. If no free planets, orbit adjacent the Abandoned Storage Facility
// 4. If no Abandoned Storage Facility, orbiting the system's star
private static void createStation(StarSystemAPI system)
{
SectorEntityToken station;
// We are in the Corvus system (not a TC), so use Corvus IV
if ("Corvus Star System".equals(system.getName()))
{
station = system.addOrbitalStation(
system.getEntityByName("Corvus IV"), 315,
300, 50, STATION_NAME, STATION_FACTION);
}
// Not in Corvus, find a good candidate for station placement
else
{
SectorEntityToken tmp;
List planets = new ArrayList(system.getPlanets());
List stations = system.getOrbitalStations();
// Why is this even IN there?
planets.remove(system.getStar());
// Remove all planets that have stations around them
for (int x = 0; x < stations.size(); x++)
{
tmp = (SectorEntityToken) stations.get(x);
if (tmp.getOrbit() != null)
{
planets.remove(tmp.getOrbit().getFocus());
}
}
// Are there any free planets?
if (!planets.isEmpty())
{
station = system.addOrbitalStation(
(SectorEntityToken) planets.get(0), 315,
300, 50, STATION_NAME, STATION_FACTION);
}
else
{
tmp = system.getEntityByName("Abandoned Storage Facility");
// Does the Abandoned Storage Facility exist?
if (tmp != null)
{
station = system.addOrbitalStation(tmp.getOrbit().getFocus(),
315, 300, 50, STATION_NAME, STATION_FACTION);
}
else
{
// I give up, just use the star
if (system.getStar() != null)
{
station = system.addOrbitalStation(system.getStar(), 315,
7250, 50, STATION_NAME, STATION_FACTION);
}
// Just in case somehow there's no sun in this system
else
{
station = system.addOrbitalStation(system.createToken(0f, 0f),
0, 0, 50, STATION_NAME, STATION_FACTION);
}
}
}
}
// Finally, create the factory
initStation(station, system);
}
@Override
public void generate(SectorAPI sector)
{
List systems = sector.getStarSystems();
// This generator ran before SectorGen, delay until a system is created
if (systems.isEmpty())
{
Timer deferredAdd = new Timer(true);
deferredAdd.scheduleAtFixedRate(new DeferredAdd(sector), 1000, 1000);
}
else
{
StarSystemAPI system = (StarSystemAPI) systems.get(0);
createStation(system);
}
}
private static class DeferredAdd extends TimerTask
{
SectorAPI sector;
public DeferredAdd(SectorAPI sector)
{
this.sector = sector;
}
@Override
public void run()
{
CampaignFleetAPI player = sector.getPlayerFleet();
if (player != null)
{
StarSystemAPI system = (StarSystemAPI) player.getContainingLocation();
if (system != null)
{
createStation(system);
this.cancel();
}
}
}
}
}
I once thought about making a form of economics mod to produce weapons and ships, and this might help me work on it again (depending on time and how well I can implement my ideas).
Edit: In case I actually get it done, is it okay if I modify the scripts (credit will ofcouse be given for the original work)?
1.4 is up. This should be save-compatible with the previous version. Get it here (http://www.mediafire.com/file/v72jf1afbhlwgd2/Omnifactory_1.4.zip).
This update brings built-in compatibility for total conversions. For non-Corvus systems, the station will try to find the best place to orbit. The generator uses the following logic:
- If the system is Corvus, orbit Corvus IV
- If not Corvus, find a planet with no existing satellites
- If there are no free planets, orbit opposite the Abandoned Storage Facility
- If there is no Abandoned Storage Facility, orbit the system's star
Changelog:QuoteVersion 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
1.4 is up. This should be save-compatible with the previous version. Get it here (http://www.mediafire.com/file/v72jf1afbhlwgd2/Omnifactory_1.4.zip).
This update brings built-in compatibility for total conversions. For non-Corvus systems, the station will try to find the best place to orbit. The generator uses the following logic:
- If the system is Corvus, orbit Corvus IV
- If not Corvus, find a planet with no existing satellites
- If there are no free planets, orbit opposite the Abandoned Storage Facility
- If there is no Abandoned Storage Facility, orbit the system's star
Changelog:QuoteVersion 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
LW what should i do with my Ironclads and Omnifactory? Since its an utility mod now - i probably should remove the code that my mod is currently using? Its from the very first version of Omnifactory.
I`m using a custom star system and it has some empty planets in it, so your station will probably spawn without any problems if used as an utility mod.
Out of curiosity, why did you use advance as the loop (called every tick), instead of spawnFleet (called once a day)?
Oh, I didn't notice that xD. I got another question if you don't mind. Never having worked with java, how do i go about modifying OmniFac.java? If I add the .jar to netbeans, it says that it is read only, and if I "unpack" the .jar and add the .java to the data\scripts\world folder, then i get a compile error saying generics are not supported.Out of curiosity, why did you use advance as the loop (called every tick), instead of spawnFleet (called once a day)?
The Omnifactory actually uses its own implementation of SpawnPointPlugin instead of extending BaseSpawnPoint. If you look at BaseSpawnPoint's source you can see it also uses advance() to determine when to call its heartbeat method, but it includes some things that are unnecessary for this mod (like fleet tracking).
Creating my own implementation of SpawnPointPlugin both allows me to cut out that unnecessary overhead, and ensures my mod will still function even if BaseSpawnPoint's code changes at a later date.
Oh, I didn't notice that xD. I got another question if you don't mind. Never having worked with java, how do i go about modifying OmniFac.java? If I add the .jar to netbeans, it says that it is read only, and if I "unpack" the .jar and add the .java to the data\scripts\world folder, then i get a compile error saying generics are not supported.
Oh, I didn't notice that xD. I got another question if you don't mind. Never having worked with java, how do i go about modifying OmniFac.java? If I add the .jar to netbeans, it says that it is read only, and if I "unpack" the .jar and add the .java to the data\scripts\world folder, then i get a compile error saying generics are not supported.
Generics and for-each loops won't work with Janino, the compiler Starfarer uses for its mod scripts, which is why I implemented this mod as a jar. :)
You'll need to make a Netbeans project with the source (include LazyLib.jar and starfarer.api.jar as libraries), then clean & build (shift+F11) to create an updated jar. You can find that jar in the 'dist' folder of your Netbeans project. Just replace the jar in the mod folder with the updated version and you should be good to go. :)
Edit: a quicker way to get the source would be to download it directly from the repository, from this link (https://bitbucket.org/LazyWizard/omnifactory/get/default.zip).
aww...it cant produce antediluvian v.v...
aww...it cant produce antediluvian v.v...
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)
Twas streaming with this and Thaago's restock mod - I think there's an incompatibility, because it was basically eating what the restock mod gave it and spamming the log.
Can we have an option to announce capacity reached juts once until stick depletes (or just once, full stop) the mod gets very spammy once you have a bunch of ships and weapons added over a long period of time
factory.setShowAddedCargo(true);
cant create antediluvian ships at all except fighters...
Can we have an option to announce capacity reached juts once until stick depletes (or just once, full stop) the mod gets very spammy once you have a bunch of ships and weapons added over a long period of time
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.7 (March XX, 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
Mods can now prevent certain ships and goods from being added to the factory.
New settings:
- 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.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.
Nice! Is there any possibility of a moddable %chance of failed item analysis (with blueprint loss)?
Right now putting an item in the Omnifac is 100% profitable investment, you have nothing to lose as you'll simply multiply every rare item you can find. Setting an analysis failure chance would pose risks and interesting decisions in front of the player when the item he has to analyze is unique :).
Version 1.7b (March 9, 2013)
==============================
Fixed NPE with addRestrictedShip() and addRestrictedWeapon()
Version 1.7c (March 19, 2013)
===============================
Fixed divide-by-zero issue when using low custom analysis time modifiers
Feature suggestion: a "failed analysis" parameter (tier based would be even better), for more hardcore implementations of the omnifactory. As it stands right now the station is a sure investment, with no diminished returns. Adding the risk factor would:
1) Add more "unique" feel to ships, as in the vanilla background.
2) Put more choices in the players hand: a rare ship should be a very important asset to find, and not easily replaceable. Should you risk it or use it?
Optional request: for the "failed analysis" event to be hardcoded for each ship the player acquires so it's not reloadable.
That's the point, you bet the ship. Also maybe the omnifac could give you back the thing if a failed analysis occur.
That's the point, you bet the ship. Also maybe the omnifac could give you back the thing if a failed analysis occur.
i think i found how to solve your problem.
when you bring a ship to the omnifactory, it has a chance of scanning improperly. if it does fail to scan, that ship in particuliar can never be scanned again.
"but then someone can just come back with another hull to try again !" and thats where the magic occurs ! that would mean that only common/easily obtainable ships will be have more occasions to be scanned while harder to get ships (paragon, or the unsung to take your example) will take some time before another attempt can be done.
how does that sound ?
That's the point, you bet the ship. Also maybe the omnifac could give you back the thing if a failed analysis occur.
i think i found how to solve your problem.
when you bring a ship to the omnifactory, it has a chance of scanning improperly. if it does fail to scan, that ship in particuliar can never be scanned again.
"but then someone can just come back with another hull to try again !" and thats where the magic occurs ! that would mean that only common/easily obtainable ships will be have more occasions to be scanned while harder to get ships (paragon, or the unsung to take your example) will take some time before another attempt can be done.
how does that sound ?
I suspect that it would be hard for the station or game to tell whether the player is bringing in a different ship or not.
I'm really not a fan of random chance in games, so I'd be reluctant to add failure rates.
What if the factory required multiple hulls to analyze before it can decipher the blueprints? Say one hull for fighters/frigates, two for destroyers/cruisers, three for capitals? It would make adding high-tier ships to the factory a much larger sacrifice than it is currently, but you could still have a healthy supply of low-level ships.
And I think if you somehow manage to capture/purchase three Paragons and are willing to give them up, you deserve to have a steady supply later on. :)
I'm really not a fan of random chance in games, so I'd be reluctant to add failure rates.
What if the factory required multiple hulls to analyze before it can decipher the blueprints? Say one hull for fighters/frigates, two for destroyers/cruisers, three for capitals? It would make adding high-tier ships to the factory a much larger sacrifice than it is currently, but you could still have a healthy supply of low-level ships.
And I think if you somehow manage to capture/purchase three Paragons and are willing to give them up, you deserve to have a steady supply later on. :)
So what are the blueprints that you are able to buy for? ???Those are a feature of Uomoz's Corvus, not this mod. :)
I bought them and now they are just sitting in my inventory
My bad, i think i misinterpreted how it works. Thanks for the clarification.
And a last question on the matter.. does the station resupply Marines? How often? I'm hostile'd to everyone (hardcore ;p) and i'm running out of them to capture enemy ships.
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
<owner>
<id>player</id>
</owner>
Yes, just follow the instructions from my previous post, except replace 'player' with 'neutral'. Also, I'm glad to hear that someone actually uses the 'costs supplies' option. :)Right, I was wondering if I can set that in the settings JSON so it starts out that way in new campaigns :D
'Only appear when you get close' is cute in design phase but frustrating and unfun in gameplay phase, generally. It works for 'secret room with weapon behind hidden door' but even that is cheap design cop-out to actually designing clever secrets behind geometry in level where you would not look around, for example.
- The Omnifactory will float around a random star from the list of all generated systems (excluding the player's spawn location). You'll have to hunt it down before you can use it. I'm tempted to make it only appear when you get close to its location. ;D
Sounds appropriate in gameplay and lore sense, hard to believe Sector factions would leave a working autofab with reverse-engineering capabilities lying around unused ...
- The station starts out neutral and non-functional and is only good for item storage at first. You will need crew, supplies, and lots of time to bring it back to an operational state. Once it's repaired it will switch ownership to your faction and you can use the factory functions.
Industrial accident mechanic ... I'm generally very against RNG shafting you throughout normal course of play. Chance of that should only be if state of omnifac is not ideal in the first place, ie, not enough crew to supervise safely -> accident chance.
- Produced goods are free, but crew and supplies are required to construct them in the first place. Higher level crew will either work slightly faster, or be more survivable if an industrial accident mechanic makes it in.
So long as I can order 40 railguns at a time :D
- Weapons and ships are no longer automatically produced. Instead you place an order with the factory, and if it has the required supplies it will attempt to create those goods.
'Heavily' is how much though. Many ships cost in the order of 75% as much to fully repair as they do to construct, and up to 25% of hull cost to bring to Veteran CR from mothballed.
- Newly created ships are mothballed and heavily damaged. This represents the Omnifactory's inability to make perfect replicas of a ship (it's not in great shape after sitting abandoned for 200+ years), meaning your crew has to go over new ships with a fine-toothed comb to find and fix any construction errors.
- The Omnifactory will be upgradeable. Basic upgrades will be things like faster production, lower supply costs, less damage to created ships, that sort of thing. There are some other, more interesting upgrades, but they definitely count as feature creep and probably won't make it into the next version. One upgrade I do hope makes it in is remote communication with the Omnifactory, so you can place an order from another system and pick it up later.
'Only appear when you get close' is cute in design phase but frustrating and unfun in gameplay phase, generally. It works for 'secret room with weapon behind hidden door' but even that is cheap design cop-out to actually designing clever secrets behind geometry in level where you would not look around, for example.
- The Omnifactory will float around a random star from the list of all generated systems (excluding the player's spawn location). You'll have to hunt it down before you can use it. I'm tempted to make it only appear when you get close to its location. ;D
Secondly, 'random star' is fine in general but finer control will be needed ... restrict to systems with station owned by faction, one of a list of system, specific system, etc, for mods :)Sounds appropriate in gameplay and lore sense, hard to believe Sector factions would leave a working autofab with reverse-engineering capabilities lying around unused ...
- The station starts out neutral and non-functional and is only good for item storage at first. You will need crew, supplies, and lots of time to bring it back to an operational state. Once it's repaired it will switch ownership to your faction and you can use the factory functions.
Industrial accident mechanic ... I'm generally very against RNG shafting you throughout normal course of play. Chance of that should only be if state of omnifac is not ideal in the first place, ie, not enough crew to supervise safely -> accident chance.
- Produced goods are free, but crew and supplies are required to construct them in the first place. Higher level crew will either work slightly faster, or be more survivable if an industrial accident mechanic makes it in.
It might be cute to make the crew at the factory require supplies/day, and have accidents if there are none, but that becomes too involved, imo.
So long as I can order 40 railguns at a time :D
- Weapons and ships are no longer automatically produced. Instead you place an order with the factory, and if it has the required supplies it will attempt to create those goods.
Also, 'attempt'? RNG creep does not fun gameplay mechanics make. If I have enough crew and supplies then it should build it 100% of the time.
'Heavily' is how much though. Many ships cost in the order of 75% as much to fully repair as they do to construct, and up to 25% of hull cost to bring to Veteran CR from mothballed.
- Newly created ships are mothballed and heavily damaged. This represents the Omnifactory's inability to make perfect replicas of a ship (it's not in great shape after sitting abandoned for 200+ years), meaning your crew has to go over new ships with a fine-toothed comb to find and fix any construction errors.
- The Omnifactory will be upgradeable. Basic upgrades will be things like faster production, lower supply costs, less damage to created ships, that sort of thing. There are some other, more interesting upgrades, but they definitely count as feature creep and probably won't make it into the next version. One upgrade I do hope makes it in is remote communication with the Omnifactory, so you can place an order from another system and pick it up later.
If I have to pay twice as much for a ship made at omnifac I and most players will hunt stations instead, yes, because convenience of made-to-order ship is offset by inconvenience of finding initial ship, paying for it, carrying it, acquiring cash/supplies for construction, cash/supplies for repair and CR recovery resulting in net negative in both cost and convenience.
50% extra cost total? Maybe at the start, unupgraded, but even that's high considering everything else necessary to build and fly combat-ready ship out of there.
Please help :0
I want to add Omnifactory to one system (Argus) in new Ironclads mod, but i don't know how to "just add an OmniFac spawnpoint to the system with a station as the argument". Can someone write this code somewhere? That would save me (and propably not only me) a lot of trail and errors.
Is it possible to add default inventory that is always sold at Omnifactories?
Not compatible with Uomoz's mod, i think that's intended.Oh :'(
Unlike what Taverius said, I'd like some form of random events that would require player attention, even at full efficiency, being the omnifac lost technology and such. I also like the fact that the ships are produced in a barely working state (damaged) adding some cost to the player choice. Very good job.HAH!!! Well, okay, maybe not hah, but yeah, it looks like compatibility may eventually be supported :D
Personal note, making it not exclusive to the player would be amazing.
EDIT: this revision of the Omnifac could easily be core in future UsS versions.
I uploaded a quick fix for the 'free transfer' issue that's making the Omnifactory so horribly broken post-.6a. Download version 1.8b here (http://www.mediafire.com/download/1h8m3avk0wc88mh/Omnifactory_1.8b.zip).
This is literally a one-word change. All it does is assign the Omnifactory to the player faction instead of neutral. If you don't want to re-download the mod, you can just open OmniFacModPlugin.java and change STATION_FACTION to "player".
This requires a new game to take effect, but if you're comfortable editing save files you can change the station's ownership in your current save by doing the following:
- Open up your save's campaign.xml (make a backup first!)
- Search for <name>Omnifactory</name>
- Go up a few lines to the section that says something like <owner reference="../../CampaignOrbitalStation[4]/owner"></owner>
- Replace the entire owner section with the following:
Code<owner>
<id>player</id>
</owner>
That should change the station's ownership to the player faction in your current game.
package data.scripts.world;
import com.fs.starfarer.api.BaseModPlugin;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.LocationAPI;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import com.fs.starfarer.api.campaign.FactionAPI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import data.scripts.world.OmniFac;
//I apologize to LazyWizard for anything terrible I may have done to his sexy, sexy mod :(
public class OmniFacModPlugin extends BaseModPlugin
{
private static final String OMNIFAC_ENABLED_FLAG = "lw_omnifac_enabled";
private static final String STATION_NAME = "Omnifactory";
private static final String STATION_FACTION = "player"; //This is case sensitive, just so you know. Yeah, I found that out the hard way. NullPointerException my ass. >:(
private static void initStation(SectorEntityToken station, SectorAPI sector)
{
OmniFac factory = new OmniFac(station);
FactionAPI player = Global.getSector().getFaction("player");
player.adjustRelationship("player",1);
factory.loadSettingsFromJSON("data/config/omnifac_settings.json");
sector.addScript(factory);
}
private static void createStation(SectorAPI sector)
{
LocationAPI asd = sector.getHyperspace();
SectorEntityToken a = asd.createToken(1900, 3700);
SectorEntityToken station = asd.addOrbitalStation(a, 90, 1, 999, STATION_NAME, STATION_FACTION);
initStation(station, sector);
}
private static void initOmniFac()
{
SectorAPI sector = Global.getSector();
createStation(sector);
}
@Override
public void onEnabled(boolean wasEnabledBefore)
{
Map data = Global.getSector().getPersistentData();
if (!data.containsKey(OMNIFAC_ENABLED_FLAG))
{
data.put(OMNIFAC_ENABLED_FLAG, true);
initOmniFac();
}
}
}
<factionIdOne>player</factionIdOne>
<factionIdTwo>player</factionIdTwo>
<value>-2.0</value>
That's some excellent deductive work there! I went through the same problem of trying to integrate omnifactory but gave up after changing it's faction to player and discovering that didn't work. Where others fear to tread, wot wot.Just so you know, if you change the station faction to independent, DO NOT capitalize the "i". I spent about half an hour trying to figure out how in the heck I had broken my own changes (which had worked just fine on my other computer) until I realized I had added "Independent" rather than "independent". Go figure.
I will gladly use your modification as simply giving myself weapons and ships with the console isn't as much fun as collecting them through your own actions. Much appreciated!
I want to add that UsS will eventually support mods like this, even If they are basically the bane of all the work on the pacing I made in UsS. I "just" need to change some stuff on the StationDialogue code, but it's not a priority.I hope I didn't make it sound in my post like a fix was something easy to do, because I really do respect your work and your mod, and I recognize that every little change like that is just one more thing on what is likely a huge bucket list of stuff you want to do with it. That, and with the bounty changes you've been making, your station dialog files probably look a lot different from the ones I'm looking at.
private void createInitialOptions() {
options.clearOptions();
if ((station.getFaction().isNeutralFaction()) && !station.getFullName().contains("Void Walkers"))
{
private void createInitialOptions() {
options.clearOptions();
if ((station.getFaction().isNeutralFaction()) && (!station.getFullName().contains("Void Walkers") && (!station.getFullName().contains("Omnifactory")))
{
} else if ((player.getRelationship(station.getFaction().getId()) >= 0) && (!station.getFullName().contains("Void Walkers"))
&& ((station.getFaction().getRelationship(playerFleet.getFaction().getId()) == 1) || (station.getFaction().getId().equals("independent")))) {
} else if ((player.getRelationship(station.getFaction().getId()) >= 0) && (!station.getFullName().contains("Void Walkers"))
&& ((station.getFaction().getRelationship(playerFleet.getFaction().getId()) == 1) || (station.getFaction().getId().equals("independent")) || (station.getFullName().contains("Omnifactory")))) {
LW sent me a simple fix that I didn't think of, Omnifac will work (without any of the station dialogue additions I made though) from the next DEV onward. Nice!:D Yay!
LW sent me a simple fix that I didn't think of, Omnifac will work (without any of the station dialogue additions I made though) from the next DEV onward. Nice!Will it become part of the Uomoz Sector mod and orbit the voidwalker station? because that would be awesome to have your own factory that actually makes stuff.
LW sent me a simple fix that I didn't think of, Omnifac will work (without any of the station dialogue additions I made though) from the next DEV onward. Nice!Will it become part of the Uomoz Sector mod and orbit the voidwalker station? because that would be awesome to have your own factory that actually makes stuff.
Will it become part of the Uomoz Sector mod and orbit the voidwalker station?
I want to add that UsS will eventually support mods like this, even If they are basically the bane of all the work on the pacing I made in UsS. I "just" need to change some stuff on the StationDialogue code, but it's not a priority.Pacing is certainly good and all, but sometimes you just want a to make a bigger fleet and see how you do against the others.
LW sent me a simple fix that I didn't think of, Omnifac will work (without any of the station dialogue additions I made though) from the next DEV onward. Nice!Will it become part of the Uomoz Sector mod and orbit the voidwalker station? because that would be awesome to have your own factory that actually makes stuff.
Well but the VW already do that D:, also you wouldn't be able to pay the ships!
You can adjust the maximum number of a given ship class (I.E., frigates, destroyers, etc) in Omnifactory's config file. The default starts frigates out at a max of three, which always felt a bit excessive to me, so I always trim it down to one.I'm pretty sure he means preventing the omnifactory from producing certain ships. Like stopping production of the shuttles that don't work as tugs so they do not fill up the ship shop.
You can adjust the maximum number of a given ship class (I.E., frigates, destroyers, etc) in Omnifactory's config file. The default starts frigates out at a max of three, which always felt a bit excessive to me, so I always trim it down to one.
Settings are set once at creation and stored in your savefile, so there isn't a way to change them without modifying your save file right now. If you're comfortable with that, you'd open up saves/save_<NAME>_########/campaign.xml (make a backup first!) and search for <data.scripts.world.OmniFac>. The settings for that factory should be just below this. You can also remove blueprints here, but you should be very careful when doing so. It's easy to break your entire save if you miss a closing tag somewhere.
I'm planning on releasing a backwards-compatible 1.9 update that brings the Omnifactory up-to-date with the current API (among other things, it'd use the correct name for ships and also strip/analyse the weapons of ships it consumes). Changing the production options to be per-session instead of set at creation and saved forever shouldn't be too hard.
That in mind, removing blueprints should just prevent the factory from producing any additional craft of that type, without affecting current inventory or production of other ships, right? If that's the case, I'll have some fun buying up all the unwanted surplus and crashing them into enemy fleets.
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
It was a request by (I think) Uomoz for a way to block the Omnifactory from reproducing certain goods. Since Uomoz's Sector doesn't include the Omnifactory anymore I don't think anyone's actually using those methods. Which is a good thing, actually, since I'll probably be replacing them soon with a CSV now that that's possible (yeah, this mod is ancient).
99632 [Thread-5] INFO com.fs.starfarer.loading.LoadingUtils - Loading JSON from [data/config/omnifac_settings.json]
99632 [Thread-5] INFO data.scripts.world.OmniFac - Loaded settings successfully
99760 [Thread-5] ERROR com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO - java.lang.NoSuchMethodError: data.scripts.world.OmniFac.loadSettingsFromJSON(Ljava/lang/String;)V
java.lang.NoSuchMethodError: data.scripts.world.OmniFac.loadSettingsFromJSON(Ljava/lang/String;)V
at exerelin.OutSystemStationConstructionFleet$1.run(OutSystemStationConstructionFleet.java:79)
at com.fs.starfarer.campaign.ai.CampaignFleetAI.advance(Unknown Source)
at com.fs.starfarer.campaign.fleet.CampaignFleet.advance(Unknown Source)
at com.fs.starfarer.campaign.BaseLocation.advance(Unknown Source)
at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
at com.fs.starfarer.campaign.A.o00000(Unknown Source)
at com.fs.starfarer.B.ØÓÒ000(Unknown Source)
at com.fs.oOOO.A.Ã’00000(Unknown Source)
at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
An Omnifactory update is somewhere on the (very long) list of things to do. :)YUSH!
An Omnifactory update is somewhere on the (very long) list of things to do. :)
Sure, I'll try to release a quick compatibility fix today if I can. No new features, though.
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.10 is finally up, get it here (https://bitbucket.org/LazyWizard/omnifactory/downloads/Omnifactory%201.10.zip) (mirror (http://www.mediafire.com/download/xfv0s8sv0zc9es9/Omnifactory_1.10.zip)). This should work with existing saves. This mod requires LazyLib (http://fractalsoftworks.com/forum/index.php?topic=5444.0) to function!
The big change in 1.10 is that the Omnifactory is no longer profitable. There's now a 100% tariff by default, so you effectively 'sell' ships/weapons for free and have to buy the reproduced copies at a vastly inflated price. This makes using the Omnifactory much less of a no-brainer than it used to be. It's still horribly broken, but you won't feel compelled to sell everything you find to it anymore. Since there's no market demand normal resources and trade goods are virtually free to buy/sell, so the Omnifactory can still act as a storage facility for them.
I also made it much easier for other modders to prevent specific ships/weapons from being replicated. Just copy the CSVs in data/config/omnifactory/ to your own mod folder and add any IDs you want blocked. :)
Full changelog:QuoteVersion 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()
So if you set the tariff to around 30%, would that mean it costs about as much to get a ship from the omnifactory as it is from that faction?Yes
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.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
This won't change a current save's omnifactory location will it?No, this update only affects new games.
Can omnifactory appear in hyperspace? Just like Zeta Fortress in Uomoz.Not at the moment, but I could add it in as a possibility.
Pretty sure theres config options to make it need crew or supplies or fuel per day already, though I haven't seen them used.Yep, there is. Crew, supplies and fuel can all be made required
Oh lordy how do I find it. I've got every possible faction SS+ supports and already went through every system and didn't see it. Please add a console command?Hm... I remember hearing that neutrino adds a system that doesn't show up on the map. Don't know where it is, though.
VIM doesn't like looking through 900mb xml files so I can't really just look at the save.
runcode SectorEntityToken tmp = (SectorEntityToken) org.lazywizard.omnifac.OmniFac.getFactories().get(0); org.lazywizard.console.Console.showMessage("Omnifactory is orbiting " + tmp.getOrbit().getFocus().getName() + " in " + tmp.getContainingLocation().getName());
Runs great! Unfortunately the OF is in Antioch >_<
Oh well - time to get friendly with the Templars :F
Can you add that as a command the OF adds to CC? Because that would be awesome.
How do I make it work with the options that make the Factory require resources? It won't let me put them into the main inventory (can't replicate), and it won't use anything I put in storage.Sorry, haven't even tried with the latest version - since you have to pay for the original hull/weapon now and then pay twice as much as normal to buy it again it feels plenty punishing enough.
{
"randomStartingLocation":true, # Boolean
"showAddedCargo":false, # Boolean
"showAnalysisComplete":true, # Boolean
"showLimitReached":true, # Boolean
"ignoreGoodRestrictions":true, # Boolean
"removeBrokenGoods":false, # Boolean
"shipAnalysisTimeMod":0.1, # Double
"weaponAnalysisTimeMod":0.1, # Double
"shipProductionTimeMod":0.1, # Double
"weaponProductionTimeMod":0.1, # Double
"requiredCrewToFunction":0, # Integer
"requiredSuppliesPerDay":0.0, # Double
"requiredFuelPerDay":0.0, # Double
"maxHullsPerFighter":3, # Integer
"maxHullsPerFrigate":3, # Integer
"maxHullsPerDestroyer":2, # Integer
"maxHullsPerCruiser":2, # Integer
"maxHullsPerCapital":1, # Integer
"maxStacksPerWeapon":0.5, # Double
"omnifactoryTariff":0.999999 # Double
}
If you sell a ship or weapon to the Omnifactory that it hasn't encountered before, it will destroy it and analyze it over time, creating a blueprint for it. Once analysis is complete the production phase starts and the factory will perpetually try to keep that good in stock.
The factory will produce an unlimited amount of goods, but it halts production of a good if there's a certain amount in cargo already (3/3/2/1/1 fighters/frigates/destroyers/cruisers/capitals, half a stack for weapons). In other words, if you sell it a Wolf it will try to always keep three Wolves in stock. If you sell it every ship in the game, it will still always try to keep three Wolves in stock.
The factory produces one of a good per production cycle, and production times vary based on the complexity of the blueprint. Ships use a formula based on fleet points and hullsize, so a Talon might take a day to analyze and three days to produce each wing, whereas something as complex as a Paragon might take 37 days to analyze and 75 days to produce each hull. Weapon production times are based solely on the size of the weapon.
Blueprints don't affect each other. The production time for an individual blueprint will remain constant no matter how many blueprints you have, and production is always active for any good that isn't at its limit.
Anything produced by the Omnifactory has a huge price markup as a pathetic pretense of balance (even with the downsides it's still basically a cheat mod).
TL;DR: yes, selling something to the Omnifactory will guarantee you always have a reliable (albeit expensive) source for it, given time.
I'm sure it would be difficult to code, but I would love it if we could get a supply based modification to the Omnifactory. What I mean is, you bring the Omnifactory items/ships, and it deconstructs them like normal. However, once it has the blueprints, I think it would be cool if it did not automatically make them, but instead required raw resources. Kind of like a hybrid of the omnifactory and the blueprint system of Uomoz's Sector, albeit without the faction specific materials.
That way you'd actually have to be supplying materials, and you wouldn't just have this magic stockpile. Like I said though, I bet it would take some coding, and sadly I don't have the skills to do it :( (I really wish I did)
I'm sure it would be difficult to code, but I would love it if we could get a supply based modification to the Omnifactory. What I mean is, you bring the Omnifactory items/ships, and it deconstructs them like normal. However, once it has the blueprints, I think it would be cool if it did not automatically make them, but instead required raw resources. Kind of like a hybrid of the omnifactory and the blueprint system of Uomoz's Sector, albeit without the faction specific materials.
That way you'd actually have to be supplying materials, and you wouldn't just have this magic stockpile. Like I said though, I bet it would take some coding, and sadly I don't have the skills to do it :( (I really wish I did)SpoilerThat's actually how it works in the real upcoming rewrite. You bring the Omnifactory ships, it starts analyzing them (this takes much, much longer than in the current version, but every additional ship of that type you sacrifice halves the remaining analysis time), once analysis is complete you have to queue construction manually (requiring supplies plus metal/rare metal/heavy machinery depending on the blueprint). There's an upgrade that allows remote communication with the Omnifactory, so it's not as annoying as it sounds (did I mention the rewrite has an upgrade tree?). Weapons/fighter wings are still auto-produced the same way the current Omnifactory does them because nobody wants to micromanage to that level. :)[close]
Can't tell if this is an April Fools joke or not...
I'm sure it would be difficult to code, but I would love it if we could get a supply based modification to the Omnifactory. What I mean is, you bring the Omnifactory items/ships, and it deconstructs them like normal. However, once it has the blueprints, I think it would be cool if it did not automatically make them, but instead required raw resources. Kind of like a hybrid of the omnifactory and the blueprint system of Uomoz's Sector, albeit without the faction specific materials.
That way you'd actually have to be supplying materials, and you wouldn't just have this magic stockpile. Like I said though, I bet it would take some coding, and sadly I don't have the skills to do it :( (I really wish I did)SpoilerThat's actually how it works in the real upcoming rewrite. You bring the Omnifactory ships, it starts analyzing them (this takes much, much longer than in the current version, but every additional ship of that type you sacrifice halves the remaining analysis time), once analysis is complete you have to queue construction manually (requiring supplies plus metal/rare metal/heavy machinery depending on the blueprint). There's an upgrade that allows remote communication with the Omnifactory, so it's not as annoying as it sounds (did I mention the rewrite has an upgrade tree?). Weapons/fighter wings are still auto-produced the same way the current Omnifactory does them because nobody wants to micromanage to that level. :)[close]
If this isn't April fools, then <3 :D :D :D
I'm sure someone has already asked, but is it possible to choose specifically where the omnifac spawns?
I'm sure someone has already asked, but is it possible to choose specifically where the omnifac spawns?
Ha i was just about a questio about that, wouldlove to have omnifactory next to spawn point.
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.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
The Omnifactory spawned in Corvus, and i've been having problems with it catching me trading with the pirates (who i'm hostile to) and it decreasing my faction relation with "Your". I am somewhat trepidatious about what happens if that ever goes below friendly, especially since console command reports that i can't alter a faction's relation to itself.
Um. Tried the random omnifactory location setting... is it supposed to be able to spawn in close orbit around a star, literally inside the star's corona?That sounds ridiculous, is the star accidentally set as a usable planet?
Solumus (sp?) in corvusUm. Tried the random omnifactory location setting... is it supposed to be able to spawn in close orbit around a star, literally inside the star's corona?That sounds ridiculous, is the star accidentally set as a usable planet?
Also, what is the default location for the factory when random location is disabled?
That sounds ridiculous, is the star accidentally set as a usable planet?
Also, what is the default location for the factory when random location is disabled?
That sounds ridiculous, is the star accidentally set as a usable planet?
It was intentional, corona effects weren't in the game when the spawn logic was written. It's an easy fix. I'll try to get around to it (and a few other suggestions in the last few posts) soon. :)Also, what is the default location for the factory when random location is disabled?
Corvus IV- er, Somnus. Yeah.
i see it has already been mentioned several times before, so sorry if i'm annoying, but would it be possible to allow setting a specific location for the omnifac to spawn? i just use random starting location with a high number now, but still need to rereroll quite a few times whenever i start a new game to get one where i want it, and there's a lot of random omnifacs already floating around in various systems, which looks a bit weird. it gets even worse when i have to do the same thing again whenever i want to use Save Tranfser, as the spawn locations aren't carried over. :/
Maybe you could consider having the Omnifactory have production by-products, as in when you submit weapons and they get processed the factory would produce very basic materials, like excess sheet metal, ores, etc.
It wouldn't offset the price of the weapon, just a nice little bonus for submitting weapons/ships.
Sure, it'll be in the next version.awesome! =)
That sounds ridiculous, is the star accidentally set as a usable planet?
It was intentional, corona effects weren't in the game when the spawn logic was written. It's an easy fix. I'll try to get around to it (and a few other suggestions in the last few posts) soon. :)Also, what is the default location for the factory when random location is disabled?
Corvus IV- er, Somnus. Yeah.
Maybe you could consider having the Omnifactory have production by-products, as in when you submit weapons and they get processed the factory would produce very basic materials, like excess sheet metal, ores, etc.
It wouldn't offset the price of the weapon, just a nice little bonus for submitting weapons/ships.
Hi Wizard,Omnifac already has optional fuel/supply consumption. Making it use other commodities would probably be simple, but given that fuel/supply consumption is already disabled by default I wouldn't count on it being part of the official release.
Do you think it's possible for the next version to get the option to use metals and transplutonics as consumables and AI cores as crew-like requirements ?
Thanks a lot.
I'm in the final stages of testing a completely revamped Omnifactory for .8a. Primary features are AI Core usage for analysis, commodity usage for construction, on-demand rather than passive building, and increased build time based on weapon/wing rarity. Increased build time based on ship rarity is also planned.Any plans to implement the "deal-with-the-devil" part i sketched on my previous post?
No, the intention is for the factory to be balanced as a standalone, although I may switch randomization on by default. I may implement faction shipyards as additional markets on large industrial worlds, but that would be a long term goal.I'm in the final stages of testing a completely revamped Omnifactory for .8a. Primary features are AI Core usage for analysis, commodity usage for construction, on-demand rather than passive building, and increased build time based on weapon/wing rarity. Increased build time based on ship rarity is also planned.Any plans to implement the "deal-with-the-devil" part i sketched on my previous post?
The new mechanics in 0.8 make both acquiring new ships and not losing existing ones far more tenable and does so in balanced manners.i actually used Omnifactory almost exclusively for weapons, not ships. acquiring new ships and replacing lost ones is much easier now thanks to the new salvage mechanics and industry skills, but weapon availability is still just as much of an issue as it was before 0.8 (except for one skill perk that increases drop chance by a bit), unless i missed something.
I'm going to really miss this mod.See:
I'm currently updating at http://fractalsoftworks.com/forum/index.php?topic=12544.0. It's 99% functional, but I still can't figure out how to get the exact resource costs to display.