Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 10 11 [12] 13 14 15

Author Topic: [0.95.1a] Starpocalypse 2.3.2 - more apocalyptic settings  (Read 150766 times)

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #165 on: February 15, 2022, 07:26:28 AM »

A small bugfix version is out. Enjoy.

Quote
- Fix Nexerlin alliance state (commission check in Military Market).
- Fix game crash in ship damager when minDmods is equal maxDmods.
Logged

CapitanIncognito

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #166 on: February 18, 2022, 03:11:15 PM »

I like the idea of this mod, but I feel like I get most of my capitals/cruisers by finding derelicts. Do you know if there's any mod that reduces the number of large derelicts available and/or makes it so they only show up a certain distance from the core? I feel like it would make sense for nearby systems to have been largely picked clean of anything good by scavengers.

The main thing I'm trying to solve is the issue that I don't seem to have a mid-game in any of my playthroughs. It's always accumulate a few destroyers and maybe 1 cruiser, then stumble upon a derelict Legion and suddenly experience a massive power jump.
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #167 on: February 19, 2022, 01:01:22 PM »

If you could honour this one with my humble request, how do you switch between your two market scripts without requiring two separate CSVs?

I wish to imitate it so I can have a Faction use a custom market of their own and still maintain compatibility.

SpartanXZero

  • Ensign
  • *
  • Posts: 22
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #168 on: February 20, 2022, 01:53:56 AM »

I'm enjoying the scarcity that this mod offers. I've done my own little sub edits to the dials for fine tune adjustments to cushion it a bit.

I was curious regarding how Black Markets handle ships and dmods?
Is it the same ratio of % for d-mods that the open market/faction yards offer?

If it is, is it possible to create a separate calculation for BM's for condition of ships for sale?
Logged

SpaceDrake

  • Admiral
  • *****
  • Posts: 516
  • Piloting space mecha for fun and profit(?)
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #169 on: February 20, 2022, 08:16:06 PM »

So it's been a bit since I posted, and I have one final query: can shy_black_market be set up as a separate descriptor in submarkets.csv in the current version (to give a shy'd out BM its own description) like it could in 2.0, or is that functionality gone?

Otherwise... it's all what I hoped it could be. Thank you for working so hard on this, Jaghaimo; I know putting up with all the requests must have been a pain. I'm looking forward to what other ideas or mods you have in store!
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #170 on: February 25, 2022, 12:45:42 AM »

If you could honour this one with my humble request, how do you switch between your two market scripts without requiring two separate CSVs?

I wish to imitate it so I can have a Faction use a custom market of their own and still maintain compatibility.

Have a look how I got optional Nexerelin compatibility done in RegulatedMilitaryMarket: https://github.com/jaghaimo/starpocalypse/blob/master/src/starpocalypse/submarket/RegulatedMilitaryMarket.java#L74

This means you need to include starpocalypse.jar during compilation, but it is not needed during runtime. Basically, you want to use composition and do something like this:

Code
public class YunruMarket extends BaseSubmarketPlugin {

    private BaseSubmarketPlugin starpocalypsePlugin;

    public void init(SubmarketAPI submarket) {
super.init(submarket);
  if (Global.getSettings().getModManager().isModEnabled("starpocalypse")) {
              /* RegulatedOpenMarket will be loaded only on first use, since Starpocalypse is loaded we can do this */
              starpocalypsePlugin = new RegulatedOpenMarket();
              starpocalypsePlugin.init(submarket);
        }
    }

    /* now in your code, for each functionality you want to support */
    @Override
    public void updateCargoPrePlayerInteraction() {
        if (starpocalypsePlugin != null) {
           starpocalypsePlugin.updateCargoPrePlayerInteraction();
        } else { /* in some cases you want this to be else, in some you want it to always run after (or before) Starpocalypse's implementation
           /* either your code or base implementation, or a mix? */
           super.updateCargoPrePlayerInteraction();
        }
    }
}
« Last Edit: February 25, 2022, 12:48:44 AM by Jaghaimo »
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #171 on: February 25, 2022, 12:52:48 AM »

