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)

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.

Messages - rogerbacon

Pages: 1 ... 6 7 [8] 9 10
106
Modding / Re: Vector2f not recognized
« on: January 06, 2021, 11:50:32 AM »
OK, Thanks guys. It seems that the order of the import statements matter and if there is a problem with one maybe the others are skipped? I finally got it working with the suggestions above.

107
Modding / Re: Vector2f not recognized
« on: January 04, 2021, 03:07:09 PM »
you have not provided sufficient information to diagnose your issue.
provide the entire script and a crash log, including stack trace of the exact problem.

OK. I've edited the first post to include the java class and the error log.

108
Modding / Re: Vector2f not recognized
« on: January 04, 2021, 09:52:32 AM »
I can't believe no one knows how to fix this issue. The script worked before and the method signature hasn't changed so what's up?

109
Modding / How to add a hullMod to a ship in a mission (not campaign)
« on: December 29, 2020, 11:59:11 AM »
I'm creating a mission like randomBattle and I want to get each ship and add a hullMod as the ship is added to the player's fleet. How should I do this? I think I'm close but its not quite working. Here's what I've tried so far.

Code
BattleCreationContext batContext = api.getContext();
CampaignFleetAPI playerFleet = batContext.getPlayerFleet();
FleetMemberAPI ship = api.addToFleet(FleetSide.PLAYER, "astral_Elite", FleetMemberType.SHIP, false);
api.addBriefingItem("ship is " + ship.getVariant().getHullMods());
ship.getVariant().addMod("some_HullMod");

110
Modding / Vector2f not recognized
« on: December 23, 2020, 09:18:59 AM »
I have a mod I made about 4 years ago and I wanted to update it but I'm getting a "Cannot determine simple type of 'Vector2f'"

I believe I have the right import for the Vector2f class.

[Edit]. Now the error message is different.

Here is my class
http://s000.tinyupload.com/index.php?file_id=08048878206568048916

Here is the log
http://s000.tinyupload.com/index.php?file_id=28263378194853936554

The error message says :
Error compiling [data.scripts.weapons.SFB_PlasmaOnHitEffect]
java.lang.RuntimeException: Error compiling [data.scripts.weapons.SFB_PlasmaOnHitEffect]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: 1 error(s) while compiling unit "data/scripts/weapons/SFB_PlasmaOnHitEffect.java"
   at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:226)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:178)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)



111
Bug Reports & Support / Re: New Game: Can't get past ship selection
« on: August 08, 2016, 07:29:13 PM »
Yeah, its with mods. I tried disabling the mods but the game wouldn't even load.
Interestingly, I can load and play saved games just fine. I just can't start a new one. I'll try a clean install later this week and report back.

112
Bug Reports & Support / New Game: Can't get past ship selection
« on: August 08, 2016, 06:12:52 PM »
Starting a new game I select my name, my role (smuggler, bounty hunter, etc) and then select my starting ship. After that the process does not advance. I can select the ship ove and over but there is no further progress on creating the game. This is the latest version 7.2a rc 3. I can play missions just fine, however.

113
Mods / Re: [0.7.2a] Console Commands v2.7 (released 2015-12-16)
« on: April 25, 2016, 03:00:41 PM »
I just updated to the latest version of StarSector after not playing awhile. This mod worked great before (and thanks to the tutorial I even made my own commands) but now when I type ctrl-backspace nothing happens. Is there something in the base game I need to enable to make the console appear? It's been awhile since I played.

If it's not appearing in campaign: dunno what's wrong

If it's not appearing in combat: The input goes into a separate window, which takes a while to appear the first time (it does give a pronounced framerate drop on my machine though) and doesn't automatically take focus. You need to Alt-Tab to it.

That was it. It was opening in the background. Alt-Tabbing brought it up. Thanks.

114
Mods / Re: [0.7.2a] Console Commands v2.7 (released 2015-12-16)
« on: April 24, 2016, 09:04:41 AM »
I just updated to the latest version of StarSector after not playing awhile. This mod worked great before (and thanks to the tutorial I even made my own commands) but now when I type ctrl-backspace nothing happens. Is there something in the base game I need to enable to make the console appear? It's been awhile since I played.

