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 ... 285 286 [287] 288 289 ... 706

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

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4290 on: February 10, 2019, 12:29:04 PM »

Unless I'm missing something, that seems incorrect. Bar delivery missions end on market interaction, but procurement missions - which involve a specific person - iirc still require getting in touch via the comm directory.

Hmm, ok that makes sense I checked a while ago so maybe I got the details confused between the two delivery types.

The strange thing is that neither type can be delivered. The npc with the quest marker never shows up in the commboard, and accepting bar delivery quests are fine until you get to the planet you are supposed to drop the goods off to. The turn in dialogue never populates.

I think this may only be on new faction markets, though. There is a save and the mod that I can link that shows the problem with the market procurement side, and I think you can select a delivery mission at the bar too. (This was what another player reported)

Save game: http://www.filedropper.com/savenasty8109031963081034761

Mod:
Logged

Bad_Idea

  • Ensign
  • *
  • Posts: 17
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4291 on: February 10, 2019, 04:00:54 PM »

So, another stupid question from me: I'm doing some very bad stuff to the hyperspace SectorEntityToken and the game is clearly not enjoying itself (see spoiler, epilepsy warning)...

Spoiler
https://i.imgur.com/nxuFfEe.mp4
(Had to link due to imgur .mp4s not being supported)
[close]

In this case i've set the SectorEntityToken for the hyperspace to orbit my fleet whenever i am in hyperspace, my question would be if there's anything that could be done about the flickering/rapid changing of the voidclouds, it seems to occur no matter if the entity is moving or if it is stationary.

I realize am doing some very bad stuff to the game at this point, so i am not expecting any miracles! :D
« Last Edit: February 10, 2019, 04:04:52 PM by Bad_Idea »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4292 on: February 10, 2019, 04:08:58 PM »

I think this may only be on new faction markets, though. There is a save and the mod that I can link that shows the problem with the market procurement side, and I think you can select a delivery mission at the bar too. (This was what another player reported)

Save game: http://www.filedropper.com/savenasty8109031963081034761

Mod:

I'll see if I can check this out at some point! Might be a bit though, digging through lots of stuff.


In this case i've set the SectorEntityToken for the hyperspace to orbit my fleet whenever i am in hyperspace

... that's not how any of this works! Well, that's not entirely fair; some small nebula patches do orbit things like stars. Since your gif doesn't actually seem to be animated, at least on my end, I'm not sure what you mean exactly.

But I suspect the answer, in any case, would be "probably not"; I wouldn't be surprised if the hyperspace terrain plugin is assuming that the terrain is centered on 0,0.
Logged

Bad_Idea

  • Ensign
  • *
  • Posts: 17
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4293 on: February 10, 2019, 04:19:54 PM »

... that's not how any of this works!

Hehe, i tried it as an ugly workaround to setting the location of the hyperspace terrain every frame, sadly it had the same result... (The orbit thing totally does work though, for some strange reason)

Well, that's not entirely fair; some small nebula patches do orbit things like stars. Since your gif doesn't actually seem to be animated, at least on my end, I'm not sure what you mean exactly.

But I suspect the answer, in any case, would be "probably not"; I wouldn't be surprised if the hyperspace terrain plugin is assuming that the terrain is centered on 0,0.

Here's a straight link to the imgur Mp4 i was trying to link, maybe that can better illustrate what i am talking about! https://i.imgur.com/nxuFfEe.mp4

Yeah, that's kind of what i am expecting, been looking a little at the HyperspaceTerrainPlugin class and it seems to be looking grim. I'm trying to find ways of getting away from having a large hyperspace terrain entity to try to improve on the (still decent) performance of my increased size sector. The general idea was to move the hyperspace terrain entity with the player and generate the hyperspace terrain as you go using a noise algorithm i've already somewhat successfully tested.
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 #4294 on: February 10, 2019, 06:41:21 PM »

I think this may only be on new faction markets, though. There is a save and the mod that I can link that shows the problem with the market procurement side, and I think you can select a delivery mission at the bar too. (This was what another player reported)

Save game: http://www.filedropper.com/savenasty8109031963081034761

Mod:

I'll see if I can check this out at some point! Might be a bit though, digging through lots of stuff.

Thanks! No pressure, do what you need to and I'll keep looking too of course.

Though I'm kind of at a loss right now, one thing I thought about investigating is the way the new game is generated. It is based on the old NGCStartingScript code, but there doesn't seem to be anything in there that would directly affect markets.
Logged

King Alfonzo

  • Admiral
  • *****
  • Posts: 679
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4295 on: February 10, 2019, 07:10:49 PM »

I'm trying to make a custom industry for a Luddic Church market, that enables the Church to make it's own ships and grants a small buff to ship quality and fleet size. I'm basing this off HeavyIndustry, as well as code in the Prism Freeport and Shadowyards mods. However, despite the industry working in almost all respects, it critically doesn't improve the quality of the Luddic Church ships, does not remove the 'Cross-Faction imports' deficit, and does not increase the size of their fleets. I'm not sure what I'm doing wrong, or if I've missed something important. Could anyone help me out please?

Code for the industry:
Code
package data.campaign.econ.industries;

import com.fs.starfarer.api.impl.campaign.econ.impl.BaseIndustry;
import com.fs.starfarer.api.impl.campaign.ids.Commodities;
import com.fs.starfarer.api.impl.campaign.ids.Stats;
import com.fs.starfarer.api.util.Pair;

public class luddenhance_refit extends BaseIndustry {
        
        @Override
        public void apply() {
super.apply(true);
                int size = market.getSize();
                
                demand(Commodities.RARE_METALS, size - 1);
demand(Commodities.METALS, size + 1);
demand(Commodities.ORGANICS, size + 1);
demand(Commodities.VOLATILES, size + 1);

                supply(Commodities.SHIPS, size - 3);
supply(Commodities.HEAVY_MACHINERY, size - 2);
supply(1, Commodities.SHIPS, 1, "Cerberus Manufactory");

                
                    Pair<String, Integer> deficit = getMaxDeficit(Commodities.RARE_METALS, Commodities.METALS, Commodities.VOLATILES, Commodities.ORGANICS);
                    int maxDeficit = size -4;
                    if (deficit.two > maxDeficit) deficit.two = maxDeficit;

                    applyDeficitToProduction(2, deficit,
Commodities.SHIPS,
Commodities.HEAVY_MACHINERY);

market.getStats().getDynamic().getMod(Stats.PRODUCTION_QUALITY_MOD).modifyFlat(getModId(1), 0.25f, "Cerberus Manufactory");

float stability = market.getPrevStability();
if (stability < 5) {
float stabilityMod = (stability - 5f) / 5f;
stabilityMod *= 0.5f;
//market.getStats().getDynamic().getMod(Stats.PRODUCTION_QUALITY_MOD).modifyFlat(getModId(0), stabilityMod, "Low stability at production source");
market.getStats().getDynamic().getMod(Stats.PRODUCTION_QUALITY_MOD).modifyFlat(getModId(0), stabilityMod, getNameForModifier() + " - low stability");
}

if (!isFunctional()) {
supply.clear();
unapply();
}
        }

   @Override
public void unapply() {
super.unapply();
}

@Override
public boolean isAvailableToBuild() {
return false;
}

@Override
public boolean showWhenUnavailable() {
return false;
}
    }

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4296 on: February 11, 2019, 06:18:40 AM »

Fleet size isn't affected by heavy industry/nanoforge by default (except by ensuring ship hulls & weapons demand is met) and your code isn't otherwise modifying it.
As for quality: dunno, maybe it needs the heavyindustry tag in industries.csv?


Okay, requesting a fix to the API:

Calling market.setFreePort(true) for a market with an under-construction spaceport doesn't add the free port condition, because it needs a spaceport.
But! Not only is the condition not applied when the spaceport is completed, further calls of setFreePort(true) do nothing because it's already a free port.
I can work around it for now by setting free port to false first, but maybe make this not be required?
Logged

Cycerin

  • Admiral
  • *****
  • Posts: 1665
  • beyond the infinite void
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4297 on: February 11, 2019, 06:59:13 AM »