I was curious regarding how Black Markets handle ships and dmods?
Is it the same ratio of % for d-mods that the open market/faction yards offer?

If it is, is it possible to create a separate calculation for BM's for condition of ships for sale?

It handles the ships in the same way as Open Market. There is one min-max value of d-mods, and any pristine ship that has no d-mods will have a random number of them added.

What do you mean by separate calculation? Each submarket to have own min and max number of d-mods? If so, yes - it is possible. I will be adding an option to have min set to 0 as well in the next version.


So it's been a bit since I posted, and I have one final query: can shy_black_market be set up as a separate descriptor in submarkets.csv in the current version (to give a shy'd out BM its own description) like it could in 2.0, or is that functionality gone?

It is possible. What type of description would you like? As a matter of fact, the behaviour should not have changed since 2.0 (custom description, with extra paragraph if shy black market is on). What are you seeing, and what were you expecting to see?
Logged

Vundaex

  • Commander
  • ***
  • Posts: 147
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #172 on: February 28, 2022, 11:57:54 AM »

I love the idea of this mod, but how compatible is it with other mods adding new content? (you probably already answered this question many times before so I apologize)
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #173 on: March 01, 2022, 06:49:46 AM »

This mod replaces vanilla implementations of Open, Black, and Military markets. Same as Nexerelin. It implements Nexerelin functionality for Military Market (commission check for alliances), but DOES NOT implement optional Nexerelin functionality of doubling number of weapons and LPCs (because the point of this mod is to make it scarce in the first place). As far as I know, Nexerelin is the only mod that replaces vanilla markets. You may consider this mod compatible.

From coding point of view it is compatible with all mods. From a gameplay point of view, it might cause some odd situations. For example, imagine a mod that adds a combat ship that can only be purchased at Open Market, never is part of any fleet, and does not show up as derelicts anywhere... With Military Regulations, that ship will now never be purchasable from Open Market, thus not acquirable. You may consider this mod incompatible.

So you really need to understand what the mods you play with do, and whether this mod will break them, and if yes, is it within expectations and if it is acceptable.

Hope that helps :)
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #174 on: March 01, 2022, 07:16:10 AM »

If you could honour this one with my humble request, how do you switch between your two market scripts without requiring two separate CSVs?

I wish to imitate it so I can have a Faction use a custom market of their own and still maintain compatibility.

Have a look how I got optional Nexerelin compatibility done in RegulatedMilitaryMarket: https://github.com/jaghaimo/starpocalypse/blob/master/src/starpocalypse/submarket/RegulatedMilitaryMarket.java#L74

This means you need to include starpocalypse.jar during compilation, but it is not needed during runtime. Basically, you want to use composition and do something like this:

Code
public class YunruMarket extends BaseSubmarketPlugin {

    private BaseSubmarketPlugin starpocalypsePlugin;

    public void init(SubmarketAPI submarket) {
super.init(submarket);
  if (Global.getSettings().getModManager().isModEnabled("starpocalypse")) {
              /* RegulatedOpenMarket will be loaded only on first use, since Starpocalypse is loaded we can do this */
              starpocalypsePlugin = new RegulatedOpenMarket();
              starpocalypsePlugin.init(submarket);
        }
    }

