Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 6 7 [8] 9 10 ... 18

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

Uomoz

  • Admiral
  • *****
  • Posts: 2663
  • 'womo'dz
    • View Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #105 on: October 06, 2013, 03:29:28 PM »

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.

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.
« Last Edit: October 06, 2013, 03:32:11 PM by Uomoz »
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #106 on: October 06, 2013, 04:33:50 PM »

  • 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
'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.

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 :)

  • 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.
Sounds appropriate in gameplay and lore sense, hard to believe Sector factions would leave a working autofab with reverse-engineering capabilities lying around unused ...

I haven't finished writing the lore, but the Omnifactory was abandoned before the Collapse and none of the current factions even know that it exists. It hasn't been rediscovered since then because the radiation from the star it orbits blocks sensors from detecting it. Pretty much the only way you could find it is if you had a navigation chart leading you to it.

I was joking with the 'only appears when near' comment, but I would like a way to prevent players from simply jumping to every system and checking the map to find it. This station is intended to be a late-game acquisition, but since at the moment end-game is only a few hours after start-game that's not really feasible right now. Eventually there will be a quest chain where you discover the Omnifactory's location, but that's far in the future.

Quote
  • 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.
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.

I'm not set on accidents, but they would be avoidable if they were added. I haven't really fleshed out that part of the concept besides crew doing something other than just being a requirement to use the factory.

Quote
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.

Good point. I'd like to avoid forcing the player to babysit the factory, especially since the size of the sector will only increase from this point on and constantly running back and forth will become even more of a chore.

Then again, if it follows the same costs as crew on ships that's only 1 supply/day per 100 crew.

Quote
  • 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.
So long as I can order 40 railguns at a time :D

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.

Sorry, that was poorly phrased. By 'attempt', I mean it would start construction, but it could fail if you decided to borrow some supplies for your fleet while it was working. ;)

I absolutely loathe when success or failure comes down to a throw of the dice, so you shouldn't worry about that sort of thing.

Quote
  • 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.
'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.

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.

It's designed to be somewhat more expensive than simply buying ships since you're guaranteed to have them 'in stock' (for lack of a better phrase). It won't be that much more expensive though, especially since one of the upgrades for the Omnifactory is cheaper repairs (it is a factory, after all). Much like in the current version of this mod, the primary balancing factor will be time.


I only started working on this within the last week so there are a lot of rough spots. The concept will likely change radically between now and release. :)
Logged

dreamixpl

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #107 on: October 06, 2013, 10:51:06 PM »

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.
Logged

Gabriel_Braun

  • Commander
  • ***
  • Posts: 154
    • View Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #108 on: October 09, 2013, 09:45:04 AM »

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.

Dreamxpl this is a bit of a nightmare of toe-stepping for everyone involved.  Something like this is usually far better dealt with using private messages to avoid any creative conflict of interest, I'll do so in a few minutes ;)
« Last Edit: October 09, 2013, 09:47:35 AM by Gabriel_Braun »
Logged

drakhades

  • Ensign
  • *
  • Posts: 39
    • View Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #109 on: October 14, 2013, 05:10:37 AM »

i'd also like to add an omnifactory to ironclads (i searched all the systems and it's not there)

could you let me know too plz?
Logged

Cyan Leader

  • Admiral
  • *****
  • Posts: 718
    • View Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #110 on: November 28, 2013, 12:27:51 PM »

Is it possible to add default inventory that is always sold at Omnifactories?
Logged

HELMUT

  • Admiral
  • *****
  • Posts: 1363
    • View Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #111 on: November 28, 2013, 03:28:59 PM »

Probably. You can also install the restock mod which will add all the weapons in the game in every stations (including Omnifactory) and a bunch of basic ships.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #112 on: November 29, 2013, 12:26:42 AM »

Is it possible to add default inventory that is always sold at Omnifactories?

The current version is inventory based, so all you would need to do is put one of each ship/weapon you wanted into the station's cargo and call the factory's checkCargo() method to force it to analyse them. :)
Logged

Sir Goose

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #113 on: January 04, 2014, 11:32:36 AM »

Hey killer mod! I feel like any Starsector play through requires it. I have a question though, it is possible to edit the omnifactory in anyway? I've looked at the files in the mod and I'm not sure if editing the plugin file or the settings file does anything.

Edit: should have read the mod description lol....
Still does editing the plugin file affect anything? And how does editing the numbers affect the omnifactory? Like do larger numbers mean faster analyzation and production times or is it the other way around?
« Last Edit: January 04, 2014, 11:42:20 AM by Sir Goose »
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #114 on: January 04, 2014, 12:59:04 PM »

