Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 328 329 [330] 331 332 ... 459

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

Histidine

  • Admiral
  • *****
  • Posts: 2803
    • View Profile
    • Bitbucket profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4935 on: August 30, 2019, 09:08:06 PM »

Does the local resources submarket not update for hidden markets? If so, is there a way to change this that isn't "add the things yourself in an EveryFrameScript"?
Figured out my problem: local resources' getStockpileLimit() doesn't count commodity supply from flat mods. So I had to override that method in my local modification of LocalResourcesSubmarketPlugin.

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.

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.
« Last Edit: August 30, 2019, 09:35:42 PM by Histidine »
Logged

TrashMan

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

What exactly does    
"raidCooldownDays":1,
do?

I assume it's the minimal period between raids? All raids? How do I reduce pirate raids. They are attacking me every month.
Logged

ArnaudB

  • Ensign
  • *
  • Posts: 20
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4937 on: August 31, 2019, 08:45:06 AM »

What exactly does    
"raidCooldownDays":1,
do?

I assume it's the minimal period between raids? All raids? How do I reduce pirate raids. They are attacking me every month.
Nothing to do with pirates raid. It's when you raid/invade/disrupt with your fleet on a world. You need to wait one full day (24 hours) before you can make another.
Logged

Ed

  • Captain
  • ****
  • Posts: 436
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4938 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: 17090
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4939 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 #4940 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: 17090
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4941 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: 332
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4942 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: 17090
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4943 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: 332
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4944 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: 17090
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4945 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: 53
    • View Profile
    • Amaranth
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4946 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 #4947 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: 17090
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4948 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: 11
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4949 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
Pages: 1 ... 328 329 [330] 331 332 ... 459