Seems like weapon render order was changed to an automatic system in 0.9, at the very least a bunch of ships have overlapping turrets in the wrong order now where before it worked fine. Assuming this is set by distance from ship or sprite center, is there any way to override it or control it?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4298 on: February 11, 2019, 10:05:42 AM »

Here's a straight link to the imgur Mp4 i was trying to link, maybe that can better illustrate what i am talking about! https://i.imgur.com/nxuFfEe.mp4

Yeah, that's kind of what i am expecting, been looking a little at the HyperspaceTerrainPlugin class and it seems to be looking grim. I'm trying to find ways of getting away from having a large hyperspace terrain entity to try to improve on the (still decent) performance of my increased size sector. The general idea was to move the hyperspace terrain entity with the player and generate the hyperspace terrain as you go using a noise algorithm i've already somewhat successfully tested.

Ah, hmm - it looks like it keeps picking a different texture or angle for each tile. Why it would do that, I'm not sure - to be perfectly honest, I don't want to really dig into it, since the most likely answer would still just be "yep, doesn't work because it's not meant to handle this", if that makes sense :)

I *do* think that the texture-switching is probably due to something other than the center moving, but, again, not sure. The main problem with what you're trying to do, btw, would be the Sector map - in non-Starscape mode, you'd see the smaller faked-up hyperspace square around the player.

If you're just concerned about the savefile size, I think a more promising approach might be to make the game not save the tile data - and regenerating it on load instead - by overriding writeReplace()/readResolve(), but, fair warning, that requires a pretty good understanding of Java and how the save system works.


I'm trying to make a custom industry for a Luddic Church market, that enables the Church to make it's own ships and grants a small buff to ship quality and fleet size. I'm basing this off HeavyIndustry, as well as code in the Prism Freeport and Shadowyards mods. However, despite the industry working in almost all respects, it critically doesn't improve the quality of the Luddic Church ships, does not remove the 'Cross-Faction imports' deficit, and does not increase the size of their fleets. I'm not sure what I'm doing wrong, or if I've missed something important. Could anyone help me out please?

Code for the industry:

