Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 530 531 [532] 533 534 ... 706

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1700491 times)

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7965 on: September 19, 2021, 07:00:00 PM »

Ah, I must've added it very recently, then. Glad you got this sorted out, though!
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7966 on: September 20, 2021, 12:22:03 PM »

Is there a limit on what the Historian can generate a blueprint for? Or some way to restrict a hull from being picked?

I like to dummy out stuff rather than remove it to help preserve saves, so I don't want them (or WIP stuff) getting blueprints created.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7967 on: September 20, 2021, 12:41:29 PM »

It's based on the histXt tags where X is a 1, 2, or 3; "t" stands for "tier".
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7969 on: September 20, 2021, 02:33:29 PM »

Yep!
Logged

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7970 on: September 20, 2021, 03:42:50 PM »

How do I edit specific industries to spawn in a market(where do I find the plug-in?)? I’ve checked and there doesn’t seem to be individual plugins for markets and the system api doesn’t seem to contain that kind of information.

Also, would it be advisable to make a mod that adds markets/tweaks existing markets of an already existent Core World? I’ve noticed that no other mod directly adds markets to vanilla core worlds unless it’s Nex, hence I’m presuming it takes some sort of overriding the vanilla code that makes it too much of a hassle to be fun.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7971 on: September 21, 2021, 01:06:25 PM »

So I found out scientist contact did nothing.. will there be missions for them in 0.951  ???

Kolokol

  • Ensign
  • *
  • Posts: 13
    • View Profile
Hi
« Reply #7972 on: September 21, 2021, 01:13:00 PM »

Hello,

I have this mod idea, about fight simulation as I am not entirely sure how "Order your second in-command" works.

Would it be possible to make combat run REALLY fast? We do have with "SpeedUp" addon, but the idea would be to disable rendering, for faster processing, and run multiple simulations of fight at high speeds and provide a player an option to skip fight if the average of simulations satisfies him.

Maybe someone has done it already?
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7973 on: September 21, 2021, 06:31:22 PM »

How do I edit specific industries to spawn in a market(where do I find the plug-in?)? I’ve checked and there doesn’t seem to be individual plugins for markets and the system api doesn’t seem to contain that kind of information.

Also, would it be advisable to make a mod that adds markets/tweaks existing markets of an already existent Core World? I’ve noticed that no other mod directly adds markets to vanilla core worlds unless it’s Nex, hence I’m presuming it takes some sort of overriding the vanilla code that makes it too much of a hassle to be fun.
Global.getSector().getEconomy().getMarket(id).addIndustry(industryId);

Mods can add markets to a vanilla star system the same way they add one to a modded star system; Shadowyards has an updated-for-0.95 example. Nex and Industrial.Evolution both add industries to existing core markets. This stuff isn't done too often, which is good since if a lot of people were doing it mods would start conflicting.

Would it be possible to make combat run REALLY fast? We do have with "SpeedUp" addon, but the idea would be to disable rendering, for faster processing, and run multiple simulations of fight at high speeds and provide a player an option to skip fight if the average of simulations satisfies him.

Maybe someone has done it already?
Don't think it's currently possible; e.g. Dark.Revenant doesn't mention it in the Station Balance testing thread (from 2019), where it would have been pretty useful.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7974 on: September 21, 2021, 07:02:39 PM »

So I found out scientist contact did nothing.. will there be missions for them in 0.951  ???

There could be missions for them now, if you added them :)


Don't think it's currently possible; e.g. Dark.Revenant doesn't mention it in the Station Balance testing thread (from 2019), where it would have been pretty useful.

Right, yeah - and just on the performance side of things, it's completely unviable. At best - for a smaller fight, and if it were possible at all - it'd speed the fight up maybe by 10x.
Logged

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7975 on: September 22, 2021, 12:22:26 AM »

How do I edit specific industries to spawn in a market(where do I find the plug-in?)? I’ve checked and there doesn’t seem to be individual plugins for markets and the system api doesn’t seem to contain that kind of information.

Also, would it be advisable to make a mod that adds markets/tweaks existing markets of an already existent Core World? I’ve noticed that no other mod directly adds markets to vanilla core worlds unless it’s Nex, hence I’m presuming it takes some sort of overriding the vanilla code that makes it too much of a hassle to be fun.
Global.getSector().getEconomy().getMarket(id).addIndustry(industryId);

Mods can add markets to a vanilla star system the same way they add one to a modded star system; Shadowyards has an updated-for-0.95 example. Nex and Industrial.Evolution both add industries to existing core markets. This stuff isn't done too often, which is good since if a lot of people were doing it mods would start conflicting.

I’m also interested in where to find it in the api, since I’ve been looking for it and can’t find it.

