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: Planet Search Overhaul (07/13/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
I made a custom AI script for a ship system and I'm 99% sure its the cause of null reference crashes I'm having in combat. Here is the log:
Code
271369 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.combat.ai.o0OO.o00000(Unknown Source)
at com.fs.starfarer.combat.ai.BasicShipAI.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.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

And here is the class

Code
// 
// Decompiled by Procyon v0.5.36
//


package data.scripts.ai.systems;

import com.fs.starfarer.api.Global;
import org.lazywizard.lazylib.MathUtils;
import org.lwjgl.util.vector.Vector2f;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.util.IntervalUtil;
import com.fs.starfarer.api.combat.ShipSystemAPI;
import com.fs.starfarer.api.combat.ShipwideAIFlags;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipSystemAIScript;
import com.fs.starfarer.api.util.Misc;
import java.util.Iterator;
import java.util.ArrayList;
import java.util.List;

public class sfb_CloakingDevice_ai_simple implements ShipSystemAIScript
{
    private ShipAPI ship;
    private ShipwideAIFlags flags;
    private ShipSystemAPI system;
    private final IntervalUtil tracker;
private float cloakDuration = 0f;

   
    public sfb_CloakingDevice_ai_simple() {
        this.tracker = new IntervalUtil(0.75f, 1.0f);
    }
   
    public void init(final ShipAPI ship, final ShipSystemAPI system, final ShipwideAIFlags flags, final CombatEngineAPI engine) {
        this.ship = ship;
        this.flags = flags;
        this.system = system;
    }
   
    public void advance(final float amount, final Vector2f missileDangerDir, final Vector2f collisionDangerDir, final ShipAPI target) {
if (this.ship == null) {
return;
}

        this.tracker.advance(amount);
this.cloakDuration += amount;
boolean shouldAttack = false;
ShipAPI closestEnemy = null;
        if (this.tracker.intervalElapsed()) {
            if (this.system.isActive()) {
closestEnemy = FindClosestNonFighterShipWithOwner(this.ship, 1);
if (closestEnemy != null) {
if (!MathUtils.isWithinRange(closestEnemy.getLocation(), this.ship.getLocation(), 1000000.0f)) {
shouldAttack = true;
}
if ( IsCloakedShipBehind(this.ship, closestEnemy)) {
shouldAttack = true;
}
}
                if (!this.ship.areSignificantEnemiesInRange()
|| closestEnemy == null
|| shouldAttack
|| this.flags.hasFlag(ShipwideAIFlags.AIFlags.SAFE_VENT )) {
if (this.cloakDuration > 6f) {
ShipAPI myTarget = this.ship.getShipTarget();
if (myTarget != null && myTarget.getOwner() == 0) {
this.ship.setShipTarget(null); // try to prevent friendly fire when decloaking
}
this.system.deactivate();
}

                }
            }
            else if (this.ship.isRetreating() || this.flags.hasFlag(ShipwideAIFlags.AIFlags.IN_CRITICAL_DPS_DANGER)
|| this.flags.hasFlag(ShipwideAIFlags.AIFlags.BACKING_OFF )) {
                this.ship.useSystem();
this.cloakDuration = 0f;
            }
        }
    }

public static ShipAPI FindClosestNonFighterShipWithOwner(ShipAPI cloakedShip, int owner) {
        List<ShipAPI> allShips = Global.getCombatEngine().getAllShips(); 
        ShipAPI closestNonFighterShip = null;
        float closestDistance = Float.MAX_VALUE;
       
        for (ShipAPI ship : allShips) {
                if (ship.getOwner() == owner && !ship.isFighter() && !ship.isHulk()) {
                    float distance = MathUtils.getDistance(ship.getLocation(), cloakedShip.getLocation());
                    if (distance < closestDistance) {
                        closestNonFighterShip = ship;
                        closestDistance = distance;
                    }
                }
           
        } 
        return closestNonFighterShip;
    }

public static boolean IsCloakedShipBehind(ShipAPI cloakedShip, ShipAPI otherShip) {
        // Get the direction vector from otherShip to cloakedShip
        //Vector2f directionVector = MathUtils.getVector(otherShip.getLocation(), cloakedShip.getLocation());
       
        // Get the forward facing vector of otherShip
        Vector2f forwardVector = otherShip.getLocation();
       
float angle = Misc.getAngleInDegrees(cloakedShip.getLocation(), forwardVector);
        // Calculate the angle between direction vector and forward vector
        //float angle = MathUtils.getShortestRotation(forwardVector, directionVector);
       
        // Check if the angle is greater than 90 degrees
        return Math.abs(angle) > Math.PI / 2f;
    }
}


2
Modding / Null reference in my script somewhere
« on: June 24, 2024, 04:43:09 PM »

3
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)

4
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.

5
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?


6
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.

7
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?

8
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.

9
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.

10
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));
}
        }

       
       
    }
}

11
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.

12
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?

13
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?

14
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;
}
}
}

}

15
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.

Pages: [1] 2 3