This might actually be due to a bug in the ship quality calculation (which ought to be fixed for .1, but I don't remember what it was, exactly); not 100% sure. FWIW, the industry code looks fine to me.


Okay, requesting a fix to the API:

Calling market.setFreePort(true) for a market with an under-construction spaceport doesn't add the free port condition, because it needs a spaceport.
But! Not only is the condition not applied when the spaceport is completed, further calls of setFreePort(true) do nothing because it's already a free port.
I can work around it for now by setting free port to false first, but maybe make this not be required?

Ah, good point - made it so that calling setFreePort(false) is no longer required. The condition was self-removing but updating the "isFreeBort" boolean in the market object.



Seems like weapon render order was changed to an automatic system in 0.9, at the very least a bunch of ships have overlapping turrets in the wrong order now where before it worked fine. Assuming this is set by distance from ship or sprite center, is there any way to override it or control it?

It was always (at least, for as long as I can remember) an automatic system, though I do remember making a few changes.

The rules for what stuff goes below other stuff, in order of priority:
- Is a hardpoint
- Is a larger weapon size
- Is a missile weapon that renders loaded missiles
- Is further away from the spine of the ship
- Is further away from a line through the center, perpendicular to the spine of the ship

Though "further away from perpendicular" could override "further away from spine" if the distance differential is high enough.

If you could get me a mini-mod with a specific example, and what's desired, I could take a look.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4299 on: February 11, 2019, 10:36:25 AM »

Hmm, ok that makes sense I checked a while ago so maybe I got the details confused between the two delivery types.

The strange thing is that neither type can be delivered. The npc with the quest marker never shows up in the commboard, and accepting bar delivery quests are fine until you get to the planet you are supposed to drop the goods off to. The turn in dialogue never populates.

I think this may only be on new faction markets, though. There is a save and the mod that I can link that shows the problem with the market procurement side, and I think you can select a delivery mission at the bar too. (This was what another player reported)

Save game: http://www.filedropper.com/savenasty8109031963081034761

Mod:

Gave it a quick try - Filzip shows the savefile archive as being empty (ugh), and creating a new game crashes because the hegemony.faction doctrine has a shipSize of 6. (All doctrine values must be in the [1, 5] range.)

If NPCs with the quest marker never show up in the comm directory, that's... weird. I would honestly start with that - I suggest maying seeing if you can connect up a debugger and put a breakpoint in ProcurementMissionIntel somewhere (perhaps in acceptMission()) to see what might be going wrong...
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 #4300 on: February 11, 2019, 03:01:06 PM »

Hmm, ok that makes sense I checked a while ago so maybe I got the details confused between the two delivery types.

The strange thing is that neither type can be delivered. The npc with the quest marker never shows up in the commboard, and accepting bar delivery quests are fine until you get to the planet you are supposed to drop the goods off to. The turn in dialogue never populates.

I think this may only be on new faction markets, though. There is a save and the mod that I can link that shows the problem with the market procurement side, and I think you can select a delivery mission at the bar too. (This was what another player reported)

Save game: http://www.filedropper.com/savenasty8109031963081034761

Mod:

Gave it a quick try - Filzip shows the savefile archive as being empty (ugh), and creating a new game crashes because the hegemony.faction doctrine has a shipSize of 6. (All doctrine values must be in the [1, 5] range.)

If NPCs with the quest marker never show up in the comm directory, that's... weird. I would honestly start with that - I suggest maying seeing if you can connect up a debugger and put a breakpoint in ProcurementMissionIntel somewhere (perhaps in acceptMission()) to see what might be going wrong...

Thanks for the info on the faction doctrine (didn't know and starting a new game works in my environment) I would have likely had to change that anyway come the next update.

I'll see what I can do about the debugger.
Logged

Cycerin

  • Admiral
  • *****
  • Posts: 1665
  • beyond the infinite void
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4301 on: February 11, 2019, 03:11:12 PM »

The rules for what stuff goes below other stuff, in order of priority:
- Is a hardpoint
- Is a larger weapon size
- Is a missile weapon that renders loaded missiles
- Is further away from the spine of the ship
- Is further away from a line through the center, perpendicular to the spine of the ship

Though "further away from perpendicular" could override "further away from spine" if the distance differential is high enough.

If you could get me a mini-mod with a specific example, and what's desired, I could take a look.

I seem to recall it was set by weapon slot number before, which allowed precise control over what went where for cases where several small turrets are clustered together. At least, that's my only explanation for why things don't look the way they used to. Would it be possible to override somehow, based on that? With the way it is now I'd have to redo several ships fundamentally to avoid edge cases where overlap looks bad, because there's no way to finesse the current system to do what I want it to do.

E: Here's an example of what I mean (using the biggest small weapons makes it very visible)




« Last Edit: February 11, 2019, 03:34:06 PM by Cycerin »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4302 on: February 11, 2019, 04:51:32 PM »

I seem to recall it was set by weapon slot number before, which allowed precise control over what went where for cases where several small turrets are clustered together. At least, that's my only explanation for why things don't look the way they used to. Would it be possible to override somehow, based on that? With the way it is now I'd have to redo several ships fundamentally to avoid edge cases where overlap looks bad, because there's no way to finesse the current system to do what I want it to do.

I think we all (myself included) *thought* it was based on slot number, but it was effectively random though (usually, not always) consistent.

(Btw, I was wrong about the rules in the previous reply; got a couple of things mixed up.)

Thinking about this a bit more:
Added WEAPONS_FRONT_TO_BACK ship hint - changes tiebreaker for weapon render order to be distance from front of ship (front weapons go below rear ones) instead of distance from ship spine
   Larger weapons still render on top of smaller ones etc


I think that should cover your case - let me know if you think it doesn't!

Logged

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4303 on: February 11, 2019, 05:34:46 PM »

Low hanging fruit Alex, but figure might as well request it while this is being discussed even though it will have less use cases (but I can still think of some) than the hint you just added.

WEAPONS_BACK_TO_FRONT

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4304 on: February 11, 2019, 05:38:34 PM »

... sure, why not. Could indeed come in handy if a similar cluster of guns on a ship is pointing backwards.
Logged
Pages: 1 ... 285 286 [287] 288 289 ... 706