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 ... 259 260 [261] 262 263 ... 706

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3900 on: May 25, 2018, 08:15:36 AM »

Could just do "for (Type x : new ArrayList<Type>(xxxx.entrySet())". From what I read the changes to WHM happen in the same thread that's created/using it, so it shouldn't just change w/o you calling a method on it (which may then trigger some keys being cleaned up). So creating a copy of the entry set or whatever you're using would probably do the job.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3901 on: May 26, 2018, 06:04:48 AM »

AsteroidBeltGenPlugin creates a pair of ring bands under each asteroid belt. Is there a way to identify all such bands in a system so I can remove them?
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3902 on: May 26, 2018, 09:13:14 AM »

Write a custom public class "MyAsteroidBeltGenPlugin" that implements AsteroidBeltGenPlugin, doesn't generate those ring bands, and invoke that instead.

Or hunt through all SectorEntityAPI objects and find ones that use rings_asteroids0 in their SpriteID?  It's too bad they don't have a specific Tag associated with them to make this easier, but that's how that works.
« Last Edit: May 26, 2018, 09:15:05 AM by xenoargh »
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3903 on: May 26, 2018, 10:58:01 AM »

AsteroidBeltGenPlugin creates a pair of ring bands under each asteroid belt. Is there a way to identify all such bands in a system so I can remove them?

None that I can think of; what's the use case?

Also, added a couple of methods to the API get at the ring band sprite, since as far as I can see that's not currently possible.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3904 on: May 26, 2018, 08:35:30 PM »

Seems I can't get the sprite of arbitrary SectorEntityTokens, so yeah. Also don't feel like replacing the star system generation code just for this.

None that I can think of; what's the use case?
A certain modder found the ring textures used for asteroid belts weren't as visually attractive as desired, so he made his own, presently used for the hand-placed asteroid belts in the mod's star system. We were exploring the possibility of using the custom texture for additional asteroid belts created by StarSystemGenerator.addOrbitingEntities() as well.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3905 on: May 26, 2018, 08:49:00 PM »

Hmm, I think replacing this in settings.json:

"rings_asteroids0":"graphics/planets/rings_asteroids0.png",

With the new texture should work? That is, if it's specified in a mod's settings.json, I believe it should override the vanilla texture, at least for new games created after that change is made. Or does this not actually work?
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3906 on: May 26, 2018, 10:14:47 PM »

Overwriting the asteroid ring texture isn't an option, since 1) the mod texture is set up differently (it uses the whole 1024x512 image to define one texture type, instead of four),
and 2) we don't actually want to modify the ring textures outside this one system, that's an invasive change.

Anyway, I found the easy way to replace the asteroid belt gen plugin (thanks for making StarSystemGenerator.terrainPlugins public) so the specific case is dealt with :)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3907 on: May 26, 2018, 10:22:51 PM »

Ah, gotcha. I thought it was meant to be a global change. Glad you got it worked out!
Logged

gun&drink

  • Ensign
  • *
  • Posts: 27
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3908 on: May 27, 2018, 10:44:57 AM »

So I was trying to revive an old mod (I think that the last time this was updated was in 0.5) and I managed to be able to make the ship and everything appear in-game. the problem is that when trying to fire any of the weapons of this mod the game crashes and this log is what's left:


60095 [Thread-4] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 34
60095 [Thread-4] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 35
60173 [Thread-4] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 36
60173 [Thread-4] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 37
60174 [Thread-4] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 38
60175 [Thread-4] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 39 - last
82423 [Thread-4] INFO  com.fs.starfarer.combat.CombatEngine  - FP1: 135, FP2: 1191, maxFP1: 200, maxFP2: 300
82423 [Thread-4] INFO  org.histidine.chatter.combat.ChatterCombatPlugin  - Chatter plugin initialized
95947 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
   at com.fs.starfarer.combat.entities.ship.A.if.startedChargeup(Unknown Source)
   at com.fs.starfarer.combat.entities.ship.trackers.OoOO.super(Unknown Source)
   at com.fs.starfarer.combat.entities.ship.trackers.D.super(Unknown Source)
   at com.fs.starfarer.combat.entities.ship.trackers.D.super(Unknown Source)
   at com.fs.starfarer.combat.entities.ship.trackers.OoOO.String(Unknown Source)
   at com.fs.starfarer.combat.entities.ship.A.if.advance(Unknown Source)
   at com.fs.starfarer.combat.systems.oOoO.advanceLinked(Unknown Source)
   at com.fs.starfarer.combat.systems.oOoO.advance(Unknown Source)
   at com.fs.starfarer.combat.entities.Ship.fire(Unknown Source)
   at com.fs.starfarer.combat.entities.Ship.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

