Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 5 6 [7] 8 9 ... 16

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

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: LazyLib v1.7 (.6.2a, released 2013-12-18)
« Reply #90 on: January 29, 2014, 09:42:33 AM »

Hmm.

Maybe it's that call within isPointWithinBounds(), then?

But if that's it... it means one of your mods you're playing must have a ship that doesn't have proper Bounds set up.  But to cause the issue, based on what I'm seeing there, it'd need to have Bounds with only one line segment defined (because if it's only a point, it should be returning null when it checks for whether the ship has bounds at all, which it checks for), which is absurd, but vaguely possible.  I'd be surprised if that didn't cause an engine crash on load, though; I don't think Ships are allowed if they don't have Bounds... or are they?

There's no way I'm going to check every single one of those ships in all those mods out just to verify that its due to somebody being amazingly sloppy, though.  Can you reproduce this error consistently with any particular ships?
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.2a, released 2013-12-18)
« Reply #91 on: January 29, 2014, 02:45:06 PM »

It's caused by the Omni Complex mod. That has an old version (0.1b?!) of LazyLib included, and it's loading that mod's version of MathUtils instead of LazyLib's. Hence the game not finding a method that clearly exists. :)

(this would be why I don't like other mods including LazyLib in their download unless they are a total conversion, btw)

Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: LazyLib v1.7 (.6.2a, released 2013-12-18)
« Reply #92 on: January 29, 2014, 02:58:46 PM »

Ah, makes sense.  In fact, it makes me think I should re-label LazyLib in Vacuum to make sure that can't even happen, but I'd have to do it every time you update.  But it raises a question:  shouldn't your latest version overwrite the old versions?  If not, that sounds like a feature request to me.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

TheNewCongalala

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: LazyLib v1.7 (.6.2a, released 2013-12-18)
« Reply #93 on: January 29, 2014, 05:10:39 PM »

It's caused by the Omni Complex mod. That has an old version (0.1b?!) of LazyLib included, and it's loading that mod's version of MathUtils instead of LazyLib's. Hence the game not finding a method that clearly exists. :)

(this would be why I don't like other mods including LazyLib in their download unless they are a total conversion, btw)



Thank you. i didn't realize that was the problem.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: LazyLib v1.8 (.6.2a, released 2014-02-16)
« Reply #94 on: February 16, 2014, 10:31:52 AM »

1.8 is up, get it here (mirror).

There's not much in the way of new features in this one, but there has been a lot of optimization and bugfixing in the months since 1.7. Modders, the behavior of the getNearestX() methods has been altered. They now include radius in their check, so a small fighter next to a large capital ship won't register as closer anymore. You shouldn't have to change anything in your code, it will just be more accurate now. :)


Important notice for modders using this library:
Soon after the next major Starsector version is released, I will be bumping this library's version to 2.0 and removing all deprecated methods from the code. I've included some functionality to help modders root out any usages of these methods - you can enable these tools in lazylib_settings.json.

As of 1.8 there are just over 40 deprecated methods in this library. For a complete list of these methods and their replacements, open index.html in Javadoc.zip and click on 'Deprecated' at the top of the page.

If you aren't confident in your Java skills or just don't want to bother, you can send me a copy of your mod's code and I'll do the work for you. :)


Full changelog:
Quote
1.8 (February 16, 2014)
=========================
Updated codebase to use Java 7 language features
Log now includes class and line number of caller if 'logDeprecated' is true
Changed all getXInRange()/getNearbyX() to use new MathUtils.isWithinRange()
 - Should provide a noticeable speed boost for those methods dealing with an
   object that has a collision/interaction radius
Added org.lazywizard.lazylib.JSONUtils:
 - toColor(JSONArray array), for reading colors from JSON/CSV files
Added org.lazywizard.lazylib.StringUtils:
 - wrapString(String toWrap, int maxLineLength)
 - indent(String toIndent, String indentWith)
Changes to AIUtils:
 - getNearestEnemy() now includes collision radius in its checks
 - getNearestAlly() now includes collision radius in its checks
 - getNearestShip() now includes collision radius in its checks
Changes to AnchoredEntity:
 - Changed variables from private to protected for easier subclassing
 - Added reanchor(CombatEntityAPI newAnchor, Vector2f newLocation)
Changes to DrawUtils:
 - Added drawFilled boolean parameter to drawArc(), deprecated old version
Changes to MathUtils:
 - Added isWithinRange(SectorEntityToken token1, SectorEntityToken token2,
   float range)
 - Added isWithinRange(SectorEntityToken token, Vector2f loc, float range)
 - Added isWithinRange(CombatEntityAPI entity1, CombatEntityAPI entity2,
   float range)
 - Added isWithinRange(CombatEntityAPI entity, Vector2f loc, float range)
 - Added isWithinRange(Vector2f loc1, Vector2f loc2, float range)
