Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 2 3 [4] 5 6 ... 16

Author Topic: [0.97a] LazyLib v2.8b (released 2024-02-02)  (Read 990773 times)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: LazyLib v1.6 (.6a, released 2013-09-27)
« Reply #45 on: September 27, 2013, 10:01:10 PM »

So remember when I said 1.6 wouldn't be released until after .6.1a?

I lied. ;D

1.6 is up, get it here (mirror).

Changelog:
Quote
1.6 (September 27, 2013)
==========================
Updated the codebase to use the new .6a methods
Deprecated several methods whose functionality is now included within the API
Usage of deprecated methods is now reported in starsector.log if devMode=true
Changes to AIUtils:
 - All methods now only return entities that are visible on the battle map.
   Note: this change may alter the behavior of existing scripts!
   (use CombatUtils if you wish to find ships regardless of fog of war coverage)
 - Changed canUseSystemThisFrame() so it only returns true when the system can
   be toggled (essentially checks if the 'use system' key would do anything).
   This was the intended behavior of this method, but some old scripts might
   rely on the old, broken behavior and need to be changed.
Changes to CollectionUtils:
 - SortXByDistance constructors now have an optional includeRadius parameter
   that sets if collision/interaction radius is considered (defaults to true)
 - implode() now works with any Collection, not just one containing Strings
 - Deprecated CollectionUtils.SortObjectivesByDistance as BattleObjectiveAPI
   now extends CombatEntityAPI (use SortEntitiesByDistance instead)
 - Deprecated weightedRandom(Map pickFrom) in favor of
   com.fs.starfarer.api.util.WeightedRandomPicker
 - Deprecated weightedRandom(Map pickFrom, int numToPick) in favor of
   com.fs.starfarer.api.util.WeightedRandomPicker (call pick() multiple times)
Changes to CombatUtils:
 - Deprecated getCombatEngine() in favor of Global.getCombatEngine()
 - Deprecated getElapsedCombatTime() in favor of
   CombatEngineAPI,getTotalElapsedTime()
 - Deprecated getElapsedCombatTimeIncludingPaused() in favor of
   CombatEngineAPI,getTotalElapsedTime()
 - Deprecated getTimeSinceLastFrame() in favor of
   CombatEngineAPI.getElapsedInLastFrame()
Changes to DefenseUtils:
 - Deprecated getArmorCellAtWorldCoord(ShipAPI ship, Vector2f loc)
   in favor of ArmorGridAPI.getCellAtLocation(Vector2f loc)
Changes to LazyLib:
 - Now logs the current LazyLib version on game load
 - Added setLogLevel(Level level), sets the log level for all utility classes
   (defaults to Level.DEBUG for dev builds, Level.ERROR for main releases)
Changes to MathUtils:
 - Added getRandomPointOnLine(Vector2f lineStart, Vector2f lineEnd)
 - Added isPointOnLine(Vector2f point, Vector2f lineStart, Vector2f lineEnd)
 - The various getDistance() methods involving SectorEntityTokens now
   take interaction radius into account. Note: this change may alter the
   behavior of existing scripts!
 - getDistanceSquared() methods incorporating a radius are no longer marked
   as deprecated, instead the documentation includes a warning that using
   getDistance() may be just as efficient
Changes to WeaponUtils:
 - Fixed inaccuracies with getTimeToAim(), but method doesn't take ship
   turn speed into account anymore
 - All calculateDamage() methods are now marked as deprecated. There are just
   too many factors going into damage for this to be testable (26 MutableStats
   that affect damage dealt/taken as of .6a, let alone armor damage reduction).
« Last Edit: September 27, 2013, 10:07:55 PM by LazyWizard »
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: LazyLib v1.6 (.6a, released 2013-09-27)
« Reply #46 on: September 27, 2013, 10:30:37 PM »

Ah hell yeah.  Good news to see right before bed.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: LazyLib v1.6 (.6a, released 2013-09-27)
« Reply #47 on: September 27, 2013, 11:54:38 PM »

