Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: End of Battle  (Read 2804 times)

TheOverWhelming

  • Ensign
  • *
  • Posts: 34
    • View Profile
End of Battle
« on: April 24, 2014, 01:59:42 PM »

I've been messing around with the tools available (made Eclipse work with Starsector, JSON editor just complains about the end } all the time) and the Ship Editor
I'm messing around with EveryFrameCombatPlugin and I was curious about a few things

I've noticed there are write restrictions (I was gonna test some stuff for logging), is there an easy way to log what you're doing to ensure things are operating properly?  Preferably without using Starsector.log because of how huge it is

for EveryFrameCombatPlugin, what is the float given to the "advance" method?  I'm assuming it's just the amount of events from InputEventAPI since the last frame (where it gets called every frame) but I'm not sure yet since List can be iterated pretty easily

Also, what could be causing the Starsector startup to always default to a lower resolution and disable sound?  All I did was enable devmode, set undecoratedWndow to true and in my mod I was testing around I temporarily added a settings.json to change some values.

Edit: Yeah no idea what that float represents
« Last Edit: April 24, 2014, 03:28:45 PM by TheOverWhelming »
Logged

Farlarzia

  • Commander
  • ***
  • Posts: 169
    • View Profile
Re: End of Battle
« Reply #1 on: April 24, 2014, 02:12:53 PM »

Dev mod for some reason always set it to a default resolution in the launcher, and turns off sound and full screen, so that's what's doing that
Logged

TheOverWhelming

  • Ensign
  • *
  • Posts: 34
    • View Profile
Re: End of Battle
« Reply #2 on: April 24, 2014, 02:48:10 PM »

Ohh, thanks
Good to know
I forgot to also ask if you can tell when the End of Battle is (hence the Subject, hurpa durp) with the EveryFrameCombatPlugin or if it just stops getting called

Edit: Well, advance does get called every frame but still no idea what the float amount is.  Tried to understand by having my ship face amount*10 and it just sat there.. amount*100 seemed to go between 0 and 40 degrees though.. weird
« Last Edit: April 24, 2014, 04:18:10 PM by TheOverWhelming »
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: End of Battle
« Reply #3 on: April 24, 2014, 04:49:19 PM »

Amount is the update time; if you need the elapsed time, there's a function for that, too.

End of Battle can be suppressed via CombatEngineAPI setDoNotEndCombat(true).
Logged
Please check out my SS projects :)
Xeno's Mod Pack

TheOverWhelming

  • Ensign
  • *
  • Posts: 34
    • View Profile
Re: End of Battle
« Reply #4 on: April 24, 2014, 05:07:39 PM »

So for EveryFrameCombatPlugin Amount would be the time it took to update that frame?

I don't mean suppressing it, but for when it happens, like for independent threads

Edit: Does spawnAsteroid even work?  I can't seem to make it work
« Last Edit: April 24, 2014, 05:19:22 PM by TheOverWhelming »
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: End of Battle
« Reply #5 on: April 24, 2014, 05:44:24 PM »

spawnAsteroid doesn't happen in EveryFrameCombatPlugin; it has to get set up at battle start when the battlefield is initialized. 

There is no hook to catch the end of a battle in the API, but you can choose when to end it, which amounts to the same thing.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

TheOverWhelming

  • Ensign
  • *
  • Posts: 34
    • View Profile
Re: End of Battle
« Reply #6 on: April 24, 2014, 06:24:14 PM »

I mean CombatEngineAPI.spawnAsteroid, not MissionDefinitionAPI.addAsteroidField

addAsteroidField works, I know that
Using spawnAsteroid gives me 0 results all the time in EveryFrameCombatPlugin, in advance or init.

Logged