    /* now in your code, for each functionality you want to support */
    @Override
    public void updateCargoPrePlayerInteraction() {
        if (starpocalypsePlugin != null) {
           starpocalypsePlugin.updateCargoPrePlayerInteraction();
        } else { /* in some cases you want this to be else, in some you want it to always run after (or before) Starpocalypse's implementation
           /* either your code or base implementation, or a mix? */
           super.updateCargoPrePlayerInteraction();
        }
    }
}
So would I be correct in saying this should work to let a replacement market that allows Blueprints to be learned from Pirate Military markets to also have all Starpocalypse features?
Code
package data.scripts.markets;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.CargoStackAPI;
import com.fs.starfarer.api.campaign.FactionAPI;
import com.fs.starfarer.api.campaign.PlayerMarketTransaction;
import com.fs.starfarer.api.campaign.SpecialItemPlugin;
import com.fs.starfarer.api.campaign.econ.SubmarketAPI;
import com.fs.starfarer.api.campaign.impl.items.BlueprintProviderItem;
import com.fs.starfarer.api.impl.campaign.DelayedBlueprintLearnScript;
import com.fs.starfarer.api.impl.campaign.ids.Factions;
import com.fs.starfarer.api.impl.campaign.submarkets.BaseSubmarketPlugin;
import com.fs.starfarer.api.impl.campaign.submarkets.MilitarySubmarketPlugin;

import starpocalypse.submarket.RegulatedMilitaryMarket;

public class YunruLearningMilitaryMarket extends MilitarySubmarketPlugin {
   
private BaseSubmarketPlugin starpocalypsePlugin;

    public void init(SubmarketAPI submarket) {
super.init(submarket);
  if (Global.getSettings().getModManager().isModEnabled("starpocalypse")) {
              /* RegulatedOpenMarket will be loaded only on first use, since Starpocalypse is loaded we can do this */
              starpocalypsePlugin = new RegulatedMilitaryMarket();
              starpocalypsePlugin.init(submarket);
        }
    }

@Override
    public void updateCargoPrePlayerInteraction() {
        if (starpocalypsePlugin != null) {
           starpocalypsePlugin.updateCargoPrePlayerInteraction();
}
super.updateCargoPrePlayerInteraction();
}

    @Override
public void reportPlayerMarketTransaction(PlayerMarketTransaction transaction) {
super.reportPlayerMarketTransaction(transaction);

FactionAPI faction = submarket.getFaction();
if (faction.getId() == Factions.PIRATES) delayedLearnBlueprintsFromTransaction(faction, getCargo(), transaction, 60f + 60 * (float) Math.random());
}

public static void delayedLearnBlueprintsFromTransaction(FactionAPI faction, CargoAPI cargo, PlayerMarketTransaction transaction) {
delayedLearnBlueprintsFromTransaction(faction, cargo, transaction, 60f + 60 * (float) Math.random());
}
public static void delayedLearnBlueprintsFromTransaction(FactionAPI faction, CargoAPI cargo, PlayerMarketTransaction transaction, float daysDelay) {
DelayedBlueprintLearnScript script = new DelayedBlueprintLearnScript(faction.getId(), daysDelay);
for (CargoStackAPI stack : transaction.getSold().getStacksCopy()) {
SpecialItemPlugin plugin = stack.getPlugin();
if (plugin instanceof BlueprintProviderItem) {
BlueprintProviderItem bpi = (BlueprintProviderItem) plugin;

boolean learnedSomething = false;
if (bpi.getProvidedFighters() != null) {
for (String id : bpi.getProvidedFighters()) {
if (faction.knowsFighter(id)) continue;
script.getFighters().add(id);
learnedSomething = true;
}
}
if (bpi.getProvidedWeapons() != null) {
for (String id : bpi.getProvidedWeapons()) {
if (faction.knowsWeapon(id)) continue;
script.getWeapons().add(id);
learnedSomething = true;
}
}
if (bpi.getProvidedShips() != null) {
for (String id : bpi.getProvidedShips()) {
if (faction.knowsShip(id)) continue;
script.getShips().add(id);
learnedSomething = true;
}
}
if (bpi.getProvidedIndustries() != null) {
for (String id : bpi.getProvidedIndustries()) {
if (faction.knowsIndustry(id)) continue;
script.getIndustries().add(id);
learnedSomething = true;
}
}

if (learnedSomething) {
cargo.removeItems(stack.getType(), stack.getData(), 1);
}
}
}

if (!script.getFighters().isEmpty() || !script.getWeapons().isEmpty() ||
!script.getShips().isEmpty() || !script.getIndustries().isEmpty()) {
Global.getSector().addScript(script);
cargo.sort();
}
}

}