Quote
getRandomPointOnLine
Yay!
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Gotcha!

  • Admiral
  • *****
  • Posts: 1124
    • View Profile
    • Welcome to New Hiigara
Re: LazyLib v1.6 (.6a, released 2013-09-27)
« Reply #48 on: September 28, 2013, 07:09:51 AM »

Hi LazyWizard,

Apparently my Bushi mod stopped functioning with LazyLib 1.6.

The menu appears and then the game crashes, giving this error:

Code
28916 [Thread-6] ERROR com.fs.starfarer.combat.D  - java.lang.NullPointerException
java.lang.NullPointerException
at org.lazywizard.lazylib.combat.CombatUtils.getShipsWithinRange(CombatUtils.java:176)
at org.lazywizard.lazylib.combat.CombatUtils.getShipsWithinRange(CombatUtils.java:208)
at data.scripts.plugins.BushiLightningGunEffect.advance(BushiLightningGunEffect.java:34)
at com.fs.starfarer.combat.entities.ship.A.G.advance(Unknown Source)
at com.fs.starfarer.combat.systems.void.?0000(Unknown Source)
at com.fs.starfarer.combat.systems.void.advance(Unknown Source)
at com.fs.starfarer.combat.entities.Ship.advance(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
at com.fs.starfarer.title.B.super(Unknown Source)
at com.fs.starfarer.new.????00(Unknown Source)
at com.fs.oOOO.super.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)

Line 34 in BushiLightningGunEffect.java is this:
Code
List nearbyEnemies = CombatUtils.getShipsWithinRange(beam.getTo(), 750f);

Help plx!
Logged
  

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: LazyLib v1.6b (.6a, released 2013-09-28)
« Reply #49 on: September 28, 2013, 07:26:41 AM »

1.6b is up, get it here (mirror).

This reverts some changes in 1.6 that caused a null pointer exception if you tried to use certain methods on the main title screen.
« Last Edit: September 28, 2013, 07:29:00 AM by LazyWizard »
Logged

Gotcha!

  • Admiral
  • *****
  • Posts: 1124
    • View Profile
    • Welcome to New Hiigara
Re: LazyLib v1.6b (.6a, released 2013-09-28)
« Reply #50 on: September 28, 2013, 07:37:39 AM »

Wow, that was fast. Thanks! That did the trick.
Logged
  

TimeDiver

  • Captain
  • ****
  • Posts: 353
    • View Profile
Re: LazyLib v1.6b (.6a, released 2013-09-28)
« Reply #51 on: September 28, 2013, 10:44:42 PM »

LazyWizard, using v1.6b, my 'starsector.log' file is being spammed with thousands of instances of the recurring line:

Code
147289 [Thread-5] WARN  org.lazywizard.lazylib.combat.CombatUtils  - Using deprecated method getCombatEngie()

According to your changelog, this kind of output should only be logged if 'devMode=true', and a quick check of my 'starsector-core\data\config\settings.json' file confirms that devMode is set to false.

It's more than a tad annoying, and the .log file is nearly well into the double-megabytes file size range after a good half-hour of gameplay.
« Last Edit: September 28, 2013, 11:55:35 PM by TimeDiver »
Logged

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: LazyLib v1.6b (.6a, released 2013-09-28)
« Reply #52 on: September 28, 2013, 11:52:14 PM »

I'm having the same issue as TimeDiver, went to look at my log and it was 140 megabytes.

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: LazyLib v1.6b (.6a, released 2013-09-28)
« Reply #53 on: September 29, 2013, 12:22:15 AM »

Oops, forgot to set a flag before releasing 1.6b. Try re-dowloading and see if it's fixed.

Edit: also changed it so calling CombatUtils.getCombatEngine() isn't logged since that's still used internally due to the fix necessary for 1.6b.
« Last Edit: September 29, 2013, 12:44:02 AM by LazyWizard »
Logged

TimeDiver

  • Captain
  • ****
  • Posts: 353
    • View Profile
