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 ... 460 461 [462] 463 464 ... 706

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6915 on: November 29, 2020, 06:08:30 PM »

I don't think so, no - you'd need a custom missile AI. I mean, it's basically coded specifically *not* to do that.
Logged

Sinosauropteryx

  • Captain
  • ****
  • Posts: 262
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6916 on: November 30, 2020, 05:24:29 AM »

I want to make a star system with three equidistant planets, all on the same orbit, and moving at the same speed. Arrayed somewhat like the blades of a fan. Is this possible? I can create the first planet, but how do I make the second and third have the same orbit period and not start in the same location?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6917 on: November 30, 2020, 12:10:13 PM »

Check the parameters of addPlanet(), one of them is the starting angle.
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6918 on: December 02, 2020, 09:15:17 AM »

I can't seem to get the correct Demand and Available values for commodity. From MarketAPI object I fetch CommodityOnMarketAPI object and then what? Both getDemandValue() and getAvailable() return wrong values (the former is too large, later is usually 0 or some single digit number). I want to have the same values as shown on the tooltip when you F1 over a commodity.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6919 on: December 02, 2020, 10:06:39 AM »

You want these:
int getDeficitQuantity();
int getExcessQuantity();
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6920 on: December 02, 2020, 10:53:29 AM »

Right, I do have those. It's the Available and Demand fields that I struggle with:

« Last Edit: December 02, 2020, 12:42:28 PM by Jaghaimo »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6921 on: December 02, 2020, 12:43:57 PM »

Ah, right, sorry. Was going too fast and didn't pay enough attention.

For the available value it'd be something like:
int available = OpenMarketPlugin.getApproximateStockpileLimit(com);
available += com.getPlayerTradeNetQuantity();

For demand, it'd be:
int demandIcons = com.getMaxDemand();
if (!com.getCommodity().isPrimary()) {
    CommodityOnMarketAPI primary = market.getCommodityData(com.getCommodity().getDemandClass());
    demandIcons = primary.getMaxDemand();
}
int demand = (int) (com.getCommodity().getEconUnit() * demandIcons);
demand -= com.getPlayerTradeNetQuantity();

Except in the non-dev version, the CommodityIconCounts class isn't exposed, so you'd need to use
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6922 on: December 02, 2020, 01:53:13 PM »

Thank you. I wouldn't be able to figure out the logic behind this myself.

Two observations / questions:
- Availability is based on OpenMarket alone, but there MAY be a better place to buy (lower price, see the lower section of the image in the spoiler) in Military or Black markets. You are actively discarding places that have no stock in OpenMarket (in F1 tooltip) - shouldn't it at least consider Military market since it's also a legal source of procurement?
- Demand can be 0 (upper section of the image in the spoiler), and yet market will pay for goods. Not sure how to interpret that, if there is no demand shouldn't market refuse to procure more stock? What happens if I sell enough to cover demand?
- The F1 tooltip sometimes show "Price / 100", "Price / 200" or "Price / 500" - how does the game decide which quantity to use for price approximation?

Spoiler

[close]
« Last Edit: December 02, 2020, 02:09:24 PM by Jaghaimo »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6923 on: December 02, 2020, 03:30:03 PM »

- Availability is based on OpenMarket alone, but there MAY be a better place to buy (lower price, see the lower section of the image in the spoiler) in Military or Black markets. You are actively discarding places that have no stock in OpenMarket (in F1 tooltip) - shouldn't it at least consider Military market since it's also a legal source of procurement?

That's just where the static method happens to live. Open, military, and black markets essentially divvy up this value between them - not explicitly, but based on how their getStockpileLimit() methods are coded. All of them are based on getBaseStockpileLimit() and then get a fraction of that based on stability etc.


- Demand can be 0 (upper section of the image in the spoiler), and yet market will pay for goods. Not sure how to interpret that, if there is no demand shouldn't market refuse to procure more stock? What happens if I sell enough to cover demand?

They'll pay a lot less for it than its value in both of these cases. Basically even if they don't need something, they'll buy it for super cheap (to presumably re-sell?).

- The F1 tooltip sometimes show "Price / 100", "Price / 200" or "Price / 500" - how does the game decide which quantity to use for price approximation?

That value comes from CommoditySpecAPI.getEconUnit(), which is basically how many cargo-units an icon's worth of a commodity corresponds to.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6924 on: December 03, 2020, 07:57:59 PM »

Can anyone who has worked with modules tell me if they automatically die if the parent ship dies? Or do they need a hullmod or something for that?

Nvm, it showed a blue circle even without a designated png sprite so I know the module died when the parent ship died. I can just make it never detach to avoid the circles causing confusion. So now the question is what does vast_bulk actually do? Just make the module invincible?
« Last Edit: December 03, 2020, 08:29:06 PM by Morrokain »
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6925 on: December 07, 2020, 03:12:56 PM »

i'm sory if this is too much to ask but is it possible to modify max relationship points and minimum relationship points? I dislike the idea of -100 / 100 when relationship points can be so easily manipulated and I feel some decimal points are lost when this is done as well. maybe for next update if this is possible ?

AlexAtheos

  • Ensign
  • *
  • Posts: 17
  • hello
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6926 on: December 17, 2020, 07:38:20 AM »

Is there any way to randomize a ui graphic every time it is loaded?

An example would be having a randomized graphic for starsector_title_alpha so a mod could add randomized backgrounds for the initial loading screen.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6927 on: December 17, 2020, 10:58:11 AM »

There isn't, no - it's going to use that specific graphic every time. (Well, that, or the replacement for it from a mod, but no way to add any flow control to that.)
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6928 on: December 19, 2020, 03:40:40 AM »

Is it possible to open a custom panel in the campaign UI? You can render a custom panel as part of a large intel screen, but what if I wanted to open a custom panel rendered on-top of an existing screen? Just like this in-game example:



Is it possible to add to another tab to intel screen (e)?



Is it possible to enable (in next version) rendering both small and large intel screens (currently if both hasSmall and hasLarge returns true, only large is rendered)?



And finally, should I keep on adding requests to API request thread, or just write a comprehensive list of UI requests in own thread (nothing new, just releasing what already is in-game in the form of API)?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6929 on: December 19, 2020, 12:12:50 PM »

Is it possible to open a custom panel in the campaign UI? You can render a custom panel as part of a large intel screen, but what if I wanted to open a custom panel rendered on-top of an existing screen? Just like this in-game example:

It's not possible. Generally speaking, where the UI *is* moddable, it's moddable in very specific places/ways.

Is it possible to add to another tab to intel screen (e)?

It's not.

Is it possible to enable (in next version) rendering both small and large intel screens (currently if both hasSmall and hasLarge returns true, only large is rendered)?

Ahh, I don't think so - or, rather, it's probably *possible*, but it'd be a significant enough effort on my end and since it's not a path vanilla uses, there's a solid chance it wouldn't quite work right or I'd unintentionally break it at some later point etc.

It seems like you might be able to call the createSmallDescription method yourself, though, no? With a TooltipMakerAPI you've created to pass into that? Maybe I'm missing a piece that's not exposed that'd make this work...


And finally, should I keep on adding requests to API request thread, or just write a comprehensive list of UI requests in own thread (nothing new, just releasing what already is in-game in the form of API)?

The API requests thread is good! It may seem like I'm ignoring it, but that's not the case. I'll do my best to look through it and add what I'm able to add before the next release. Mostly it'll be the low-hanging fruit, in all likelihood - but then that sounds like exactly what you're talking about here.
Logged
Pages: 1 ... 460 461 [462] 463 464 ... 706