115
General Discussion / Re: speculations on upcoming Phase Cloak changes
« on: January 25, 2016, 12:51:20 PM »
I'd like to see seeking weapons lose their lock-on when a ship cloaks. They should stop tracking and fly on a straight path until the ship uncloaks, whereupon they could resume tracking if they still have flight time remaining.

116
I'd also like to be able to deploy more than one of a ship type.

117
Is there a way to tell how much damage has been done to a projectile by point defenses and other sources? The game must keep track because it knows when to destroy the projectile.

CombatEntityAPI.getHitpoints() and CombatEntityAPI.getMaxHitpoints()


Is there a way to work out whether a ship is currently repairing fighters?

I can't seem to find a way to work out whether flight decks are in use... or even get at the flight decks for a ship in any form via the API.

I can work out (I think) if a fighter wing is attempting to go to a flight deck (via ShipAPI.isLanding() and ShipAPI.IsFinishedLanding()) but is that the best I can get at the moment?

I don't think there's a way. Added a FighterLaunchBayAPI.openForLanding() method...


edit2: I found a workaround. I define the weapon as having 1 damage in the csv and then assign all the damage through the script. It's not ideal but it works for now. I'm still hoping that there is some method that can affect a shot's damage before it assigns it to its target.

There isn't, unfortunately. May end up adding that at some point.

Thank you for the answers.

118
Is there a way to tell how much damage has been done to a projectile by point defenses and other sources? The game must keep track because it knows when to destroy the projectile.

119
Modding / Re: Can you disable a weapon mount with a hullmod?
« on: January 03, 2016, 08:15:49 AM »
Thanks Zaphide. I really appreciate that.

120
I'm trying to modify the damage of a seeking weapon based on the time its been in existence. Here is my code. The console messages show that the math is right but its still doing full damage. I'm assuming the onHitEffectPlugin is called before damage is assigned but maybe I'm wrong.

edit: I added a check for didDamage() and it looks like the projectile has already done its full damage before the onHit gets called. So, what method should I be implementing to change the damage BEFORE it does its full damage?

edit2: I found a workaround. I define the weapon as having 1 damage in the csv and then assign all the damage through the script. It's not ideal but it works for now. I'm still hoping that there is some method that can affect a shot's damage before it assigns it to its target.

Code
package data.scripts.weapons;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.SoundAPI;
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.DamagingProjectileAPI;
import com.fs.starfarer.api.combat.FluxTrackerAPI;
import com.fs.starfarer.api.combat.OnHitEffectPlugin;
import com.fs.starfarer.api.combat.ShipAPI;
import data.scripts.util.TEM_Twig;
import java.awt.Color;
import org.lazywizard.lazylib.MathUtils;
import org.lazywizard.lazylib.combat.entities.SimpleEntity;
import org.lwjgl.util.vector.ReadableVector2f;
import org.lwjgl.util.vector.Vector2f;
import org.lazywizard.console.Console;

public class SFB_PlasmaROnHitEffect implements OnHitEffectPlugin {

private static final float PlasmaRMaxFlightTime = 10.0f;

    public void onHit(DamagingProjectileAPI projectile, CombatEntityAPI target, Vector2f point, boolean shieldHit, CombatEngineAPI engine) {
        if (target == null || point == null) {
            return;
        }
Console.showMessage("In onHit method");

        if (target instanceof ShipAPI)
{

            ShipAPI ship = (ShipAPI)target;
float flightTime = projectile.getElapsed();
float damagedecay = Math.min(1.0f, (flightTime/PlasmaRMaxFlightTime));
projectile.setDamageAmount(projectile.getDamageAmount()* ( 1.0f - damagedecay ));
Console.showMessage("Damage " + projectile.getDamageAmount());

        }
    }
}

Pages: 1 ... 6 7 [8] 9 10