Now I also have a different question: After digging through the system code of some mods, it seems they either follow the vanilla style of not adding industries/conditions to their planets in said system code(mostly ORA), while other mods use ArrayLists to state clearly industries/conditions(XLU/VIC/SCY etc). I don’t really get why there are these two coding types here, is it a compatibility issue that got jury rigged to workability or just a stylistic/convenience decision that doesn’t affect much?
« Last Edit: September 22, 2021, 04:20:21 PM by JAL28 »
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7976 on: September 24, 2021, 06:50:08 PM »

Asking for the daddy in Discord.

This doesn't work according to him as a plugin. The daddy wants to replace your script.

Code
package sstest;

import org.lazywizard.console.Console;

import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.GenericPluginManagerAPI;
import com.fs.starfarer.api.impl.campaign.fleets.FleetFactoryV3;
import com.fs.starfarer.api.impl.campaign.fleets.FleetParamsV3;
import com.fs.starfarer.api.plugins.CreateFleetPlugin;

import sstest.utils.Utils;

public class SSTestCreateFleetPlugin implements CreateFleetPlugin {

    @Override
    public int getHandlingPriority(Object params) {
        return GenericPluginManagerAPI.MOD_GENERAL;
    }

    @Override
    public CampaignFleetAPI createFleet(FleetParamsV3 params) {

        CampaignFleetAPI fleet = FleetFactoryV3.createFleet(params);
        Console.showMessage("Fleet has been created:\nSystem: " + fleet.getContainingLocation().getName() + "\nName: " + fleet.getFullName() + "\nCommander: " + fleet.getCommander().getNameString() + "Faction: " + fleet.getFaction().getDisplayName() + "\n");
        Utils.SetMemKey(Constants.MEMORY_KEY_TEST_DATA, params);
       
        return fleet;
    }

}
Daddy's setting.json
Code
{
    "plugins":{
        "SSTestCreateFleetPlugin":"sstest.SSTestCreateFleetPlugin"
    }
}
Help?  ;)
« Last Edit: September 24, 2021, 06:51:40 PM by Techpriest »
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7977 on: September 24, 2021, 07:02:11 PM »

I’m also interested in where to find it in the api, since I’ve been looking for it and can’t find it.
com.fs.starfarer.api.campaign.econ.MarketAPI

Have you been looking in starfarer_api.zip? If you have an IDE and add it to source, you can jump to any API class/method by Ctrl-clicking it in the IDE (at least that's the shortcut in NetBeans, dunno if other IDEs do it differently). Also you can search for stuff in the extracted folder with Notepad++ or similar.

Quote
Now I also have a different question: After digging through the system code of some mods, it seems they either follow the vanilla style of not adding industries/conditions to their planets in said system code(mostly ORA), while other mods use ArrayLists to state clearly industries/conditions(XLU/VIC/SCY etc). I don’t really get why there are these two coding types here, is it a compatibility issue that got jury rigged to workability or just a stylistic/convenience decision that doesn’t affect much?
Think it's just a 'pick whatever you prefer' thing, although the code approach is needed if you're adding markets after game start. Also I think the config JSONs didn't exist in earlier versions of the game?

Asking for the daddy in Discord.

This doesn't work according to him as a plugin. The daddy wants to replace your script.
Daddy needs to register the plugin in code (not the settings.json). Example from my test mod:
Code
@Override
public void onGameLoad(boolean newGame) {
Global.getSector().getGenericPlugins().addPlugin(new TestCreateFleetPlugin(), true);  // second arg makes it transient
}
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7978 on: September 24, 2021, 07:07:02 PM »

Ah - the plugins section in settings.json is not for stuff like that, it's for things where there's one specific implementation the game will use (e.g. the officer level up plugin, or the surveying plugin), not where the game picks one of several possible implementations depending on what it's dealing with.

What you want is SectorAPI.getGenericPlugins().addPlugin().
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7979 on: September 24, 2021, 07:13:30 PM »

Asking for the daddy in Discord.

This doesn't work according to him as a plugin. The daddy wants to replace your script.
Daddy needs to register the plugin in code (not the settings.json). Example from my test mod:
Code
@Override
public void onGameLoad(boolean newGame) {
Global.getSector().getGenericPlugins().addPlugin(new TestCreateFleetPlugin(), true);  // second arg makes it transient
}
Ah - the plugins section in settings.json is not for stuff like that, it's for things where there's one specific implementation the game will use (e.g. the officer level up plugin, or the surveying plugin), not where the game picks one of several possible implementations depending on what it's dealing with.

What you want is SectorAPI.getGenericPlugins().addPlugin().
Ok thank u.u
Pages: 1 ... 530 531 [532] 533 534 ... 706