Re: LazyLib v1.6b (.6a, released 2013-09-28)
« Reply #54 on: September 29, 2013, 01:02:32 AM »

Confirmed; revised v1.6b no longer bloats the starsector.log file, regardless of devMode being disabled.

Thanks for the prompt response, and for definitely not giving credence to your chosen user name!
Logged

Uomoz

  • Admiral
  • *****
  • Posts: 2663
  • 'womo'dz
    • View Profile
Re: LazyLib v1.6b (.6a, released 2013-09-28)
« Reply #55 on: October 07, 2013, 05:57:32 AM »

It's amazing how important this mod is to code in an efficient manner. Kudos again, LW.
Logged

Deathven

  • Commander
  • ***
  • Posts: 221
  • "Contigo ergo sum" - Descartes
    • View Profile
Re: LazyLib v1.6b (.6a, released 2013-09-28)
« Reply #56 on: November 11, 2013, 03:41:49 PM »

Shows how important the work of a single person can be! Thanks LazyWizard for all of your hard work to allow us to play mods and create them!  ;D
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: LazyLib v1.7 (.6.1a, released 2013-12-18)
« Reply #57 on: December 18, 2013, 08:03:46 PM »

1.7 is up, get it in the main post.

A lot of new things have been added, a few bugs were squashed, some old methods were shuffled around, and loads of existing methods have been marked deprecated.

Here's the obscenely long list of changes:
Spoiler
Quote
1.7 (December 18, 2013)
=========================
Swapped all usages of CombatUtils.getCombatEngine() to Global.getCombatEngine()
Significant JavaDoc expansion, reformatting, and other readability improvements
Deprecated all methods with a sortByDistance parameter
 - Call Collections.sort() using one of CollectionUtils' Comparators instead
Added lazylib_settings.json:
 - "logDeprecated" sets whether to log usage of deprecated LazyLib methods,
   useful for modders since these will eventually be removed from LazyLib
 - "crashOnDeprecated", if true will throw a RuntimeException when a deprecated
   LazyLib method is used (for modders to track down usage via the stacktrace)
Added DrawUtils (in new org.lazywizard.lazylib.opengl package):
 - drawCircle(float centerX, float centerY, float radius, int numSegments)
 - drawArc(float centerX, float centerY, float radius, float startAngle,
   float arcAngle, int numSegments)
Added VectorUtils:
 - getAngle(Vector2f from, Vector2f to) (moved from MathUtils)
 - getFacing(Vector2f vector) (moved from MathUtils)
 - getCrossProduct(Vector2f vector1, Vector2f vector2)
 - rotate(Vector2f toRotate, float degrees, Vector2f dest)
 - rotateAroundPivot(Vector2f toRotate, Vector2f pivotPoint, float angle,
   Vector2f dest), rotates a Vector2f around another Vector2f
Changes to CollectionUtils:
 - Added CollectionFilter interface, contains accept(Object obj) method
 - Added filter(Collection toFilter, CollectionFilter filter), allows
   predicate-based Collection filtering
 - Added filter(Collection toFilter, List filters), a more efficient way of
   using multiple filters on a Collection at once
 - These methods support generics
Changes to CollisionUtils:
 - Fixed getCollisionPoint() returning null when collision point lies directly
   on the end of a line (this means getCollisionPoint(beam.getFrom(),
   beam.getTo(), beam.getDamageTarget()) actually works again)
 - Fixed getCollides() instantiating a new Line2D object each time it's called
Changes to CombatUtils:
 - No longer implements EveryFrameCombatPlugin (also removed LazyLibCombatHook)
 - Updated getFleetMember() to use DeployedFleetMemberAPI introduced in .6.1a
   (this means it now works in missions, not just in campaign battles)
 - Added isVisibleToSide(CombatEntityAPI entity, int side)
Changes to FleetUtils:
 - Fixed null pointer exception when using these methods in hyperspace
 - Added getRelation(CampaignFleetAPI fleet1, CampaignFleetAPI fleet2)
 - Added getNearbyFleets(CampaignFleetAPI fleet, float range)
