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)

Author Topic: Hulls Without Engines Don't Make Trails in Campaign  (Read 1806 times)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Hulls Without Engines Don't Make Trails in Campaign
« on: July 24, 2017, 01:40:23 AM »

Simple as that; they generate the engine glow effect when entering / leaving Hyperspace, but they don't generate the quad trails if they don't have any Engines. 

I tried fixing this through manipulating the contrails view the FleetMemberViewAPI, like this:

Code
package data.scripts;

import com.fs.starfarer.api.EveryFrameScript;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.LocationAPI;
import com.fs.starfarer.api.fleet.FleetMemberViewAPI;
import java.util.List;

@SuppressWarnings("unchecked")
public class ContrailFixer implements EveryFrameScript {

//EveryFrameScripts must implement these
    @Override
    public boolean isDone()
    {
        return false;
    }

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

    @Override
    public void advance(float amount)
    {
LocationAPI location = Global.getSector().getCurrentLocation();
if(location == null) return;
List<CampaignFleetAPI> fleets = location.getFleets();
if(fleets == null) return;
for(CampaignFleetAPI fleet : fleets){
for(FleetMemberViewAPI view : fleet.getViews()){
view.getContrailDurMult().setBase(10f);
}
}
    }
}

But no dice.  It's weird; the script's getting added to the Sector via a ModPlugin on game load, but it's like it's not doing anything.

Not sure if this counts as a "bug" or is "working as intended, but doesn't handle this weird situation".
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Hulls Without Engines Don't Make Trails in Campaign
« Reply #1 on: July 24, 2017, 09:45:36 AM »

Well... I'd say this is working as intended - no engines means no trails, since the trails are based off the engines, their types and positions, etc. I can see how that's a problem for what you're doing, but not sure what a workaround would be.

The thing you're trying with the script isn't going to work - it'd make contrails last longer, but none are being added in the first place, due to "no engines".
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Hulls Without Engines Don't Make Trails in Campaign
« Reply #2 on: July 24, 2017, 01:06:31 PM »

Yeah, I figured as such.  So... let's see... can't Skins change / remove Engines?  Hmm.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Hulls Without Engines Don't Make Trails in Campaign
« Reply #3 on: July 26, 2017, 11:39:35 AM »

I found a loophole, kinda.  A single Engine that's invisible (except in the Campaign) works. 

I'm sure it's eating a little CPU doing nothing, but whatever, it's better than not having this work at all.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Hulls Without Engines Don't Make Trails in Campaign
« Reply #4 on: July 26, 2017, 12:22:20 PM »

Hah, nice. Yeah, I wouldn't worry about whatever CPU that might be eating, it'd be trivial compared to everything else.
Logged