Fractal Softworks Forum

Please login or register.

Login with username, password and session length

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

Pages: [1]
1
Thanks for the release Alex , having lots of fun with the new DamageListener. Noticed some things while logging all damage events:

- Beams hitting cause many 0-damage events of type OTHER to be generated
- If a large ship dies and goes nova, the ship that got the last hit is credited as dealing a large amount of explosive damage to the already dead ship (see below - Wasp is a fighter, Ultimatum is an Atlas-class superfreighter). However, the actual killing shot does not seem to be recorded

Are these intended? Just curious about the underlying logic behind these.

Code
204959 [0] Wasp -> [1] SIM Ultimatum : [OTHER] ??0 damage?? (47.41/8000 hp - alive)
204959 [0] Wasp -> [1] SIM Ultimatum : [OTHER] ??0 damage?? (47.41/8000 hp - alive)
204959 [0] Xyphos -> [1] SIM Ultimatum : [ENERGY-DPS] shields:5 (47.41/8000 hp - alive)
204975 [0] Aspect -> [1] SIM Ultimatum : [ENERGY] hull:39.38 emp:200 (8.03/8000 hp - alive)
204975 [0] ISS All Under Sky -> [1] SIM Ultimatum : [OTHER] ??0 damage?? (8.03/8000 hp - alive)
204975 [0] ISS All Under Sky -> [1] SIM Ultimatum : [OTHER] ??0 damage?? (8.03/8000 hp - alive)
204975 [0] ISS All Under Sky -> [1] SIM Ultimatum : [OTHER] ??0 damage?? (8.03/8000 hp - alive)
204976 [0] Wasp -> [1] SIM Ultimatum : [ENERGY-DPS] hull:5.61 (2.43/8000 hp - alive)
204976 [0] Wasp -> [1] SIM Ultimatum : [OTHER] ??0 damage?? (2.43/8000 hp - alive)
204979 [0] Wasp -> [1] SIM Ultimatum : [HIGH_EXPLOSIVE] hull:1993.77 (0/8000 hp - dead)
204979 [0] Wasp -> [1] SIM Ultimatum : [HIGH_EXPLOSIVE] hull:1375.62 armor:36.56 (0/8000 hp - dead)
204980 [0] Wasp -> [1] SIM Ultimatum : [HIGH_EXPLOSIVE] hull:1870.68 armor:2.95 (0/8000 hp - dead)
204980 [0] Wasp -> [1] SIM Ultimatum : [HIGH_EXPLOSIVE] hull:1237.42 armor:19.61 (0/8000 hp - dead)
204980 [0] Wasp -> [1] SIM Ultimatum : [HIGH_EXPLOSIVE] hull:1397.61 (0/8000 hp - dead)
204980 [0] Wasp -> [1] SIM Ultimatum : [HIGH_EXPLOSIVE] hull:1365.56 (0/8000 hp - dead)
204980 [0] Wasp -> [1] SIM Ultimatum : [HIGH_EXPLOSIVE] hull:1996.21 armor:22.88 (0/8000 hp - dead)
204981 [0] Wasp -> [1] SIM Ultimatum : [HIGH_EXPLOSIVE] hull:1695.68 armor:96.57 (0/8000 hp - dead)
204981 [0] Wasp -> [1] SIM Ultimatum : [HIGH_EXPLOSIVE] hull:1444.01 armor:50 (0/8000 hp - dead)
204981 [0] Wasp -> [1] SIM Ultimatum : [HIGH_EXPLOSIVE] hull:1170.82 armor:133.33 (0/8000 hp - dead)
204981 [0] Wasp -> [1] SIM Ultimatum : [HIGH_EXPLOSIVE] hull:2446.18 (0/8000 hp - dead)


2
I want to doSomething() exactly once at the end of a battle, but this only seems to work reliably when the combat auto-ends because only one side is left on the field. When I press Escape and claim victory, doSomething() is often not called at all.

Is this the proper way to check if combat has finished? Searched this thread and found engine.isEnemyInFullRetreat() as an option, but it doesn't fit my purposes (you can continue mopping up the enemy after the "press escape" prompt appears).

You know, I actually have no idea. I'd be curious to know how mods handle this, since I'm pretty sure they do.

There's FleetEventListener? I can think of other stuff that might work, but the listener is the surest and safest way AFAIK.

I think I got it, thanks all for the help... was only interested in getting the final CombatDamageData after the battle, looks like BaseCampaignEventListener.reportPlayerEngagement(EngagementResultAPI result) is the proper way to do it.

[Edit] While implementing this, ran into the error "Failed to find script of class com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl" described here: https://fractalsoftworks.com/forum/index.php?topic=15573.0

Solved it by setting the target version for my compiled code to 7, it seems that Janino doesn't like anything greater than that. Is this a known issue?

[Edit] More informative error message in 0.95a "Compiled for the wrong version of Java, change the compile target to Java 7"

3
I have this code in my EveryFrameCombatPlugin:

Code
  private static boolean done = false;
  private CombatEngineAPI engine; /* initialized in init() method */

  @Override
  public void advance(float amount, List events) {

    if(engine == null || !engine.isInCampaign()) {
      return;
    }
   
    if(engine.isCombatOver() && !done) {
      doSomething();
      done = true;
    }

  }
I want to doSomething() exactly once at the end of a battle, but this only seems to work reliably when the combat auto-ends because only one side is left on the field. When I press Escape and claim victory, doSomething() is often not called at all.

Is this the proper way to check if combat has finished? Searched this thread and found engine.isEnemyInFullRetreat() as an option, but it doesn't fit my purposes (you can continue mopping up the enemy after the "press escape" prompt appears).

4
Is there an upper limit on the number of ShipAPI instances that can be present in a single battle?

Is the mass of ships (CombatEntityAPI.getMass(), ShipAPI.getMassWithModules(), etc) in any particular unit? Tons?

5
Modding / "Detailed kill list" mod, is this possible?
« on: August 15, 2016, 11:36:53 PM »
Would it be possible to keep a log of the ships and named characters that I've killed in battle?

Thinking of something like the absurdly detailed kill lists in Dwarf Fortress:

Spoiler
[close]

I have some Java programming experience, but would like advice from those more familiar with the Starsector API.

Pages: [1]