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: Codex Overhaul (05/11/24)

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - rogerbacon

Pages: [1] 2 3
1
Crash in campaign (heavily modded game but seems to be a missing music file from core game)

Log
782795 [Thread-8] INFO  sound.oo0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOO  - Cleaning up music with id [campaign_noncore_part1.ogg]
783282 [Thread-10] INFO  sound.oo0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOO  - Creating streaming player for music with id [campaign_noncore_part1.ogg]
783283 [Thread-10] INFO  sound.H  - Playing music with id [campaign_noncore_part1.ogg]
783413 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
   at com.fs.starfarer.api.impl.campaign.econ.impl.OrbitalStation.matchStationAndComm anderToCurrentIndustry(OrbitalStation.java:422)
   at com.fs.starfarer.api.impl.campaign.econ.impl.OrbitalStation.notifyDisrupted(OrbitalStation.java:602)
   at com.fs.starfarer.api.impl.campaign.econ.impl.BaseIndustry.setDisrupted(BaseIndustry.java:1793)
   at com.fs.starfarer.api.impl.campaign.econ.impl.OrbitalStation.disrupt(OrbitalStation.java:619)
   at exerelin.campaign.intel.invasion.InvActionStage.autoresolve(InvActionStage.java:357)
   at exerelin.campaign.intel.invasion.InvActionStage.updateStatus(InvActionStage.java:180)
   at com.fs.starfarer.api.impl.campaign.intel.raid.BaseRaidStage.advance(BaseRaidStage.java:106)
   at com.fs.starfarer.api.impl.campaign.intel.raid.ActionStage.advance(ActionStage.java:25)
   at exerelin.campaign.intel.invasion.InvActionStage.advance(InvActionStage.java:81)
   at com.fs.starfarer.api.impl.campaign.intel.raid.RaidIntel.advanceImpl(RaidIntel.java:219)
   at exerelin.campaign.intel.fleets.OffensiveFleetIntel.advanceImpl(OffensiveFleetIntel.java:579)
   at com.fs.starfarer.api.impl.campaign.intel.BaseIntelPlugin.advance(BaseIntelPlugin.java:78)
   at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
   at com.fs.starfarer.campaign.CampaignState.advance(Unknown Source)
   at com.fs.starfarer.BaseGameState.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.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

2
Modding / Help with Fatal: MISSILE weapons must fire missiles
« on: January 04, 2024, 07:30:59 PM »
I created a weapon and it works fine when I fire it. However, if I set my ship to AI control the game crashes with the message in the title.

