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 ... 450 451 [452] 453 454 ... 706

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

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6765 on: September 05, 2020, 06:00:26 PM »

Hardpoints have different sprite sets, slower traverse, and more hit points.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6766 on: September 05, 2020, 07:42:23 PM »

Also: hardpoints have halved recoil per shot and halved maximum inaccuracy, for weapons where that's applicable. And missile weapons mounted in hardpoints don't turn at all, but that's just a minor mostly cosmetic point.
Logged

maplealvon

  • Ensign
  • *
  • Posts: 6
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6767 on: September 13, 2020, 11:21:42 PM »

How one find out:
1. markets managed by the player
2. industries on a market
3. cores/items attached to the industries
4. industries known by the player (like the red shield, the default industries, or even modded industries)
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6768 on: September 14, 2020, 01:54:14 PM »

How one find out:
1. markets managed by the player
Code
Misc.getFactionMarkets(Global.getSector().getPlayerFaction());
2. industries on a market
Code
market.getIndustries();
3. cores/items attached to the industries
Depends on the industry - for vanilla, it's simply:
Code
        market.getIndustry("industry_Id").getSpecialItem();
        market.getIndustry("industry_Id").getAICoreId();
Modded industries might not work that way.
4. industries known by the player (like the red shield, the default industries, or even modded industries)
Code
Global.getSector().getPlayerFaction().getKnownIndustries();
Modded industries do not need to conform to this and might have a different way of handling availability.


I am trying to check what cargo was dropped as salvage after a fleet encounter with a Campaign Fleet I have a Fleet listener on.
Fleet cargo/EconomyRouteData.cargo doesn't seem to update on fleet size change, so that's not an option apparently.

In short - I gotta update the cargo of a fleet if it lost stuff to the player.
Any way I can do that?
« Last Edit: September 14, 2020, 01:59:22 PM by SirHartley »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6769 on: September 14, 2020, 02:28:51 PM »

In short - I gotta update the cargo of a fleet if it lost stuff to the player.
Any way I can do that?

Hmm - if the stuff was lost as a result of a battle and the other fleet had it in its actual cargo, that should already be handled in FleetEncounterContext.handleCargoLooting(). Stuff that was in the other fleet's cargo and that was dropped for the player is removed from the other fleet's cargo. Barring bugs, that is.

(Edit: thank you for answering maplealvon's questions, by the way! Much appreciated.)
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6770 on: September 15, 2020, 06:58:28 AM »

Hmm - if the stuff was lost as a result of a battle and the other fleet had it in its actual cargo, that should already be handled in FleetEncounterContext.handleCargoLooting(). Stuff that was in the other fleet's cargo and that was dropped for the player is removed from the other fleet's cargo. Barring bugs, that is.

(Edit: thank you for answering maplealvon's questions, by the way! Much appreciated.)

Fell victim to my own spaghetti code - refreshing fleet cargo to the target cargo via fleet AI implementation, then wondering why the fleet cargo didn't update to reflect dropped loot for the listener.
Seems to work as intended when using fleet cargo, but I'm not completely done - will see if I run into something else.

Thank you!
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6771 on: September 17, 2020, 04:24:51 PM »

Using fleet cargo worked without issue in the end.
Got another question though - I want to apply an industry to a market immediately after it is converted from a conditionMarket.

The industry I spawn via apply/advance from a market condition only shows up after re-docking at the planet.
Any way to have industries show up immediately on opening the panel?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6772 on: September 17, 2020, 04:26:34 PM »

Hmm - EconomyAPI.tripleStep() or some such? Maybe I'm misunderstanding the question.
Logged

Timid

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

Will a market always sell a ship that they use in the fleet? I wonder if it's possible to make a ship never sold at all, but used a lot in their fleet composition.

Also, there's no way to make a skin revert back to another skin is there? Example for reference

Code
	"baseHullId":"enforcer_xiv", //this is originally a skin
"skinHullId":"enforcer_xiv_mk2",

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6774 on: September 18, 2020, 09:35:39 AM »

I think a "no_sell" tag ought to do it. Not 100% sure if it'll work in the current release but I *think* it will. Definitely in the next release, though.

Also, there's no way to make a skin revert back to another skin is there? Example for reference

Code
	"baseHullId":"enforcer_xiv", //this is originally a skin
"skinHullId":"enforcer_xiv_mk2",

Not sure what you mean by "revert". Do you mean base the skin on another skin? I don't know off the top of my head, actually - this may be load-order dependent, i.e. it might work if the original skin is loaded first, since under the hood is skin a very much a hull. But, yeah, not sure actually.
Logged

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6775 on: September 18, 2020, 05:30:57 PM »

How do i set the priority in which module of a multi-module ship appear on top of the other modules?

ok found out its the order of the module slots in .ship file
« Last Edit: September 18, 2020, 05:50:39 PM by Ed »
Logged
Check out my ships

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6776 on: September 19, 2020, 12:21:18 PM »

Is there a guide on how to set up Submarkets on existing worlds? I wanna make a special shop that only sell a few specific ships on some core worlds.
Logged
Check out my ships

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6777 on: September 19, 2020, 03:38:38 PM »

Is there a guide on how to set up Submarkets on existing worlds? I wanna make a special shop that only sell a few specific ships on some core worlds.

I don't think so, but to get you started:

1) Make a new class that extends BaseSubmarketPlugin and create the logic to do what you want. For an example, see: com\fs\starfarer\api\impl\campaign\submarkets\BlackMarketPlugin.java (This is a good reference point for doing lots of things with the BaseSubmarketPlugin.)

2) Add an entry in Submarkets.csv (starsector-core\data\campaign) which points to your plugin. (Note: Your version of the csv from a mod standpoint must match the path of vanilla's csv and share the same name in order to merge into the games list of submarkets.)

3) Now the submarket is available with an id. My recommendation would be to add that id to the Submarkets enum in case you need it in enum form for other methods, but for adding a submarket to the MarketAPI of an entity you can just use the id I believe.

4) Create a script to find the markets you want through their entity ids and add the new submarket to them.

5) Add the script to your mod plugin - onNewGameAfterEconomyLoad() or onNewGame() is probably the best place.

(EDIT: More informative in this format and I may expand it. For any details of any component of the explanation - or any additional clarification - post here or PM me!)
« Last Edit: September 19, 2020, 09:42:27 PM by Morrokain »
Logged

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6778 on: September 20, 2020, 07:48:22 AM »

That helped a lot Morrokain, i just need now a sample code on how to search for markets and add the submarket during the onNewGameAfterEconomyLoad()
I looked for mods that have special submarkets, i know of Tahlan for GH shop, but i can't find where in the plugin code is the part where the submarket is added.

« Last Edit: September 20, 2020, 09:48:31 AM by Ed »
Logged
Check out my ships

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6779 on: September 20, 2020, 08:32:09 AM »

MarketAPI.addSubmarket() IIRC
Logged
Pages: 1 ... 450 451 [452] 453 454 ... 706