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 ... 328 329 [330] 331 332 ... 706

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

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4935 on: August 31, 2019, 10:15:14 AM »

Is there a guide for Hullmods and Ship Systems? The Wiki tutorial doesn't have those yet
Logged
Check out my ships

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4936 on: August 31, 2019, 10:45:02 AM »

New problem: How to I set a market's demand for a commodity to zero? I tried the following in EconomyUpdateListener.commodityUpdated()
Code: java
	CommodityOnMarketAPI com = market.getCommodityData(commodityId);
String modId = market.getId();

market.getDemand(com.getDemandClass()).getDemand().modifyMult(modId, 0);
com.getDemand().getDemand().modifyMult(modId, 0);
but the market's industries still generate their usual demand.

Ah, yeah, you don't want to generally mess with that - this is only used for determining the player-facing prices of things. It operates in "cargo units", not "economy units", so just generally it's not what you're looking for.

CommodityOnMarketAPI.getMaxDemand() is what's used here, and that returns the maximum demand out of all the industries that have demand for the commodity.

So I think what would work is:
For each IndustryAPI, call getDemand(String commodityId); this returns a MutableCommodityQuantity.

This has a MutableStat quantity, which you could modifyMult(modId, 0). I *believe* this should work.


EDIT: Also, how often is EconomyUpdateListener.economyUpdated() called? I'm wondering if it's safe to use for a monthly upkeep-style cost or if I should use reportEconomyTick insead.

Yeah, you want to use EconomyTickListener. EconomyUpdateListener gets called any time the economy is synched up, such as say when the player visits a colony.
Logged

XDms

  • Ensign
  • *
  • Posts: 7
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4937 on: September 01, 2019, 07:21:33 AM »

Hello, i would like to understand how the FoodShortage event is triggered, can someone point me which files to look on? I did some "backward" study and from FoodShortageEvent.class i arrived to CampaignEventManager.class, yet I can't find which conditions/code increase or decrease the probability of this event happening
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4938 on: September 01, 2019, 08:42:21 AM »

It's not - it's left over from way back but it's not hooked up to anything and the code wouldn't be functional if it was. Sorry :)
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4939 on: September 01, 2019, 11:57:02 AM »

I find that in IntelPlugin, if I use large description, the whole background is black and not transparent.
So is there any way to make it transparent?
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4940 on: September 01, 2019, 12:24:47 PM »

I don't believe so, no. That's just how the intel screen is set up - the descriptions go over a black background.
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4941 on: September 01, 2019, 08:34:15 PM »

I don't believe so, no. That's just how the intel screen is set up - the descriptions go over a black background.
hmmm okay...I'm just want to know why the intel plugin which has small description has a transparent gap between the map and small description.
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4942 on: September 01, 2019, 08:53:41 PM »

Literally just because that's how the UI is coded to look :) I think it works better visually; I did try not having the gap/having that be black/etc.
Logged

Armithaig

  • Lieutenant
  • **
  • Posts: 54
    • View Profile
    • Amaranth
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4943 on: September 01, 2019, 11:55:44 PM »

Made a SHIP_WITH_MODULES, but the modules're "swaying" with passionate turns as if strapped on with space tape.
Any way to nail 'em down firmer?
Logged

Salv

  • Lieutenant
  • **
  • Posts: 56
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4944 on: September 02, 2019, 04:19:46 AM »

Is it possible to add a flat modifier to a building's upkeep that is not affected by multipliers (such as hazard)? From what I have checked, I suppose I would have to introduce a brand new mutable stat and factor it into the net income calculation alongside upkeep, if that's feasible to begin with as I think it could be hardcoded.

Edit: Nevermind, found a workaround  :).
« Last Edit: September 02, 2019, 06:15:53 AM by Salv »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4945 on: September 02, 2019, 08:18:00 AM »

Made a SHIP_WITH_MODULES, but the modules're "swaying" with passionate turns as if strapped on with space tape.
Any way to nail 'em down firmer?


Hmm. I don't actually know what the issue might be. If the modules have a INDEPENDENT_ROTATION hint set, that would prevent their facing from being locked; that's the only thing that comes to mind.
Logged

Soñjer

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4946 on: September 02, 2019, 09:20:39 AM »

How do I make my ships appear in markets ? No matter how many time I refresh, they don't seem to spawn. I have all the vanilla .factions files set up like this:

Code
{
  "knownShips":{
    "hulls":[
      "ship_a",
      "ship_b",
      "ship_b",
    ],
  },
  "shipsWhenImporting":{
      "ship_a",
      "ship_b",
      "ship_c",
  },
},

Do I need something else ?
Logged

Armithaig

  • Lieutenant
  • **
  • Posts: 54
    • View Profile
    • Amaranth
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4947 on: September 02, 2019, 12:52:12 PM »

Do I need something else ?
Variants in /data/variants. Set the variant quality too high, won't appear on your regular backwater rimworld either.

Made a SHIP_WITH_MODULES, but the modules're "swaying" with passionate turns as if strapped on with space tape.
Any way to nail 'em down firmer?


Hmm. I don't actually know what the issue might be. If the modules have a INDEPENDENT_ROTATION hint set, that would prevent their facing from being locked; that's the only thing that comes to mind.
Captured me sliding 'round like Kubica at 50% speed.
See if it fires any synapses, can make a post in (modded?) bug section with JSON/CSV data if it helps. No extraordinary hints, just SHIP_WITH_MODULES, CARRIER, UNBOARDABLE, HIDE_IN_CODEX.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4948 on: September 02, 2019, 01:09:07 PM »

... weird.

Just to confirm, are those modules implemented as ships? Or are you using decorative weapons etc? The hints you'd want to look at would be for the module "ships", as far as INDEPENDENT_ROTATION.
Logged

Armithaig

  • Lieutenant
  • **
  • Posts: 54
    • View Profile
    • Amaranth
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4949 on: September 02, 2019, 01:24:13 PM »

They're ships, posted the basics here.
Logged
Pages: 1 ... 328 329 [330] 331 332 ... 706