where should I start looking for what's wring with the weapons? I checked the vanilla ones to see if anything looked too different but I'm a bit lost
Logged

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3909 on: May 27, 2018, 12:18:36 PM »

Hello, this is for know, directly with Alex, i think, well, i have a problem with my SAD Faction, who act like Remnant.

Compared to them, they drop survey data.


But like them, if you fight a fleet who flee you, then you let them go, well, you got survey data.
Than you can farm easily.  This is not worth like Ai drop, but same.


A means to fix that?
Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3910 on: May 27, 2018, 12:28:35 PM »

I'm assuming you copy-pasted RemnantFleetInteractionConfigGen to work for your faction? IIRC the bug is in there, so you'll need to fix it to only work for ship losses, in the postPlayerSalvageGeneration() method.

Here's what the fixed method looks like on my end, currently:

Spoiler
Code: java
				public void postPlayerSalvageGeneration(InteractionDialogAPI dialog, FleetEncounterContext context, CargoAPI salvage) {
if (!(dialog.getInteractionTarget() instanceof CampaignFleetAPI)) return;

CampaignFleetAPI fleet = (CampaignFleetAPI) dialog.getInteractionTarget();

DataForEncounterSide data = context.getDataFor(fleet);
List<FleetMemberAPI> losses = new ArrayList<FleetMemberAPI>();
for (FleetMemberData fmd : data.getOwnCasualties()) {
losses.add(fmd.getMember());
}

List<DropData> dropRandom = new ArrayList<DropData>();

int [] counts = new int[3];
String [] groups = new String [] {Drops.AI_CORES1, Drops.AI_CORES2, Drops.AI_CORES3};
//for (FleetMemberAPI member : fleet.getFleetData().getMembersListCopy()) {
for (FleetMemberAPI member : losses) {
if (member.isStation()) {
counts[2] += 10;
}

if (member.isCapital()) {
counts[2] += 2;
} else if (member.isCruiser()) {
counts[2] += 1;
} else if (member.isDestroyer()) {
counts[1] += 1;
} else if (member.isFrigate()) {
counts[0] += 1;
}
}

// if (fleet.isStationMode()) {
// counts[2] += 10;
// }

for (int i = 0; i < counts.length; i++) {
int count = counts[i];
if (count <= 0) continue;

DropData d = new DropData();
d.group = groups[i];
d.chances = (int) Math.ceil(count * 1f);
dropRandom.add(d);
}

Random salvageRandom = new Random(Misc.getSalvageSeed(fleet));
CargoAPI extra = SalvageEntity.generateSalvage(salvageRandom, 1f, 1f, 1f, null, dropRandom);
for (CargoStackAPI stack : extra.getStacksCopy()) {
salvage.addFromStack(stack);
}
}

[close]

Logged

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3911 on: May 27, 2018, 01:27:17 PM »

Thank you!
Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

stormbringer951

  • Commander
  • ***
  • Posts: 130
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3912 on: June 01, 2018, 05:48:17 AM »

Is there any way to change the fleet composition depending on fleet size? So small fleets might have a moderate % of small escorts relative to overall small units, while large fleets would not field them.
Logged
Weapons Group Controls mod - deselect all weapon groups, hold-down hold-fire mode, toggle alternating/linked fire
Captain's Log - throw away your notepad: custom notes, ruins and salvageable reminders
Old Hyperion - for your dose of nostalgia
Adjustable Skill Thresholds - set fleet DP and fighter bay thresholds

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3913 on: June 02, 2018, 02:21:16 AM »

  • Lava planets will no longer show up as part of the combat background (too bright)
Speaking of Lava planets, I totally forgot to mention that since it has been a while, but I encountered some issues with those (and a few others I think) when making Unknown Skies. Some planet types do not inherit the propriety of their biome and are just empty when surveyed. I haven't looked at the code in ages though, but for certain categories just adding them to the proper list just isn't working.

Soooooo am I missing something there?
Logged
 

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3914 on: June 02, 2018, 10:50:59 AM »

Speaking of Lava planets, I totally forgot to mention that since it has been a while, but I encountered some issues with those (and a few others I think) when making Unknown Skies. Some planet types do not inherit the propriety of their biome and are just empty when surveyed. I haven't looked at the code in ages though, but for certain categories just adding them to the proper list just isn't working.

Soooooo am I missing something there?

Hmm, could you be more specific? If it's only not working for something in particular, then the devil is probably in the details.
Logged
Pages: 1 ... 259 260 [261] 262 263 ... 706