Vundaex

  • Commander
  • ***
  • Posts: 147
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #175 on: March 01, 2022, 11:38:29 AM »

This mod replaces vanilla implementations of Open, Black, and Military markets. Same as Nexerelin. It implements Nexerelin functionality for Military Market (commission check for alliances), but DOES NOT implement optional Nexerelin functionality of doubling number of weapons and LPCs (because the point of this mod is to make it scarce in the first place). As far as I know, Nexerelin is the only mod that replaces vanilla markets. You may consider this mod compatible.

From coding point of view it is compatible with all mods. From a gameplay point of view, it might cause some odd situations. For example, imagine a mod that adds a combat ship that can only be purchased at Open Market, never is part of any fleet, and does not show up as derelicts anywhere... With Military Regulations, that ship will now never be purchasable from Open Market, thus not acquirable. You may consider this mod incompatible.

So you really need to understand what the mods you play with do, and whether this mod will break them, and if yes, is it within expectations and if it is acceptable.

Hope that helps :)

Yes that helps, thanks buddy!
Logged

SpaceDrake

  • Admiral
  • *****
  • Posts: 516
  • Piloting space mecha for fun and profit(?)
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #176 on: March 01, 2022, 02:49:51 PM »

It is possible. What type of description would you like? As a matter of fact, the behaviour should not have changed since 2.0 (custom description, with extra paragraph if shy black market is on).

Oh, no, this is literally all I was wondering, whether or not the shy_black_market descriptor tag from 2.0 would actually still work in 2.2+ and if anything needed to be changed about which plugin it references or whatnot after the description.

Thank you!
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #177 on: April 20, 2022, 02:13:51 AM »

Progress update. A new (and probably last one this year, excluding bugfixes) version of Starpocalypse will be out this or next week. I need to take a break from Starpocalypse in order to find a vision for this mod. For those that missed the memo - this started as a joke mod (I wanted to see the Sector full of d-mods and to make weapons scarce) but due to the somewhat warm welcome I became invested in it. Almost a year later, the mod is all over the place. So I need to sit down and rethink what I want this mod to be. In the meantime, I have a huge backlog of Stelnet features to catch up on, too.

Upcoming 2.3.0 (all features are on by default, as usual can be disabled):
Code
    # Do not drop blueprint packages. Player will have to collect blueprints one by one.
    "blueprintPackageNoDrop": true,

    # Number of s-mods available to player (without skill).
    "maximumPermaMods": 0, # easy mode: 1, vanilla: 2

    # Remove all ships from salvageable debris fields and always require a story point to recover a ship (both derelict
    # ships found across the sector, and post battle recoveries).
    "stingyRecoveries": true,

Logged

Justinkid

  • Ensign
  • *
  • Posts: 21
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #178 on: April 23, 2022, 10:44:46 AM »

This mod is fantastic. I cannot play without it now.

Just one thing. Some bar missions allow you to acquire pristine ships, specifically, the ones where an officer sells you a ship, and where a pirate steals one for you if you provide x# of marines.

Those missions seem a little out of place in the context of this mod they are a relatively easy source of pristine ships... I was wondering if you have plans to make those ships d-modded as well?
Logged

Zaros426

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: [0.95.1a] Starpocalypse 2.2.3 - more apocalyptic settings
« Reply #179 on: April 23, 2022, 01:21:27 PM »

Big fan of this mod, it makes the game much more interesting, especially the black market requiring transponder off.
I really appreciate the aspect of a harder game, it gave starsector a second life for me.

Thanks for making it!
Logged
Pages: 1 ... 10 11 [12] 13 14 15