proj file
Code
{
"id":"sfb_mine_caster_shot",
"specClass":"projectile",
"spawnType":"BALLISTIC",
"collisionClass":"PROJECTILE_FF",
"collisionClassByFighter":"PROJECTILE_FF",
"onFireEffect":"data.scripts.weapons.SFB_Mine_Caster_OnFireEffect",
"length":75,
"width":75,
"fadeTime":1,
"fringeColor":[68,250,150,255],
"coreColor":[112,165,192,255],
"explosionColor":[68,250,50,255],  # purely visual
"explosionRadius":30, # purely visual
"textureType":["graphics/fx/emp_arcs.png","graphics/fx/emp_arcs.png"],
"hitGlowRadius":100,
"textureScrollSpeed":0.0,
"pixelsPerTexel":5.0,
"bulletSprite":"graphics/missiles/sfb_Mine_Caster_shot.png"

weapon
Code
{
"id":"SFB_Mine_Caster",  # this id must match what's in the spreadsheet
"specClass":"projectile",
        "type":"MISSILE",
"size":"MEDIUM",
"displayArcRadius":550,
"turretSprite":"graphics/weapons/sfb_Mine_Caster_turret.png",
"turretGlowSprite":"graphics/weapons/sfb_Mine_Caster_turret.png",
"hardpointSprite":"graphics/weapons/sfb_Mine_Caster_turret.png",
"hardpointGlowSprite":"graphics/weapons/sfb_Mine_Caster_turret.png",

"glowColor":[68,150,150,255],

"turretOffsets":[28, 0],
"turretAngleOffsets":[0],
"hardpointOffsets":[28, 0],
"hardpointAngleOffsets":[0],

"barrelMode":"LINKED", # or ALTERNATING.  whether barrels fire at the same time or alternate.
"animationType":"MUZZLE_FLASH",

"muzzleFlashSpec":{"length":50.0,   # only used if animationType = MUZZLE_FLASH
   "spread":90.0,
   "particleSizeMin":5.0,
   "particleSizeRange":20.0,
   "particleDuration":0.25,
   "particleCount":25,
   "particleColor":[68,250,50,255]},

"autocharge":true,  # whether the weapon will continue charging and fire if the LMB is tapped instead of held
"projectileSpecId":"sfb_mine_caster_shot",  # projectile that will be fired
"fireSoundTwo":"mine_caster_fire",
}

I also tried copying an existing missile proj file and replacing stuff specific to my proj but this crashes the game on load with the useless message "Fatal: null" and nothing in the log file
Code
{
"id":"sfb_Mine_Caster_shot",
"specClass":"missile",
"missileType":"MISSILE",
"sprite":"graphics/missiles/sfb_Mine_Caster_shot.png",
"onFireEffect":"data.scripts.weapons.SFB_Mine_Caster_OnFireEffect",
"size":[6,8],
"center":[3,5],
"collisionRadius":5,
"collisionClass":"MISSILE_NO_FF",
"explosionColor":[255,255,100,255],  # purely visual, will get a white additively blended core on top of this color
"explosionRadius":90, # purely visual
"flameoutTime":0.5,
"noEngineGlowTime":0.5,
"fadeTime":0.5,
"engineSpec":{"turnAcc":360,
  "turnRate":360,
  "acc":2000,
  "dec":2000},
"engineSlots":[{"id":"ES1",
"loc":[-6, 0],
    "style":"CUSTOM",
"styleSpec":{
"mode":"QUAD_STRIP", # PARTICLES or QUAD_STRIP, determines which params are used
"engineColor":[240,163,32,255],
"glowSizeMult":1.5,
"contrailDuration":1,
"contrailWidthMult":0.75,
"contrailWidthAddedFractionAtEnd":1,  # can be negative. makes trail spread out/narrow at the end
"contrailMinSeg":5, # min segment length, in pixels
"contrailMaxSpeedMult":0.5f,
"contrailAngularVelocityMult":0.5f,
#"contrailSpawnDistMult":0f, # how far away from engine it starts
"contrailColor":[240,163,32,150],
"type":"SMOKE" # GLOW or SMOKE; additive or regular blend mode
},
    "width":4.0,
    "length":25.0,
    "angle":180.0},
    ]
}
Any help would be appreciated.

3
General Discussion / My shipyard stopped building ships
« on: October 16, 2023, 06:59:09 PM »
For some reason my shipyards have stopped building ships. I've had a small order in for months and it never finishes. The shipyards are not disrupted and I've cleared the queue and resubmitted it many times. Has anyone ever had this happen and/or know why it happens?


4
General Discussion / Why is the sell price one credit?
« on: September 30, 2023, 07:46:00 AM »
According to the F1 information at the port, this commodity is supposed to sell for 358 but it is only selling for 1. Why is that?


{edit] It seems that if I click on the planet it is 1 credit but if I click on the orbital station it is the correct price. I never realized there was a difference.

5
I'm staging a series of computer vs computer fights for testing and I've never noticed the enemy ships start having malfunctions. I even made a player ship with 10 minutes of combat readiness and it ran out while the enemy ships continued to be fine. Does combat readiness decrease only affect player ships?

6
I've owned the game since near the beginning and I've been launching it every day for the past few months. Why would it ask for the key now? I had a Java update but that's the only thing in common with StarSector that I can think of. Luckily, I had the key.

7
Modding / ChatGPT understands StarSector's API
« on: March 28, 2023, 05:01:36 PM »
Amazing.



Alex may not have to answer so many questions in the future.

8
Modding / Help wityh phasor effect please
« on: February 18, 2023, 07:49:40 PM »
Hello all. I've made a phasor effect that when applied to a limited duration beam like the phase lance or similar weapons causes the beam to 'move' from the point of aim off to the left or right up to 10 degrees. So it strafes over the target (and some of it probably misses).
It works by changing the weapon offset when it fires so the beam moves from initial position to the new offset. After it fires I reset the offset so it's ready to fire again.
The problem occurs if the battle ends before the weapons finishes firing (including the cooldown time).  Then the default aim position is offset by whatever it was last time it fired. So, the beam will always miss. My code is below. It was originally based on another mod where they had the beam sweep back and forth, but that's not exactly what I want in mine.
If anyone can see how to make sure the offsets are always reset, regardless of when the battle ends I would appreciate it. Of course if I'm totally doing this the hard way and there is an easier way that would be great too.

Note : ANGLES is an arraylist in the code but it has only one item. It was leftover from the original SCY code that had more than one intem.
Code
package data.scripts.weapons;
import java.lang.Math;
//import com.fs.starfarer.api.combat.BeamAPI;
//import com.fs.starfarer.api.combat.BeamEffectPlugin;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.util.IntervalUtil;
import org.lazywizard.lazylib.combat.CombatUtils;
//import org.lazywizard.lazylib.VectorUtils;
import java.awt.Color;
import java.util.*;
import org.lazywizard.console.Console;
import org.lwjgl.util.vector.Vector2f;

import com.fs.starfarer.api.Global;
import org.lwjgl.util.vector.ReadableVector2f;
import org.lazywizard.lazylib.FastTrig;
import java.util.Collection;
import com.fs.starfarer.api.combat.WeaponAPI;
import java.util.ArrayList;
import java.util.List;
import com.fs.starfarer.api.combat.EveryFrameWeaponEffectPlugin;

public class phasorEffect implements EveryFrameWeaponEffectPlugin
{

private float timer=0, randomization=0, perShotRandom = 0;
    private Vector2f muzzle= new Vector2f();
    private boolean  runOnce=false , hasFired=false, setInitialRandom = false;;
    private ArrayList<java.lang.Float> ANGLES = new ArrayList<java.lang.Float>();
private ArrayList<java.lang.Float> originalAngles = new ArrayList<java.lang.Float>();
//public static boolean runOnce=false ;
   
    public phasorEffect() {
        this.randomization = 0.0f;
}

 

    @Override
    public void advance(float amount, CombatEngineAPI engine, final WeaponAPI weapon)
    {

if (engine.isPaused()) {
            return;
        }
       
        //get the base offsets
        if(!runOnce){
// This still runs every frame at start of combat until I fire once
            runOnce=true;
            ANGLES=new ArrayList<java.lang.Float>(weapon.getSpec().getTurretAngleOffsets());

// store original angles
for(int i=0; i<ANGLES.size(); i++){
if (originalAngles.size() == 0){
originalAngles.add(ANGLES.get(i));
// Console.showMessage("setting orig angle " + i + " to " + ANGLES.get(i));
}
}

            randomization= (float)Math.random()*10;
            if(weapon.getSlot().isHardpoint()){
                muzzle=(Vector2f)weapon.getSpec().getHardpointFireOffsets().get(0);
            } else if(weapon.getSlot().isTurret()){
                muzzle=(Vector2f)weapon.getSpec().getTurretFireOffsets().get(0);
            }
        }
       
        //move the offsets while firing
        if(weapon.getChargeLevel()>0){
            timer+=amount;
if (!setInitialRandom) {
//Console.showMessage("setting new random at " + timer);
perShotRandom = (float)Math.random()*10 - 5f;
setInitialRandom = true;
//timer = 0;
}

            for(int i=0; i<ANGLES.size(); i++){
                //float offset=(float)FastTrig.cos(5*(timer+i+randomization))*2;
float offset=(float)FastTrig.cos(5*(perShotRandom+i+randomization))*10;

offset = offset * timer/2f;
java.lang.Float myAngle = (java.lang.Float)ANGLES.get(i);
                weapon.getSpec().getTurretAngleOffsets().set(i, myAngle+offset);
            }
        }     
       
        if(weapon.getChargeLevel()==1 && !hasFired){
            hasFired=true;
            //weapon glow
            Vector2f LOC = new Vector2f(weapon.getLocation());
            Vector2f.add(LOC, muzzle, LOC);
            engine.addHitParticle(
                    LOC,
                    weapon.getShip().getVelocity(),
                    40,
                    1f,
                    0.3f,
                    new Color(50,100,255,255)
            );
            engine.addHitParticle(
                    LOC,
                    weapon.getShip().getVelocity(),
                    20,
                    1f,
                    0.1f,
                    Color.WHITE
            );
        } else if(hasFired && weapon.getChargeLevel()==0){
            hasFired=false;
timer = 0f;
setInitialRandom = false;
this.randomization = (float)Math.random()*10;
// Reset turret angles for next time
for(int i=0; i<ANGLES.size(); i++){
weapon.getSpec().getTurretAngleOffsets().set(i, originalAngles.get(i));
}
        }

       
       
    }
}

9
Bug Reports & Support (modded) / Suddenly all of my fights are retreats
« on: February 05, 2023, 07:54:00 PM »
So this is strange. Suddenly every fight I accept, my ships are being pursued like I elected to run away. Even when I elect to pursue a fleet that is reluctant to fight I'm the one that is set as teh running away fleet. Has anyone else encountered this? Very confusing.

10
General Discussion / Does the campaign use dynamic ship generation?
« on: December 30, 2022, 05:59:53 PM »
Are the ships we encounter in the campaign put together dynamically (hull + weapons + hull mods) or do they have to exist as a variant already?

11
Modding / Adding inaccuracy to a beam?
« on: December 29, 2022, 03:54:50 PM »
I'd like a beam that 'rakes' across an area of space where it's aimed at instead of hitting with perfect accuracy. I tried editing the min.max spread in the csv but that's only for projectiles.

My thought now is to get the angle of the beam relative to the firing ship and move it +/- some amount every second. However, it seems all methods in BeamAPI are getters and not setters so I'm not sure how I would, programmatically, move the beams target point.
Any suggestions?

12
I'm trying to make a weapon that abosrbs flux over time and then , when it fires, does bonus damage equal to the flux it has absorbed.
My code is below. I have a class implementing BeamEffectPlugin and a listener class. The listener is adding teh flux to the battery but when I fire the weapon the check for this.ML.fluxBattery > 0  always fails. It knows what the listener is because if I print some other value like FLUX_PER_SECOND_CHARGE_RATE  from this.ML, it knows what that is.
I hope someone can tell me what I'm doing wrong here.

Code
package data.scripts.weapons;
import java.lang.Math;
import com.fs.starfarer.api.combat.*;
import com.fs.starfarer.api.combat.BeamAPI;
import com.fs.starfarer.api.combat.BeamEffectPlugin;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.util.IntervalUtil;
import org.lazywizard.lazylib.combat.CombatUtils;
import com.fs.starfarer.api.combat.listeners.AdvanceableListener;
import org.lazywizard.lazylib.VectorUtils;
import org.lazywizard.lazylib.MathUtils;
import org.lazywizard.console.Console;
import org.lazywizard.lazylib.CollisionUtils;
import com.fs.starfarer.api.combat.FluxTrackerAPI;
import com.fs.starfarer.api.loading.DamagingExplosionSpec;
import java.awt.Color;
import java.util.*;
import org.lwjgl.util.vector.Vector2f;
import static com.fs.starfarer.api.util.Misc.ZERO;

public class PlasmaMaulerEffect implements BeamEffectPlugin
{
public boolean listenerAttached = false;
public MaulerListenerScript ML = null;
public ShipAPI firer = null;

    @Override
    public void advance(float amount, CombatEngineAPI engine, BeamAPI beam)
    {
if (!listenerAttached) {
listenerAttached = true;
this.firer = beam.getSource();
this.ML  = new MaulerListenerScript(this.firer);
if (!beam.getSource().hasListenerOfClass(ML.getClass())) {
this.firer.addListener(ML);
}
}

if (this.ML == null) {
Console.showMessage("ML is null");
}
CombatEntityAPI target = beam.getDamageTarget();
if (this.ML.fluxBattery > 0 /* && beam.getBrightness() >= 1f && target instanceof ShipAPI */) {

Console.showMessage("*Flux battery*: " + this.ML.fluxBattery);

// TODO: add damage here
                        // Drain the batteries
//
this.ML.fluxBattery = 0;
}

    }

public class MaulerListenerScript implements AdvanceableListener {
private ShipAPI ship;
private FluxTrackerAPI fluxTracker = null;
public float fluxBattery = 0f;
private float time;
public float FLUX_PER_SECOND_CHARGE_RATE = 400f;
private float MAX_BATTERY_CAPACITY = 8000f;

public MaulerListenerScript(ShipAPI ship) {
this.ship = ship;
this.fluxTracker = ship.getFluxTracker();
}

public void advance(float amount) {
// increment our timer to collect fluxBattery
time += amount;
if (time > 1f)
{


// move flux into the battery
float amountOfFluxToRemove = FLUX_PER_SECOND_CHARGE_RATE * time;
float currentFlux = fluxTracker.getCurrFlux();
if (amountOfFluxToRemove > currentFlux) {
amountOfFluxToRemove = currentFlux;
}
this.fluxBattery += amountOfFluxToRemove;
if (this.fluxBattery > MAX_BATTERY_CAPACITY)
{
this.fluxBattery = MAX_BATTERY_CAPACITY;
}

//Console.showMessage("Flux battery: " + this.fluxBattery);
//Console.showMessage("Current flux level: " + fluxTracker.getFluxLevel());
fluxTracker.decreaseFlux(amountOfFluxToRemove);
time = 0f;
}
}
}

}

13
General Discussion / Friendly fire, collisions turned off?
« on: December 22, 2022, 01:18:17 PM »
I don't know if they removed friendly fire and collisions or if I accidentally turned them off but I miss it. Can anyone tell me if this is a setting somewhere? Or if it's modded, the command that disables it so I can search for it in my installed mods.

14
Modding / Is it possible to modify which proj a weapon fires during combat
« on: December 11, 2022, 06:11:46 AM »
I want to make a weapon that has two modes, call them slug and shotgun. All the differences between them are in the proj class that the weapon fires. Is it possible to bind a hotkey that changes what proj a weapon fires and be able to call it during combat?
I see in the WeaponSpecAPI there is a GetProjectileSpec() but I don't see any setter method.

15
Modding / How to create a hullmod that provides benefit based on hull size
« on: December 08, 2022, 03:44:44 PM »
I want to create a hull mode that reduces the fuel used by small ships. I assume I do that in applyEffectsAfterShipCreation() like many examples I've seen. However, I need a reference to the shipAPI for the ship the mod is going on, right? How do I get that?
Once I have it I think I can use ship.getMutableStats().getFuelUseMod().modifyFlat(id, -1f); to do what I want.

Thanks in advance for any help.

Pages: [1] 2 3