Changes to FleetUtils:
 - Added isShipInFleet(String fleetMemberId, CampaignFleetAPI fleet),
   can be used with FleetMemberAPI.getId() or ShipAPI.getFleetMemberId()
 - getNearestEnemyFleet() now includes interaction radius in its checks
 - getNearestAlliedFleet() now includes interaction radius in its checks
 - getNearestFleet() now includes interaction radius in its checks
Changes to SimpleEntity:
 - Changed variables from private to protected for easier subclassing
Changes to VectorUtils:
 - Added getDirectionalVector(Vector2f source, Vector2f destination)
Changes to WeaponUtils:
 - Fixed bug where isWithinArc() was using double the entity's actual collision
   radius in its calculations
 - getNearestAllyInArc() now includes collision radius in its checks
 - getNearestEnemyInArc() now includes collision radius in its checks
Deprecated in DrawUtils:
 - Deprecated drawArc(float centerX, float centerY, float radius,
   float startAngle, float arcAngle, int numSegments)
Deprecated in MathUtils:
 - Deprecated getDirectionalVector(Vector2f source, Vector2f destination),
   moved to VectorUtils
Logged

Uomoz

  • Admiral
  • *****
  • Posts: 2663
  • 'womo'dz
    • View Profile
Re: LazyLib v1.8 (.6.2a, released 2014-02-16)
« Reply #95 on: February 16, 2014, 10:47:24 AM »

Hi there LW. I still use the CollectionUtils weighted random deprecated method in UsS as it's a bit different from the one in vanilla (as far as I understand). Would it be fair to ask you to keep that?

EDIT: belay that! Fixed my code to use vanilla implementation.
« Last Edit: February 17, 2014, 03:05:11 AM by Uomoz »
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: LazyLib v1.8 (.6.2a, released 2014-02-16)
« Reply #96 on: February 23, 2014, 03:45:55 AM »

Thank you for the new release Lazy Wizard, a fantastic contribution to the community.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: LazyLib v1.8b (.6.2a, released 2014-03-07)
« Reply #97 on: March 07, 2014, 06:06:03 PM »

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

This is just a minor bugfix patch. Thanks to xenoargh and Dark.Revenant for pointing out a few problem areas. :)

Changelog:
Quote
1.8b (March 07, 2014)
=======================
Added "enableCaching" to lazylib_settings.json, on by default
Changes to AIUtils:
 - getEnemiesOnMap() will now store the results for faster consecutive calls
   during the same frame if caching is enabled, also affects all other
   enemy-filtering methods as they use getEnemiesOnMap() internally
Changes to CollisionUtils:
 - Fixed getCollisionPoint() actually returning the furthest collision instead
   of the closest (oops)
 - isPointOnSegment() is now only accurate to within 1/3 su,
   use MathUtils.isPointOnLine() if you need strict accuracy
Changes to LazyLib:
 - Added isCachingEnabled()
Changes to WeaponUtils:
 - Fixed an edge case bug with isWithinArc() and entities just outside the arc


And again, an important notice for modders using this library:
Quote
Soon after the next major Starsector version is released, I will be bumping this library's version to 2.0 and removing all deprecated methods from the code. I've included some functionality to help modders root out any usages of these methods - you can enable these tools in lazylib_settings.json.

As of 1.8 there are just over 40 deprecated methods in this library. For a complete list of these methods and their replacements, open index.html in Javadoc.zip and click on 'Deprecated' at the top of the page.

If you aren't confident in your Java skills or just don't want to bother, you can send me a copy of your mod's code and I'll do the work for you. :)

I've uploaded a version of 1.8b that has all the deprecated methods removed. Modders who want to make absolutely sure their mod is ready can download that version here (you will need to untag the regular version of LazyLib and tag this one in the launcher).
« Last Edit: March 07, 2014, 07:08:10 PM by LazyWizard »
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: LazyLib v1.8c (.6.2a, released 2014-03-07)
« Reply #98 on: March 07, 2014, 09:04:35 PM »

1.8c is up (already), get it here (mirror).

Looks like I missed a bug. Thanks again to Dark.Revenant for pointing this one out. :)

Changelog:
Quote
1.8c (March 07, 2014)
=======================
Changes to VectorUtils:
 - Fixed rotate() and rotateAroundPivot() issues (they were using radians
   instead of degrees like every other Starsector/LazyLib method does)


And again, an important notice for modders using this library:
Quote
Soon after the next major Starsector version is released, I will be bumping this library's version to 2.0 and removing all deprecated methods from the code. I've included some functionality to help modders root out any usages of these methods - you can enable these tools in lazylib_settings.json.

As of 1.8 there are just over 40 deprecated methods in this library. For a complete list of these methods and their replacements, open index.html in Javadoc.zip and click on 'Deprecated' at the top of the page.

If you aren't confident in your Java skills or just don't want to bother, you can send me a copy of your mod's code and I'll do the work for you. :)

I've uploaded a version of 1.8c that has all the deprecated methods removed. Modders who want to make absolutely sure their mod is ready can download that version here (you will need to untag the regular version of LazyLib and tag this one in the launcher).