Changes to MathUtils:
 - Added getRandomPointInCone(Vector2f center, float radius, float minAngle,
   float maxAngle), returns a random point in a two-dimensional cone
 - Added getShortestRotation(float currAngle, float destAngle), returns the
   smallest difference between two angles. This can also be used to find the
   best turn direction
Changes to SimpleEntity:
 - Added a constructor for mimicking the location of a WeaponAPI w/o reflection
 - Added getWeapon() method, returns null if another constructor was used
 - Added getType() method, returns the type of constructor used for this object
 - Added SimpleEntityType enumeration
Changes to WeaponUtils:
 - Added getAlliesInArc(WeaponAPI weapon)
 - Added getNearestAllyInArc(WeaponAPI weapon)
Deprecated in AIUtils:
 - Deprecated getEnemiesOnMap(CombatEntityAPI entity, boolean sortByDistance)
 - Deprecated getNearbyEnemies(CombatEntityAPI entity, float range,
   boolean sortByDistance)
 - Deprecated getAlliesOnMap(CombatEntityAPI entity, boolean sortByDistance)
 - Deprecated getNearbyAllies(CombatEntityAPI entity, float range,
   boolean sortByDistance)
 - Deprecated getEnemyMissilesOnMap(CombatEntityAPI entity,
   boolean sortByDistance)
 - Deprecated getNearbyEnemyMissiles(CombatEntityAPI entity, float range,
   boolean sortByDistance)
Deprecated in CombatUtils:
 - Deprecated getProjectilesWithinRange(Vector2f location, float range,
   boolean sortByDistance)
 - Deprecated getMissilesWithinRange(Vector2f location, float range,
   boolean sortByDistance)
 - Deprecated getShipsWithinRange(Vector2f location, float range,
   boolean sortByDistance)
 - Deprecated getAsteroidsWithinRange(Vector2f location, float range,
   boolean sortByDistance)
 - Deprecated getObjectivesWithinRange(Vector2f location, float range,
   boolean sortByDistance)
 - Deprecated getEntitiesWithinRange(Vector2f location, float range,
   boolean sortByDistance)
Deprecated in FleetUtils:
 - Deprecated getEnemyFleetsInSystem(CampaignFleetAPI fleet,
   boolean sortByDistance)
 - Deprecated getNearbyEnemyFleets(CampaignFleetAPI fleet, float range,
   boolean sortByDistance)
 - Deprecated getAlliedFleetsInSystem(CampaignFleetAPI fleet,
   boolean sortByDistance)
 - Deprecated getNearbyAlliedFleets(CampaignFleetAPI fleet, float range,
   boolean sortByDistance)
Deprecated in MathUtils:
 - Deprecateded getFacing(Vector2f vector), moved to VectorUtils
 - Deprecated getAngle(Vector2f from, Vector2f to), moved to VectorUtils
 - Deprecated getDirectionalVector(CombatEntityAPI source, Vector2f destination)
 - Deprecated getDirectionalVector(CombatEntityAPI source,
   CombatEntityAPI destination)
Deprecated in WeaponUtils:
 - Deprecated getEnemiesInArc(WeaponAPI weapon, boolean sortByDistance)
 - Deprecated getEnemyMissilesInArc(WeaponAPI weapon, boolean sortByDistance)
[close]
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: LazyLib v1.7 (.6.1a, released 2013-12-18)
« Reply #58 on: December 19, 2013, 05:02:11 PM »

Wow, nice!  I still think my random circular velocity code would be a nice utility addition, though :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: LazyLib v1.7 (.6.1a, released 2013-12-18)
« Reply #59 on: December 19, 2013, 05:08:41 PM »

Wouldn't that be identical to getRandomPointOnCircumference(point, getRandomNumberInRange(minMagnitude, maxMagnitude))? Or am I misunderstanding what you asked for?
Logged
Pages: 1 2 3 [4] 5 6 ... 16