The settings file is only used when the factory is first created, so any changes require a new game or some save-file editing. Here's what each of the options does:
  • showAddedCargo controls whether to show a report for every item created. It's extremely spammy once you have a decent number of blueprints, so it's turned off by default.
  • showAnalysisComplete controls whether to show a report when a new good has finished its analysis phase (meaning it's ready to start production).
  • showLimitReached, if true, prints a message when a good reaches its max stack size.
  • removeBrokenGoods will cause the factory to delete blueprints from its memory if there was an error when spawning the good. It's not really that useful right now.
  • shipAnalysisTimeMod, weaponAnalysisTimeMod, shipProductionTimeMod and weaponProductionTimeMod control the speed of each phase. It's a modifier against the default production time, so 0.5 means that phase takes half as long. The default time is kind of arbitrary, but:
    • For ships, it's calculated as ((fleetPointValue * hullSize) / 2) * SHIP_PRODUCTION_TIME_MOD or hullSize * 3 days per hull produced, whichever is higher. Hullsize goes from 1-5 (fighters to capitals), meaning regardless of settings a fighter will never go below 3 days per wing, and a capital ship requires at least 15 days. Analysis can go as low as one day, however.
    • For weapons, it's calculated as cargoSpacePerWeapon * WEAPON_PRODUCTION_TIME_MOD days per weapon produced.
  • requiredCrewToFunction will make it so the Omnifactory needs crew to produce things. Crew experience level doesn't matter as it's intended to represent a menial labor force. This is set to zero by default.
  • requiredSuppliesPerDay and requiredFuelPerDay, if set, will make the Omnifactory require that many resources each day to function. Set to zero by default.
  • maxHullsPerFighter/Frigate/Destroyer/Cruiser/Capital and maxStacksPerWeapon control the maximum number of a good that can be in the Omnifactory's inventory before it stops producing more.

The core of the mod hasn't really changed much since the original release for .54a over a year ago, and it's not very flexible. That's one of the major reasons I'm planning on a rewrite.
« Last Edit: January 04, 2014, 01:01:39 PM by LazyWizard »
Logged

JDCollie

  • Captain
  • ****
  • Posts: 261
    • View Profile
    • My Youtube Channel
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #115 on: April 22, 2014, 03:37:48 AM »

So I'm using Omnifactory 1.8b with Uomoz 1.2 and LazyLib 1.8c, and my omnifactory is exhibiting some strange behavior. (I started a new game with all three mods installed.)  The omnifactory will not allow me to buy or sell from it, though it gives me messages about the items it is processing/manufacturing/full of. Prior to joining a faction, it tells me that "This station is for faction use only". After joining a faction, it gives me the same message, and if I activate the Voidwalker fortress, the Omnifactory tells me that "The station's weapons activate."

I'm not really sure what's going on, but I'd love to be able to buy and sell to this lovely little station. Also interesting, I know some of the NPC factions have been selling stuff there, as I've seen a Blackrock Convoy stop there. (I also am currently affiliated with BRDY in that save as well.)

Any ideas?  ???
Logged

HELMUT

  • Admiral
  • *****
  • Posts: 1363
    • View Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #116 on: April 22, 2014, 05:05:46 AM »

Not compatible with Uomoz's mod, i think that's intended.
Logged

JDCollie

  • Captain
  • ****
  • Posts: 261
    • View Profile
    • My Youtube Channel
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #117 on: April 22, 2014, 09:36:23 AM »

Not compatible with Uomoz's mod, i think that's intended.
Oh  :'(

EDIT:

Wait a sec . . .

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.

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.
HAH!!!  Well, okay, maybe not hah, but yeah, it looks like compatibility may eventually be supported :D
« Last Edit: April 22, 2014, 10:14:55 AM by JDCollie »
Logged

JDCollie

  • Captain
  • ****
  • Posts: 261
    • View Profile
    • My Youtube Channel
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #118 on: April 25, 2014, 08:15:54 PM »

So, I've been tinkering around with the Omnifactory trying to get it compatible with Uomoz's sector (UsS) and I've . . . well, failed. Sorta. Buuuut I've figured out why it doesn't work, if anyone is interested.

Reader beware, for through 'yonder spoiler lies a wall o' text that may steal thy very heart from thee! Click at thy own risk.
Spoiler
For some context:
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.

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.



STATION_FACTION = Neutral
I found that the reason the Omnifactory gives stuff away for free when STATION_FACTION is set to "Neutral" is because UsS interprets the station's status in precisely the same way it does an abandoned station. The code that creates the dialog options for stations has the conditional  station.getFaction().isNeutralFaction() which, if it returns "True" then provides the "Stash Items / Ships" and "Take Items / Ships" options. As the only stations in Uomoz that belong to the "neutral" faction are abandoned, this normally isn't a problem. (Well, unless you're a neutral omnifactory trying to make a buck.)

STATION_FACTION = Player
Currently, if STATION_FACTION is set to "Player" the omnifactory will tell you that "This station is for faction use only," and give you the option to join its faction if you don't belong to any others. If you do join, the only option the station then gives is to leave the faction. The reason for this behavior is because the UsS code which produces the dialog options recognizes the station's faction as non-independent and with neutral reputation (0.0) toward the player, allowing the player to approach, but the subsequent elseif statements don't have a contingency for a non "Neutral" faction station with neutral reputation toward the player that isn't independent or voidwalker (there is no else statement to fall back on). Thus, the code skips the trade, sell, stash, etc options and jumps down to the "Join Faction" option.

You are allowed to join the faction because UsS evaluates factions based upon their display name. This works fine most of the time except that stations which belong to the "player" faction have the display name of "Your" (I.E., "Your Omnifactory", just like "Pirate Scout" or "Independent Trader"). Next the joinFaction() method changes the player's faction to "Your". The dialog method still evaluates the first part the same, as no reputation changes have occurred, but now you belong to the station's faction, and are given the "Leave Faction" option. If chosen, it sets the player's faction back to "Player", again with no reputation changes.

STATION_FACTION = Player & Player has 1.0 reputation with Faction "Player"
"Well, if the problem is with the player having neutral reputation with their own faction, why don't I just set player reputation to 1.0?" I thought to myself. So I did, and it worked beautifully. The station dialog method evaluated just fine, assuming that I belonged to the faction in question (since you can't really get 1.0 rep with a faction in UsS without joining them) and gave me the normal trading options for a faction station. The problem was when I activated the Voidwalker Theta station. The activateTheta() method complies a list of all of the factions in the game and sets (not adjusts) them all to -2 except the neutral faction, which it sets to 0. This means I can't just create a cheeky little Omnifactory faction and dodge the voidwalker bullet, sadly.

[close]

Long story short, the only way I can see to get the Omnifactory to fully function both before and after voidwalker activation without editing save files (or having Uomoz change his code >.<) is to find a way to get the station.getFaction().isNeutralFaction() call to return false, while still keeping the Omnifactory's station id as "neutral", and Neutral's reputation with the player positive. Since I don't know how .isNeutralFaction() is evaluated, I can't guess at how to mess with it.

(And yes, I know LazyWizard and Uomoz probably already know all of this, but I didn't so, yeah. >.>  )




However, my afternoon was not a complete failure, as I did manage to get the omnifactory to spawn in hyperspace, rather than choosing some potentially hostile sector to spawn in. (Yes, okay, fine. I know it's not that impressive a feat, but keep in mine that literally everything I know about Java I learned in the past four hours trying to get these two mods to cooperate.  :-[  )



So, here's the modified code for OmniFacModPlugin.java

(I apologize in advance for any atrocities of coding I may have committed. Seriously, the number of ClassNotFound exceptions I went through before I figured out what constructors are and what they do was truly unholy.) >.<

Code
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();
        }
    }
}

Here's the file if you don't feel like copy/pasting: OmniFacModPlugin.java   Just open the link, right click on the page, select "save as" and then save the document as OmniFacModPlugin.java and stick in your omnifactory folder under Omnifactory\data\scripts\world. I recommend you backup the original file before you replace it with this one because, you know, I modified it, and that probably isn't a good thing. :P


Voidwalker activation will still make the Omnifactory hostile, but you can fix this by editing your save file. Look for the following lines:
Code
<factionIdOne>player</factionIdOne>
<factionIdTwo>player</factionIdTwo>
<value>-2.0</value>
Change the -2.0 to 1.0 and you're golden again.





Anyway, there's the tale of my trials and tribulations while stumbling through the valley of code. Sorry for the spoilered wall of text, please don't hate me  :-[



EDIT: By default, Uomoz's compresses save files into a non-editable format. To get around this, you'll need to go into Uomoz's config files under "Starsector\mods\UomozSector\data\config" and find settings.json

Change "compressSaveGameData":true, to "compressSaveGameData":false, then go back into the game, load your save, save your save (preferably as a copy), and then try to edit it again :)
« Last Edit: April 26, 2014, 12:01:58 AM by JDCollie »
Logged

Ishman

  • Captain
  • ****
  • Posts: 269
    • View Profile
Re: [0.6.1a] Omnifactory v1.8b (released 2013-10-05)
« Reply #119 on: April 25, 2014, 09:27:13 PM »

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.

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!
Logged
Pages: 1 ... 6 7 [8] 9 10 ... 18