Please note that only loose scripts will cause a crash on startup if they are using a deprecated method, as the compilation step will fail. Pre-compiled code (jars, in other words) will only crash when their script tries to call the non-existent method.
« Last Edit: March 07, 2014, 09:24:26 PM by LazyWizard »
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: LazyLib v1.8c (.6.2a, released 2014-03-07)
« Reply #99 on: April 23, 2014, 03:26:36 AM »

getFleetMember(ShipAPI ship) is returning a null pointer for some reason. This is version 1.8c whilst in a campaign combat scenario.

Anyone else experiencing this?
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: LazyLib v1.8c (.6.2a, released 2014-03-07)
« Reply #100 on: April 23, 2014, 04:40:13 AM »

As in the method itself causes a null pointer exception, or it's returning a null value?
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: LazyLib v1.8c (.6.2a, released 2014-03-07)
« Reply #101 on: April 23, 2014, 06:33:36 PM »

I'll let this picture show you what I mean. I think it is returning a null value.

In the instance below reviveTarget is a valid ship and FleetAPIData is me calling with the util.


Spoiler
[close]
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: LazyLib v1.8c (.6.2a, released 2014-03-07)
« Reply #102 on: April 26, 2014, 10:40:07 AM »

Is this the same code from this bug report? As far as I know, if you spawned the ship in battle there wouldn't be a fleet member registered for it.
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: LazyLib v1.8c (.6.2a, released 2014-03-07)
« Reply #103 on: April 27, 2014, 07:34:52 AM »

Although the combat engine is just...bizarre when it comes to registering fleet members, at that particular stage in the script a ship that has not yet been spawned (an original fleet ship) is being used.
Logged

KBP

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: LazyLib v1.8c (.6.2a, released 2014-03-07)
« Reply #104 on: May 06, 2014, 02:13:34 PM »

so can someone help me with this

53622 [Thread-6] ERROR com.fs.starfarer.combat.String  - java.lang.UnsupportedClassVersionError: org/lazywizard/lazylib/CollectionUtils : Unsupported major.minor version 51.0
java.lang.UnsupportedClassVersionError: org/lazywizard/lazylib/CollectionUtils : Unsupported major.minor version 51.0
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:247)
   at org.codehaus.janino.ClassLoaderIClassLoader.findIClass(ClassLoaderIClassLoader.java:80)
   at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java:158)
   at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java:124)
   at org.codehaus.janino.UnitCompiler.loadFullyQualifiedClass(UnitCompiler.java:9121)
   at org.codehaus.janino.UnitCompiler.import2(UnitCompiler.java:254)
   at org.codehaus.janino.UnitCompiler.access$0(UnitCompiler.java:240)
   at org.codehaus.janino.UnitCompiler$1.visitSingleTypeImportDeclaration(UnitCompiler.java:230)
   at org.codehaus.janino.Java$CompilationUnit$SingleTypeImportDeclaration.accept(Java.java:170)
   at org.codehaus.janino.UnitCompiler.<init>(UnitCompiler.java:228)
   at org.codehaus.janino.JavaSourceIClassLoader.findIClass(JavaSourceIClassLoader.java:154)
   at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java:158)
   at org.codehaus.janino.UnitCompiler.findClassByName(UnitCompiler.java:6333)
   at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:4834)
   at org.codehaus.janino.UnitCompiler.access$108(UnitCompiler.java:4764)
   at org.codehaus.janino.UnitCompiler$17.visitReferenceType(UnitCompiler.java:4704)
   at org.codehaus.janino.Java$ReferenceType.accept(Java.java:2026)
   at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:4743)
   at org.codehaus.janino.UnitCompiler.getLocalVariable(UnitCompiler.java:1680)
   at org.codehaus.janino.UnitCompiler.buildLocalVariableMap(UnitCompiler.java:2310)
   at org.codehaus.janino.UnitCompiler.access$37(UnitCompiler.java:2302)
   at org.codehaus.janino.UnitCompiler$7.visitLocalVariableDeclarationStatement(UnitCompiler.java:2225)
   at org.codehaus.janino.Java$LocalVariableDeclarationStatement.accept(Java.java:1767)
   at org.codehaus.janino.UnitCompiler.buildLocalVariableMap(UnitCompiler.java:2228)
   at org.codehaus.janino.UnitCompiler.buildLocalVariableMap(UnitCompiler.java:2189)
   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2039)
   at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:851)
   at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:832)
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:528)
   at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:421)
   at org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java:376)
   at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:765)
   at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:383)
   at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:352)
   at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:210)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:164)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:247)
   at com.fs.starfarer.loading.scripts.ScriptStore.o00000(Unknown Source)
   at com.fs.starfarer.launcher.ModManager.ô00000(Unknown Source)
   at com.fs.starfarer.loading.null.super(Unknown Source)
   at com.fs.super.oOOO.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.String.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:619)
Logged
Pages: 1 ... 5 6 [7] 8 9 ... 16