org.lazywizard.lazylib - general methods that help with non-API data typesorg.lazywizard.lazylib.campaign - campaign helper classes
- CollectionUtils - methods for working with Collections (Lists, Maps, etc)
- CollisionUtils - methods for working with bounds and collision detection
- EllipseUtils - methods for working with ellipses (of course)
- FastTrig - Slick2D's implementations of sin and cos, with significant speed increases over java.lang.Math's implementations
- MathUtils - methods for working with angles, distances and circles
- ModUtils - methods for handling non-gameplay related mod tasks
- VectorUtils - methods for working with vectors
org.lazywizard.lazylib.combat - combat helper classes
- CargoUtils - methods for working with cargo and item stacks
- FleetUtils - methods for working with fleets and fleet data
- MessageUtils - a class that allows formatted, multi-line, word-wrapped sector messages
org.lazywizard.lazylib.opengl - OpenGL helper classes
- AIUtils - methods that deal with how a single combat entity views the battle map
- CombatUtils - methods that deal with the battle map in general
- DefenseUtils - methods that deal with a ship's defenses (shields, armor, etc)
- WeaponUtils - methods that deal with weapons and weapon arcs
- ColorUtils - methods for working with OpenGL using AWT colors
- DrawUtils - methods for drawing simple shapes using OpenGL primitives
2.8b (February 02, 2024)
==========================
Updated to be compatible with Starsector 0.97a
Changes to LazyFont:
- Changed default blendSrc back to GL_SRC_ALPHA (was GL_ONE since 2.4c)
Deprecated org.lazywizard.lazylib.campaign.orbits.KeplerOrbit:
- Deprecated at the request of its contributor
2.8 (April 05, 2023)
======================
Updated to be compatible with Starsector 0.96a
Updated bundled libraries:
- kotlin-stdlib: v1.5.31 -> v1.6.21
- kotlinx-coroutines: v1.5.2 -> v1.6.4 (custom build)
- These are the last versions that support Java 7
Added org.lazywizard.lazylib.campaign.orbits.KeplerOrbit:
- Submitted by Liral, this provides more accurate orbits than EllipticalOrbit
Changes to CombatUtils:
- Updated to use CombatEngineAPI's bin-lattice system where applicable, as
requested by several modders since those methods introduction
2.7b (December 10, 2021)
==========================
Updated to be compatible with Starsector 0.95.1a
Updated bundled libraries:
- jetbrains-annotations: v22.0.0 -> 23.0.0
Changes to LazyFont.DrawableString:
- Center/right-aligned text no longer requires maxWidth to be set
- setRenderDebugBounds() now shows anchor and max size
2.7 (October 22, 2021)
========================
Fixed links to online Starsector API in javadoc.zip
Updated bundled libraries:
- kotlin-stdlib: v1.4.31 -> v1.5.31
- kotlinx-coroutines: v1.4.3 -> v1.5.2
- jetbrains-annotations: v20.1.0 -> 22.0.0
Changes to CombatUtils:
- Fixed a bug where ships spawned by spawnShipOrWingDirectly() would
report the wrong fleet side in some circumstances
Changes to LazyFont:
- Fixed log spam with some whitespace being considered unsupported characters
Changes to LazyFont.DrawableString:
- Fixed minor memory leak when dispose() is not called before GC
- Added TextAlignment, setAlignment(), and getAlignment(). TextAlignment
controls whether text is drawn left-aligned (the default), right-aligned,
or centered
- Added TextAnchor, setAnchor(), and getAnchor(). TextAnchor controls the
origin when drawing text; for example, TextAnchor.TOP_LEFT (the default)
will mean draw() will start drawing at the top left, so the text will
appear below and to the right of the position passed into draw()
- Added setBaseColor() and getBaseColor() (replace setColor()/getColor())
- Added isRebuildNeeded() and triggerRebuildIfNeeded() (unnecessary 99% of
the time as rebuilding happens automatically, but useful in fringe cases)
- Cleaned up some out-of-date documentation
Deprecated in LazyFont.DrawableString:
- Deprecated setColor() and getColor(), as users were assuming they set the
color of the next append. Added setBaseColor() and getBaseColor() as
replacements that better convey what these methods do (set/get the color of
all text that _doesn't_ have a color argument passed in)
2.6 (March 26, 2021)
======================
Updated to be compatible with Starsector 0.95a
Updated bundled libraries:
- kotlin-stdlib: v1.4.21 -> v1.4.31
- kotlinx-coroutines: v1.4.2 -> v1.4.3
The Javadoc's index is now one single page
Added org.lazywizard.lazylib.IOUtils:
- Contains methods to help with reading/writing files using the API
- byte[] readAllBytes(String filePath), an API-safe port of
java.nio.Files.readAllBytes()
Changes to LazyFont.DrawableString:
- Added tab support (2x the base vertical height of the text)
- Added append(String text)
- Added append(String text, Color color)
- Added appendIndented(String text, int indent)
- Added appendIndented(String text, Color color, int indent)
- Added getBlendSrc(), setBlendSrc(int blendSrc), getBlendDest(), and
setBlendDest(int blendDest) to control color blending
Deprecated in LazyFont.DrawableString:
- Deprecated all appendText() methods in favor of new append() equivalents.
The append() variants take any object and return the DrawableString so that
calls can be chained together
2.5c (January 23, 2021)
=========================
Changes to LazyFont.DrawableString:
- Fixed rendering issues on some computers (thanks to Dream from the
Discord server for reporting the bug and testing the fix)
- Added colored substring support
- Added appendText(String text, Color color)
- Added appendText(String text, Color color, int indent)
- Appending colored text only colors that substring, and all subsequent
text will return to the base color chosen at DrawableString creation.
To change the base color, call DrawableString.setColor()
2.5b (January 20, 2021)
=========================
Retroactively renamed v2.4g to v2.5
Changes to LazyFont:
- Added getFontName()
Changes to LazyFont.DrawableString:
- Fixed a crash with word-wrapped text that includes a hyphenated line break
- Added setRenderDebugBounds(), which draws a box showing the text's width,
height, and position
2.5 (January 18, 2021)
========================
(originally released as v2.4g)
Updated bundled libraries:
- kotlin-stdlib: v1.3.61 -> v1.4.21
- kotlinx-coroutines: v1.2.0 -> v1.4.2
- jetbrains-annotations: v13.0 -> v20.1.0
- removed kotlinx-atomicfu (this was an erroneous dependency added by
an earlier version of kotlinx-coroutines and wasn't used for anything)
Changes to LazyFont:
- Rewrote DrawableString to use vertex buffers instead of display lists.
This should fix a bug that caused text corruption and visual glitches
when DrawableStrings were rendered in the campaign layer
Deprecated in LazyFont:
- Deprecated drawText(String text, float x, float y, float fontSize,
float maxWidth, float maxHeight), use createText() instead
2.4f (January 31, 2020)
=========================
Updated bundled Kotlin runtime library to v1.3.61
Javadoc is now available online at https://lazywizard.github.io/lazylib
Moved .version file hosting to GitHub
2.4e (April 21, 2019)
=======================
Updated bundled Kotlin runtime library to v1.3.30
Bundled Kotlin coroutines library v1.2.0
Changes to CombatUtils:
- Reverted 2.4c changes due to bugs
2.4d (March 03, 2019)
=======================
Changes to CombatUtils:
- Reverted changes to getEntitiesWithinRange() (it now only returns ships,
projectiles, missiles and asteroids as it did pre-2.4c)
2.4c (March 01, 2019)
=======================
Updated bundled Kotlin runtime library to v1.3.21
Changes to CombatUtils:
- All getXWithinRange() methods have been updated to use 0.9a's new
CollisionGridAPI, which should improve performance
- getEntitiesWithinRange() now includes BattleObjectiveAPIs
Changes to LazyFont:
- Fixed text blending issue
- Blend mode is no longer automatically enabled during rendering - if you want
your text to be drawn blended, you must ensure GL_BLEND is enabled and set
the blend func (usually glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA))
2.4b (November 16, 2018)
==========================
Changes to JSONUtils:
- loadCommonJSON(String filename, String defaultJSONPath) will save the newly
created CommonDataJSONObject to disk immediately if defaultJSONPath exists
2.4 (November 16, 2018)
=========================
Updated to be compatible with Starsector 0.9a
Updated bundled Kotlin runtime library to v1.3.10
Added org.lazywizard.lazylib.JSONUtils.CommonDataJSONObject:
- Provides a wrapper around a standard JSONObject
- save() method saves JSON to common data folder (saves/common), which will
persist between saves (and presumably survive Starsector updates)
- Constructor takes the filename under saves/common to save the data to
Changes to JSONUtils:
- Added clear(JSONObject toClear)
- Added loadCommonJSON(String filename)
(if file does not exist, returns an empty CommonDataJSONObject)
- Added loadCommonJSON(String filename, String defaultJSONPath)
(if file does not exist, copies existing data from defaultJSONPath)
2.3 (November 12, 2018)
=========================
Bundled the Kotlin runtime library (v1.3.0) with LazyLib:
- Kotlin is an alternate JVM language that is 100% interoperable with Java
- "Core" LazyLib is and always shall be written in Java, though some features
such as the font classes are written in Kotlin for convenience's sake
- Kotlin extension methods can be found within the org.lazywizard.lazylib.ext
package in jars/LazyLib-Kotlin.jar (Java users can safely ignore this jar)
Added @Nullable and @NotNull annotations where appropriate
Added org.lazywizard.lazylib.ui.LazyFont:
- Represents a bitmap font (the same type Starsector itself uses)
- Load a font using the static method loadFont(String fontPath)
- Use createText() to create a reusable DrawableString, which can draw a
block of text repeatedly and very efficiently
- Use drawText() to manually draw text into a VBO or display list
- See LazyFont's javadoc for example usage
Changes to CampaignUtils:
- Added getEntitiesWithRep(SectorEntityToken token, String entityTag,
IncludeRep include, RepLevel rep)
- Added toWorldCoordinates(Vector2f screenCoordinates)
- Added toScreenCoordinates(Vector2f worldCoordinates)
Changes to CollectionUtils:
- Added implode(Enum toImplode)
- Added implode(Enum toImplode, String separator)
Changes to CollisionUtils:
- Added getNearestPointOnBounds(Vector2f source, CombatEntityAPI entity)
Changes to ColorUtils:
- Added glColor(Color color, float alpha)
Changes to CombatUtils:
- Added toWorldCoordinates(Vector2f screenCoordinates)
- Added toScreenCoordinates(Vector2f worldCoordinates)
Changes to FastTrig:
- Added atan() and atan2() that are much faster (though less accurate)
than the implementations in Java's core Math class
(roughly 5-20x faster; accurate to within 0.005 radians/~0.29 degrees)
Changes to MathUtils:
- Added FPI and FTAU constants, contain Math.PI and Math.PI * 2 as floats
- Added clamp(float/int toClamp, float/int min, float/int max). This clamps
the passed value within the given range. Variants are provided for both
integers and floats.
- Added getNearestPointOnLine(Vector2f source, Vector2f lineStart,
Vector2f lineEnd)
- Added getPoint(Vector2f center, float radius, float angle). This acts as an
alias for the existing getPointOnCircumference(), which is both the most
commonly used method in LazyLib as well as one of the most awkwardly named
Changes to ModUtils:
- Added isModEnabled(String modId)
- Added loadClassesIfClassIsPresent(String classCanonicalName,
List<String> classesToLoadCanonicalNames, boolean initializeClasses)
- Added getEnabledModIds()
- Added getOverrides(), returns vanilla files explicitly overridden by any
mod (ie: in that mod's mod_info.sjon 'replace' section)
Changes to VectorUtils:
- getFacing() and getAngle() now use FastTrig's new atan2() implementation
- Added getFacingStrict() and getAngleStrict(), which are slower but more
accurate (these use the old pre-2.3 atan2() implementations)
- Added isZeroVector(Vector2f vector)
- Added resize(Vector2f vector, float length)
- Added resize(Vector2f vector, float length, Vector2f dest)
- Added clampLength(Vector2f vector, float maxLength)
- Added clampLength(Vector2f vector, float maxLength, Vector2f dest)
- Added clampLength(Vector2f vector, float minLength, float maxLength)
- Added clampLength(Vector2f toClamp, float minLength, float maxLength,
Vector2f dest)
- Added rotate(Vector2f toRotate, float angle), convenience method that
stores the result in toRotate
- Added rotateAroundPivot(Vector2f toRotate, Vector2f pivotPoint,
float angle), convenience method that stores the result in toRotate
Removed from LazyLib:
- Removed isDevBuild()
Removed from SimpleEntity:
- Removed Object constructor (it used reflection, which is now blocked;
remaining options are Vector2f, WeaponAPI, and ShipEngineAPI)
Miscellaneous Javadoc improvements
2.2 (April 21, 2017)
=======================
Updated to be compatible with Starsector 0.8a
LazyLib Javadoc now links to LWJGL, Starsector, and JSON Javadocs
Changes to CampaignUtils:
- Removed crew XP level argument from addShipToFleet()
2.1b (March 16, 2017)
=======================
Switched version file hosting to Bitbucket
2.1 (November 19, 2015)
=========================
Changes to AnchoredEntity:
- getLocation() no longer returns a direct reference to the anchor's location
when the anchored entity shares the same location
Changes to CampaignUtils:
- Added addShipToFleet(String wingOrVariantId, FleetMemberType type,
CrewXPLevel level, CampaignFleetAPI fleet)
- Removed all getXOfType() methods, replaced with getXWithTag() (was filtering
using class, now uses entity tags)
- All methods that took a "Class entityClass" argument have had said argument
replaced with "String tag"
- getNearbyFleets(), getNearbyHostileFleets(), get NearestHostileFleet(),
and getHostileFleetsInSystem() only include fleets that are visible to the
sensors of the token passed in to the method
- Fixed a few getNearbyX() methods potentially including the token they are
searching around
Changes to CollectionUtils:
- Added combinedList() and combinedSet() to simplify creating a List/Set from
multiple source Collections, take any number of Collections as arguments
Changes to ColorUtils:
- Fixed: glColor() alphaMult value isn't multiplied correctly when argument
"overrideOriginalAlpha" is true
2.0b (October 20, 2014)
=========================
Changes to CampaignUtils:
- Added getNearestEntityFromFaction(SectorEntityToken token, Class entityType,
FactionAPI faction)
- Added getNearbyEntitiesFromFaction(SectorEntityToken token, float range,
Class entityType, FactionAPI faction)
- Added getEntitiesFromFaction(LocationAPI location, Class entityType,
FactionAPI faction)
- Renamed getXByRep() methods to getXWithRep(), also made them no longer
include members of the passed in token's faction in their results
2.0 (October 20, 2014)
========================
Updated to be compatible with Starsector .65a
Renamed FleetUtils to CampaignUtils
Changes to CampaignUtils:
- Changed all method arguments to use a SectorEntityToken instead of a
CampaignFleetAPI wherever applicable
- Removed methods that RepLevel now handles
- Removed methods that search for a specific subclass of SectorEntityToken
in favor of more generic methods
- Removed areAllies(CampaignFleetAPI fleet1, CampaignFleetAPI fleet2)
- Removed areEnemies(CampaignFleetAPI fleet1, CampaignFleetAPI fleet2)
- Removed areNeutral(CampaignFleetAPI fleet1, CampaignFleetAPI fleet2)
- Removed getNearestFleet(CampaignFleetAPI fleet)
- Removed getNearestAlliedFleet(CampaignFleetAPI fleet)
- Removed getNearbyAlliedFleets(CampaignFleetAPI fleet, float range)
- Removed getAlliedFleetsInSystem(CampaignFleetAPI fleet)
- Renamed getNearestEnemyFleet() to getNearestHostileFleet(), only returns
fleets who will actively attack on sight
- Renamed getNearbyEnemyFleets() to getNearbyHostileFleets(), only returns
fleets who will actively attack on sight
- Renamed getEnemyFleetsInSystem() to getHostileFleetsInSystem(), only returns
fleets who will actively attack on sight
- Removed getNearestStation(CampaignFleetAPI fleet)
- Removed getEnemyFleetsInSystem(CampaignFleetAPI)
- Added areSameFaction(SectorEntityToken token1, SectorEntityToken token2)
- Added areAtRep(SectorEntityToken token1, SectorEntityToken token2,
IncludeRep include, RepLevel rep)
- Added getReputation(SectorEntityToken token1, SectorEntityToken token2)
- Added getNearestEntityOfType(SectorEntityToken token, Class entityType)
- Added getNearbyEntitiesOfType(SectorEntityToken token, float range,
Class entityType)
- Added getNearestEntityByRep(SectorEntityToken token, Class entityType,
IncludeRep include, RepLevel rep)
- Added getEntitiesByRep(SectorEntityToken token, Class entityType,
IncludeRep include, RepLevel rep)
- Added getNearbyEntitiesByRep(SectorEntityToken token, float range,
Class entityType, IncludeRep include, RepLevel rep)
Changes to CargoUtils:
- Added isShipInMothballed(String fleetMemberId, CargoAPI cargo)
Changes to CombatUtils:
- Added centerViewport(Vector2f newCenter)
Changes to DefenseUtils:
- Added hasHullDamage(ShipAPI ship)
- Added hasArmorDamage(ShipAPI ship)
- Added getMostDamagedArmorCell(ShipAPI ship)
Changes to EllipseUtils:
- Added Vector2f getRandomPointInEllipse(Vector2f ellipseCenter,
float ellipseWidth, float ellipseHeight, float ellipseAngleOffset)
Changes to MathUtils:
- Added int getRandomNumberInRange(int min, int max)
Changes to VectorUtils:
- Added List<Vector2f> rotate(List<Vector2f> toRotate, float angle)
- Added List<Vector2f> rotateAroundPivot(List<Vector2f> toRotate,
Vector2f pivotPoint, float angle)
Changes to WeaponUtils:
- Fixed getNearestAllyInArc() returning the host ship
- Fixed getAlliesInArc() including the host ship
Removed all pre-existing deprecated methods from the code
Removed all methods with a 'sortByDistance' parameter
- Use Collections.sort(list, new CollectionUtils.SortXByDistance(location))
instead
Removed from AIUtils:
- List<ShipAPI> getEnemiesOnMap(CombatEntityAPI entity, boolean sortByDistance)
- List<ShipAPI> getNearbyEnemies(CombatEntityAPI entity, float range,
boolean sortByDistance)
- List<ShipAPI> getAlliesOnMap(CombatEntityAPI entity, boolean sortByDistance)
- List<ShipAPI> getNearbyAllies(CombatEntityAPI entity, float range,
boolean sortByDistance)
- List<MissileAPI> getEnemyMissilesOnMap(CombatEntityAPI entity,
boolean sortByDistance)
- List<MissileAPI> getNearbyEnemyMissiles(CombatEntityAPI entity, float range,
boolean sortByDistance)
Removed from CampaignUtils:
- List<CampaignFleetAPI> getEnemyFleetsInSystem(CampaignFleetAPI fleet,
boolean sortByDistance)
- List<CampaignFleetAPI> getNearbyEnemyFleets(CampaignFleetAPI fleet,
float range, boolean sortByDistance)
- List<CampaignFleetAPI> getAlliedFleetsInSystem(CampaignFleetAPI fleet,
boolean sortByDistance)
- List<CampaignFleetAPI> getNearbyAlliedFleets(CampaignFleetAPI fleet,
float range, boolean sortByDistance)
Removed from CollectionUtils:
- Removed CollectionUtils$SortObjectivesByDistance
(use SortEntitiesByDistance instead)
- List<T> weightedRandom(Map<T, Float> pickFrom, int numToPick)
- T weightedRandom(Map<T, Float> pickFrom)
Removed from CombatUtils:
- List<DamagingProjectileAPI> getProjectilesWithinRange(Vector2f location,
float range, boolean sortByDistance)
- List<MissileAPI> getMissilesWithinRange(Vector2f location, float range,
boolean sortByDistance)
- List<ShipAPI> getShipsWithinRange(Vector2f location, float range,
boolean sortByDistance)
- List<CombatEntityAPI> getAsteroidsWithinRange(Vector2f location,
float range, boolean sortByDistance)
- List<BattleObjectiveAPI> getObjectivesWithinRange(Vector2f location,
float range, boolean sortByDistance)
- List<CombatEntityAPI> getEntitiesWithinRange(Vector2f location,
float range, boolean sortByDistance)
- CombatEngineAPI getCombatEngine()
- float getElapsedCombatTimeIncludingPaused()
- float getElapsedCombatTime()
- float getTimeSinceLastFrame()
Removed from DefenseUtils:
- Vector2f getArmorCellAtWorldCoord(ShipAPI ship, Vector2f loc)
Removed from DrawUtils:
- drawArc(float centerX, float centerY, float radius, float startAngle,
float arcAngle, int numSegments
Removed from MathUtils:
- float getFacing(Vector2f vector)
(moved to VectorUtils)
- float getAngle(Vector2f from, Vector2f to)
(moved to VectorUtils)
- Vector2f getDirectionalVector(Vector2f source, Vector2f destination)
(moved to VectorUtils)
- Vector2f getDirectionalVector(CombatEntityAPI source, Vector2f destination)
- Vector2f getDirectionalVector(CombatEntityAPI source,
CombatEntityAPI destination)
- boolean isPointWithinBounds(Vector2f point, CombatEntityAPI entity)
(moved to CollisionUtils)
Removed from WeaponUtils:
- float calculateActualDamage(float baseDamage, WeaponAPI weapon)
- float calculateActualDamage(float baseDamage, WeaponAPI weapon,
ShipAPI target, DefenseType defense)
- float calculateDamagePerShot(WeaponAPI weapon)
- float calculateDamagePerShot(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- float calculateDamagePerSecond(WeaponAPI weapon)
- float calculateDamagePerSecond(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- float calculateDamagePerBurst(WeaponAPI weapon)
- float calculateDamagePerBurst(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- List<ShipAPI> getEnemiesInArc(WeaponAPI weapon, boolean sortByDistance)
- List<MissileAPI> getEnemyMissilesInArc(WeaponAPI weapon,
boolean sortByDistance)
_______________________________________________________________________________ _
1.9b (August 27, 2014)
========================
Minor optimizations
Added support for Version Checker update notifications
Added org.lazywizard.lazylib.ModUtils:
- This class helps with non-gameplay related modding tasks
- isClassPresent(String classCanonicalName)
Changes to SimpleEntity:
- Added a constructor for mimicking the location of a ShipEngineAPI
- Added getEngine() method, returns null if another constructor was used
1.9 (July 04, 2014)
=====================
The game no longer crashes if a setting is missing from LazyLib's config file
Added org.lazywizard.lazylib.EllipseUtils:
- By popular request, this includes methods to deal with elliptical shapes
- Put into its own class to avoid further clutter in MathUtils
- getPointOnEllipse(Vector2f ellipseCenter, float ellipseWidth,
float ellipseHeight, float ellipseAngleOffset, float angle)
- getRandomPointOnEllipse(Vector2f ellipseCenter, float ellipseWidth,
float ellipseHeight, float ellipseAngleOffset)
- isPointWithinEllipse(Vector2f point, Vector2f ellipseCenter,
float ellipseWidth, float ellipseHeight, float ellipseAngleOffset)
Added org.lazywizard.lazylib.campaign.orbits.EllipticalOrbit:
- Implementation of OrbitAPI that travels along an elliptical path
Added org.lazywizard.lazylib.opengl.ColorUtils:
- glColor(Color color)
- glColor(Color color, float alphaMult, boolean overrideOriginalAlpha)
Changes to AIUtils:
- Added getBestInterceptPoint(Vector2f point, float speed,
Vector2f targetLoc, Vector2f targetVel) - all credit goes to Dark.Revenant
Changes to CargoUtils:
- Added moveMothballedShips(CargoAPI from, CargoAPI to)
Changes to CollisionUtils:
- Fixed getCollisionPoint() not properly updating the bounds facing/position
Changes to CombatUtils:
- Fixed getFleetMember() returning null when a hulk is passed in
- Added spawnShipOrWingDirectly(String variantId, FleetMemberType type,
FleetSide side, float combatReadiness, Vector2f location, float facing)
NOTE: This does not work in campaign using the vanilla FleetEncounterContext!
Changes to DrawUtils:
- Added drawEllipse(float centerX, float centerY, float width, float height,
float angleOffset, int numSegments, boolean drawFilled)
Changes to MathUtils:
- isPointWithinCircle() now returns true for points along the circumference
- Optimized getPointsAlongCircumference() and large numbers of points
- Added getMidpoint(Vector2f point1, Vector2f point2)
Changes to StringUtils:
- Fixed wrapString() appending a newline when the input string didn't have one
- Also fixed a rare bug with wrapString() where it wouldn't include the last
segment of a wrapped word if it was the final word in the entire String
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)
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
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
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 org.lazywizard.lazylib.opengl.DrawUtils:
- drawCircle(float centerX, float centerY, float radius, int numSegments)
- drawArc(float centerX, float centerY, float radius, float startAngle,
float arcAngle, int numSegments)
Added org.lazywizard.lazylib.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:
- Deprecated 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)
1.6b (September 28, 2013)
===========================
Temporary fix for null pointer exceptions on title screen (fixed in .6.1a)
Changes to CollisionUtils:
- Added isPointOnSegment(Vector2f point, SegmentAPI segment)
Changes to LazyLib:
- Added getLogLevel(), returns logger level used by all LazyLib classes
- setLogLevel() now includes AnchoredEntity and SimpleEntity as well
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).
1.5 (August 01, 2013)
=======================
Re-added DefenseType enumeration (contains HULL, ARMOR, SHIELD, PHASE_OR_MISS)
Added org.lazywizard.lazylib.combat.entities.AnchoredEntity:
- Alternative implementation of CombatEntityAPI that follows and rotates
alongside another CombatEntityAPI (the 'anchor')
- Includes a working getVelocity() implementation, unlike SimpleEntity
Added org.lazywizard.lazylib.combat.DefenseUtils:
- Contains methods to convert between world and armor grid coordinates
- Can check what DefenseType is present at a specific point on a ship
Changes to AIUtils:
- Fixed bug with canUseSystemThisFrame() always returning false for
active toggleable systems that have a cooldown
Changes to CollisionUtils:
- Fixed bug with isPointInBounds() and points exactly on the boundary edges
Changes to CombatUtils:
- Added getFleetMember(ShipAPI ship), returns the FleetMemberAPI whose
id matches this ship (or null if no match was found)
Changes to MathUtils:
- Added equals(float a, float b), tests for 99.99999+% equality of floats
- Added getRandom(), returns an instance of java.util.Random
(this is the RNG used by LazyLib if you wanted to do seed manipulation)
Changes to WeaponUtils:
- New methods to check how much damage you would deal to a specific target:
- Added calculateActualDamage(float baseDamage, WeaponAPI weapon,
ShipAPI target, DefenseType defense)
- Added calculateDamagePerShot(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- Added calculateDamagePerSecond(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- Added calculateDamagePerBurst(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- These methods are not 100% accurate yet, still tracking down some oddities
1.4 (May 06, 2013)
====================
Added @since annotations (useful for finding the lowest library version needed)
Miscellaneous other JavaDoc improvements
Minor math optimizations related to the changes made in the 1.3 update
Added SimpleEntity class (barebones implementation of CombatEntityAPI):
- Useful for spawnEmpArc(), which can target a CombatEntityAPI
- Has a constructor that takes a Vector2f, for a static location
- Can also take an Object that has a getLocation() method, for mobile targets
(useful for targeting a specific WeaponAPI). This uses reflection!
Changes to CombatUtils:
- Added getTimeSinceLastFrame()
Changes to MathUtils:
- Circle-based methods support a null center point (acts as a 0, 0 origin)
- Added getRandomNumberInRange(float min, float max)
- Added getEquidistantPointsInsideCircle(Vector2f center, float radius,
float spaceBetweenPoints)
Changes to CollisionUtils:
- Made isPointWithinBounds() more efficient
- Added isPointWithinCollisionCircle(Vector2f point, CombatEntityAPI entity)
Changes to AIUtils:
- Added getEnemyMissilesOnMap(CombatEntityAPI entity, [boolean sortByDistance])
- Added getNearbyEnemyMissiles(CombatEntityAPI entity, float range,
[boolean sortByDistance])
- Added getNearestMissile(CombatEntityAPI entity)
- Added getNearestEnemyMissile(CombatEntityAPI entity)
Changes to WeaponUtils:
- Added getEnemiesInArc(WeaponAPI weapon, [boolean sortByDistance])
- Added getNearestEnemyInArc(WeaponAPI weapon)
- Added getEnemyMissilesInArc(WeaponAPI weapon, [boolean sortByDistance])
- Added getNearestEnemyMissileInArc(WeaponAPI weapon)
- Added aimTowardsPoint(WeaponAPI weapon, Vector2f point, float time)
(method parameters in [brackets] signify optional parameters)
1.3 (April 10, 2013)
======================
MathUtil's getDistance() methods now include collision radius, if applicable
Note: this change may alter the behavior of existing scripts!
Use the getDistance() methods that take two Vector2f for the old behavior
1.2 (March 20, 2013)
======================
Greatly expanded FleetUtils (equivalent to AIUtils but for CampaignFleetAPIs)
Added clampAngle() to MathUtils (normalizes angle between 0 and 360 degrees)
Added applyForce() to CombatUtils (basic implementation of Newton's Second Law)
Removed DefenseType and Line classes for now (unused internal data types)
1.1 (February 27, 2013)
=========================
Added LazyLib class to org.lazywizard.lazylib (contains version information)
Added a few missing JavaDoc entries and updated others for clarity
All getWithinRange() methods now have an optional sort-by-distance parameter
Added Comparators to CollectionUtils for sorting by distance from a Vector
- SortEntitiesByDistance(Vector2f location): sorts CombatEntityAPIs
- SortTokensByDistance(Vector2f location): sorts SectorEntityTokens
- SortObjectivesByDistance(Vector2f location): sorts BattleObjectiveAPIs
1.0 (February 23, 2013)
=========================
Initial utility mod release, contains 12 classes and 62 methods.
Added JavaDoc (included with mod download)
Changes from bundled jar version:
- Removed Slick2D classes (save FastTrig)
- Added CollisionUtils class (bounds checking and collision detection)
- Rewrote WeaponUtils to use the new CollisionUtils instead of Slick2D
- Moved FastTrig from org.lazywizard.lazylib.geom to org.lazywizard.lazylib
- Fixed several bugs (including a broken getRandomPointInCircle())
- Slight optimization of math-heavy methods
Copyright (c) 2007, Slick 2D
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Slick 2D nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
I think a nice addition to this library would be some form of logging for debugging (global.getSector().addMessage has its limits >_<).
I think a nice addition to this library would be some form of logging for debugging (global.getSector().addMessage has its limits >_<).
Unfortunately we can't write directly to the log. If you run the game from the command line you can use System.out.println() to have text appear in the console window, though.
You also might have luck with MessageUtils.showMessage(). That allows sector messages with line-wrapping and newline support, which alleviates some of the headache of using them. :)
1.0 (February 23, 2013)
=========================
Initial utility mod release, contains 12 classes and 62 methods.
Added JavaDoc (included with mod download)
Changes from bundled jar version:
- Removed Slick2D classes (save FastTrig)
- Added CollisionUtils class (bounds checking and collision detection)
- Rewrote WeaponUtils to use the new CollisionUtils instead of Slick2D
- Moved FastTrig from org.lazywizard.lazylib.geom to org.lazywizard.lazylib
- Fixed several bugs (including a broken getRandomPointInCircle())
- Slight optimization of math-heavy methods
1.1 (February 27, 2013)
=========================
Added LazyLib class to org.lazywizard.lazylib (contains version information)
Added a few missing JavaDoc entries and updated others for clarity
All getWithinRange() methods now have an optional sort-by-distance parameter
Added Comparators to CollectionUtils for sorting by distance from a Vector
- SortEntitiesByDistance(Vector2f location): sorts CombatEntityAPIs
- SortTokensByDistance(Vector2f location): sorts SectorEntityTokens
- SortObjectivesByDistance(Vector2f location): sorts BattleObjectiveAPIs
I am still confused as to where this file goes, or maybe I am looking at it the wrong way
I am still confused as to where this file goes, or maybe I am looking at it the wrong way
extract it first then its like any normal mod, you put this in the mod folder as lazy already wrote & activate the mod
1.2 (March 20, 2013)
======================
Greatly expanded FleetUtils (equivalent to AIUtils but for CampaignFleetAPIs)
Added clampAngle() to MathUtils (normalizes angle between 0 and 360 degrees)
Added applyForce() to CombatUtils (basic implementation of Newton's Second Law)
Removed DefenseType and Line classes for now (unused internal data types)
Uomoz's collection so i don't know wich ver of your mode is thisSpoiler598187 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.ArithmeticException: / by zero
java.lang.ArithmeticException: / by zero
at data.scripts.world.OmniFac$WeaponData.<init>(OmniFac.java:812)
at data.scripts.world.OmniFac.checkCargo(OmniFac.java:521)
at data.scripts.world.OmniFac.advance(OmniFac.java:601)
at com.fs.starfarer.campaign.BaseLocation.advance(Unknown Source)
at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
at com.fs.starfarer.campaign.A.super(Unknown Source)
at com.fs.starfarer.A.รร?000(Unknown Source)
at com.fs.A.A.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)[close]
1.3 (April 10, 2013)
======================
MathUtil's getDistance() methods now include collision radius, if applicable
Note: this change may alter the behavior of existing scripts!
1.4 (April xx, 2013)
======================
Added @since annotations (useful for finding the lowest library version needed)
Minor math optimizations to deal with the changes made in the 1.3 update
Changes to MathUtils:
- Circle-based methods can now have null centers passed in for a 0, 0 origin
- Added getRandomNumberInRange(float min, float max)
Changes to AIUtils:
- Added getEnemyMissilesOnMap(CombatEntityAPI entity, [boolean sortByDistance])
- Added getNearbyEnemyMissiles(CombatEntityAPI entity, float range,
[boolean sortByDistance])
- Added getNearestMissile(CombatEntityAPI entity)
- Added getNearestEnemyMissile(CombatEntityAPI entity)
Changes to WeaponUtils:
- Added getEnemiesInArc(WeaponAPI weapon, [boolean sortByDistance])
- Added getNearestEnemyInArc(WeaponAPI weapon)
- Added getEnemyMissilesInArc(WeaponAPI weapon, [boolean sortByDistance])
- Added getNearestEnemyMissileInArc(WeaponAPI weapon)
- Added aimTowardsPoint(WeaponAPI weapon, Vector2f point, float time)
XAdded KeyHandler class (abstract, must be subclassed):
X - Can see what keys were pressed or released this frame
X - Can get a list of all keys that are currently pressed
X - Can check how long a key has been pressed for
Added AnimatedWeapon class (abstract, must be subclassed):
- Used for weapons that need complex animations
- Can set a custom framerate and tell it to pause on certain frames
X - Can set frame ranges to be played when firing, disabled, charging, etc
Added SimpleEntity class (barebones implementation of CombatEntityAPI):
- Useful for spawnEmpArc(), which can target a CombatEntityAPI
- Has a constructor that takes a Vector2f, for a static location
- Can also take an Object that has a getLocation() method, for mobile targets
(useful for targeting a specific WeaponAPI). This uses reflection!
1.4 (May 06, 2013)
====================
Added @since annotations (useful for finding the lowest library version needed)
Miscellaneous other JavaDoc improvements
Minor math optimizations related to the changes made in the 1.3 update
Changes to CombatUtils:
- Added getTimeSinceLastFrame()
Changes to MathUtils:
- Circle-based methods support a null center point (acts as a 0, 0 origin)
- Added getRandomNumberInRange(float min, float max)
- Added getEquidistantPointsInsideCircle(Vector2f center, float radius,
float spaceBetweenPoints)
Changes to CollisionUtils:
- Made isPointWithinBounds() more efficient
- Added isPointWithinCollisionCircle(Vector2f point, CombatEntityAPI entity)
Changes to AIUtils:
- Added getEnemyMissilesOnMap(CombatEntityAPI entity, [boolean sortByDistance])
- Added getNearbyEnemyMissiles(CombatEntityAPI entity, float range,
[boolean sortByDistance])
- Added getNearestMissile(CombatEntityAPI entity)
- Added getNearestEnemyMissile(CombatEntityAPI entity)
Changes to WeaponUtils:
- Added getEnemiesInArc(WeaponAPI weapon, [boolean sortByDistance])
- Added getNearestEnemyInArc(WeaponAPI weapon)
- Added getEnemyMissilesInArc(WeaponAPI weapon, [boolean sortByDistance])
- Added getNearestEnemyMissileInArc(WeaponAPI weapon)
- Added aimTowardsPoint(WeaponAPI weapon, Vector2f point, float time)
Added SimpleEntity class (barebones implementation of CombatEntityAPI):
- Useful for spawnEmpArc(), which can target a CombatEntityAPI
- Has a constructor that takes a Vector2f, for a static location
- Can also take an Object that has a getLocation() method, for mobile targets
(useful for targeting a specific WeaponAPI). This uses reflection!
(method parameters in [brackets] signify optional parameters)
Heyas. Just wanted to say that this is amazing. The amount of work you must have put into the documentation alone deserves a cookie.
Stuff like isPointWithinBounds() totally changes my outlook on what's possible to get done- between that and the stellar work Alex put in to allow us to create / manipulate various objects, I have all sorts of crazy ideas now ;D
Now if only there was a UI lib that we could use to make alternative dialogs and suchlike with...
BTW, did the console ever get working with full-screen?
1.5 (August 01, 2013)
=======================
Re-added DefenseType enumeration (contains HULL, ARMOR, SHIELD, PHASE_OR_MISS)
Added AnchoredEntity:
- Alternative implementation of CombatEntityAPI that follows and rotates
alongside another CombatEntityAPI (the 'anchor')
- Includes a working getVelocity() implementation, unlike SimpleEntity
Added DefenseUtils:
- Contains methods to convert between world and armor grid coordinates
- Can check what DefenseType is present at a specific point on a ship
Changes to AIUtils:
- Fixed bug with canUseSystemThisFrame() always returning false for
active toggleable systems that have a cooldown
Changes to CollisionUtils:
- Fixed bug with isPointInBounds() and points exactly on the boundary edges
Changes to CombatUtils:
- Added getFleetMember(ShipAPI ship), returns the FleetMemberAPI whose
id matches this ship (or null if no match was found)
Changes to MathUtils:
- Added equals(float a, float b), tests for 99.99999+% equality of floats
- Added getRandom(), returns an instance of java.util.Random
(this is the RNG used by LazyLib if you wanted to do seed manipulation)
Changes to WeaponUtils:
- New methods to check how much damage you would deal to a specific target:
- Added calculateActualDamage(float baseDamage, WeaponAPI weapon,
ShipAPI target, DefenseType defense)
- Added calculateDamagePerShot(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- Added calculateDamagePerSecond(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- Added calculateDamagePerBurst(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- These methods are not 100% accurate yet, still tracking down some oddities
getFleetMember(ShipAPI ship)I don't suppose that means we can get the Variant id from the FleetMember then??? You know why, and I'm like, on the last 1% of the Rest of It :D
Re-added DefenseType enumeration (contains HULL, ARMOR, SHIELD, PHASE_OR_MISS)Help me out- what is this good for? I take it you use it with a Vector2f and this:
Can check what DefenseType is present at a specific point on a ship
Regarding world coordinate -> armor grid conversions: if a modded ship has a center point that's not the center of the sprite there might be problems. There's no method in the current API that would allow me to compensate for this, unfortunately.Is it just going to be off the pixels of offset, or have more serious problems? I often have centers offset on Y... if yes, guess I can just live with some inconsistencies.
Fixed bug with isPointInBounds() and points exactly on the boundary edgesI forgot to mention I've been using CollisionUtils.getCollisionPoint() a lot, but I'm seeing a lot of null results even though the target is a valid CombatEntity. This happens most often with little things like drones. Any idea?
I don't suppose that means we can get the Variant id from the FleetMember then??? You know why, and I'm like, on the last 1% of the Rest of ItNevermind about all that- I got the problem solved :D
/**
* Returns a {@link Vector2f} velocity vector pointing from {@code position}
*
* @param position -- The origin of the vector.
* @param velocity -- the velocity we wish to have going randomly away from the origin.
* @return newVel -- A {@link Vector2f} pointing at {@code destination} that is the velocity.
*/
public static Vector2f randomCircularVelocity(Vector2f position,float velocity)
{
Vector2f velPos = MathUtils.getRandomPointOnCircumference(position, velocity);
Vector2f newVel = Vector2f.sub(velPos,position,null);
return newVel;
}
21408 [Thread-5] ERROR com.fs.starfarer.combat.D - java.lang.RuntimeException: Error loading [sounds/fx/beams/fire_beam_burst03.ogg] resource, not found in [C:\Users\Rob\Programs\Starfarer\starsector-core\..\mods\Exerelin,C:\Users\Rob\Programs\Starfarer\starsector-core\..\mods\LazyLib,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [sounds/fx/beams/fire_beam_burst03.ogg] resource, not found in [C:\Users\Rob\Programs\Starfarer\starsector-core\..\mods\Exerelin,C:\Users\Rob\Programs\Starfarer\starsector-core\..\mods\LazyLib,../starfarer.res/res,CLASSPATH]
at com.fs.util.C.ร00000(Unknown Source)
at com.fs.util.C.ร00000(Unknown Source)
at com.fs.starfarer.loading.OooO.super(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(Unknown Source)
When are u updating?
1.6 (soon)
============
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
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)
Changes to CollectionUtils:
- SortXByDistance constructors now have an optional includeRadius parameter
that sets if collision/interaction radius is considered (defaults to true)
- implode() 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:
- No longer implements EveryFrameCombatPlugin
- 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 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:
- 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).
MathUtil's getDistance() methods involving SectorEntityTokens take interaction radius into account - meaning two fleets whose circles are overlapping are now considered at 0 distance from each other.
MathUtil's getDistance() methods involving SectorEntityTokens take interaction radius into account - meaning two fleets whose circles are overlapping are now considered at 0 distance from each other.
How much (or is it) more 'expensive' performance-wise is this over getDistanceSquared()?
It would be a great solution to the 'hover' on SectorEntityToken issue with my mining code :)
public static float getDistance(SectorEntityToken token1, SectorEntityToken token2)
{
return Math.max(0f, getDistance(token1.getLocation(), token2.getLocation())
- (token1.getRadius() + token2.getRadius()));
}
public static float getDistance(Vector2f vector1, Vector2f vector2)
{
float a = vector1.x - vector2.x;
float b = vector1.y - vector2.y;
return (float) Math.hypot(a, b);
}
public static float getDistanceSquared(Vector2f vector1, Vector2f vector2)
{
float a = vector1.x - vector2.x, b = vector1.y - vector2.y;
return (a * a) + (b * b);
}
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).
getRandomPointOnLineYay!
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)
List nearbyEnemies = CombatUtils.getShipsWithinRange(beam.getTo(), 750f);
147289 [Thread-5] WARN org.lazywizard.lazylib.combat.CombatUtils - Using deprecated method getCombatEngie()
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)
public static Vector2f randomCircularVelocity(Vector2f position,float velocity)
{
Vector2f velPos = MathUtils.getRandomPointOnCircumference(position, velocity);
Vector2f newVel = Vector2f.sub(velPos,position,null);
return newVel;
}
package data.scripts.weapons;
import java.awt.Color;
import org.lwjgl.util.vector.Vector2f;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.DamagingProjectileAPI;
import com.fs.starfarer.api.combat.OnHitEffectPlugin;
import org.lazywizard.lazylib.MathUtils;
public class ExplosiveOnHitEffect implements OnHitEffectPlugin {
public static Vector2f randomCircularVelocity(Vector2f position,float velocity)
{
Vector2f velPos = MathUtils.getRandomPointOnCircumference(position, velocity);
Vector2f newVel = Vector2f.sub(velPos,position,null);
return newVel;
}
@Override
public void onHit(DamagingProjectileAPI projectile, CombatEntityAPI target,
Vector2f point, boolean shieldHit, CombatEngineAPI engine) {
float emp = projectile.getEmpAmount();
float dam = projectile.getDamageAmount();
int repeat = Math.max(6,(int) ((dam / 100f) + 10f));
int repeatTwo = repeat / 3;
for(int i = 0; i < repeat; i++)
{
Vector2f randPoint = MathUtils.getRandomPointInCircle(point,dam/35f);
float randSize = MathUtils.getRandomNumberInRange(dam/25f,Math.max(dam / 20f,15f));
Vector2f randVec = randomCircularVelocity(randPoint,MathUtils.getRandomNumberInRange(30f,Math.max(dam / 50f,31f)));
float randDur = 0.1f + MathUtils.getRandomNumberInRange(0.0f,0.3f);
int yelVal = (int) (Math.random() * 200f + 32f);
int randTrans = (int) MathUtils.getRandomNumberInRange(64f,128f);
engine.addSmoothParticle(randPoint, randVec, randSize, 1f, randDur, new Color(255,yelVal,0,randTrans));
}
for(int i = 0; i < repeat; i++)
{
int yelVal = (int) (Math.random() * 128f + 64f);
Vector2f randPoint = MathUtils.getRandomPointInCircle(point,dam/100f);
//Random Vectors, in order of speed; generally, we need smoke and central poof to be slower than others
Vector2f randVecFast = randomCircularVelocity(randPoint,MathUtils.getRandomNumberInRange(30f,Math.max(dam / 2f,31f)));
Vector2f randVecFastTwo = randomCircularVelocity(randPoint,MathUtils.getRandomNumberInRange(30f,Math.max(dam / 2f,31f)));
Vector2f randVec = randomCircularVelocity(randPoint,MathUtils.getRandomNumberInRange(30f,Math.max(dam / 25f,31f)));
Vector2f randVecTwo = randomCircularVelocity(randPoint,MathUtils.getRandomNumberInRange(30f,Math.max(dam / 35f,31f)));
Vector2f randVecThree = randomCircularVelocity(randPoint,MathUtils.getRandomNumberInRange(15f,Math.max(dam / 40f,16f)));
float randSize = MathUtils.getRandomNumberInRange(10f,Math.max(dam / 50f,15f));
float randSizeTwo = MathUtils.getRandomNumberInRange(5f,10f);
float randDur = 1f + MathUtils.getRandomNumberInRange(-0.5f,3f);
float randDurTwo = MathUtils.getRandomNumberInRange(0.5f,1f);
int randTrans = (int) MathUtils.getRandomNumberInRange(32f,200f);
int randGray = (int) MathUtils.getRandomNumberInRange(32f,64f);
engine.addHitParticle(point, randVecFast, randSizeTwo, 1f, randDurTwo * 0.5f, new Color(255,yelVal + 64,0,randTrans + 55));
engine.addHitParticle(point, randVecFastTwo, randSizeTwo, 1f, randDurTwo * 0.65f, new Color(255,yelVal + 64,0,randTrans + 55));
engine.addHitParticle(point, randVec, randSize, 1f, randDurTwo, new Color(255,yelVal-64,0,randTrans));
engine.addHitParticle(point, randVecTwo, randSize, 1f, randDurTwo * 0.75f, new Color(255,yelVal-32,0,randTrans));
engine.addHitParticle(point, randVecThree, randSize, 1f, randDurTwo * 0.5f, new Color(255,yelVal,0,randTrans));
engine.addSmokeParticle(point, randVecThree, MathUtils.getRandomNumberInRange(dam / 100f,dam / 50f), MathUtils.getRandomNumberInRange(0.5f,1f), randDur, new Color(randGray,randGray,randGray,randTrans));
}
}
}
Aha. Useful to know that, I usually don't presume null is acceptable input to a function in this language :)
Oh, and!
Where does that JSON go?
//Rotates a line segment of length offset around the Vector2f origin using the angle (in degrees).
//Very useful for anything where we need A-to-B line segments, but we only have one point to work with and a length.
//Many thanks to Louis Wasserman for his example of simple line segment rotation on Stack Overflow, from which this example was derived.
public Vector2f RotateLineSegment(Vector2f origin, float offset, float angle){
double[] pt = {(double) offset, (double) 0f};
// rotates the line segment from 0,0 to offset, 0 to angle
AffineTransform.getRotateInstance(Math.toRadians(angle), 0, 0).transform(pt, 0, pt, 0, 1);
//Cast result back to float to get back to Vector2f here, now that we don't need the precision
float newX = (float) pt[0];
float newY = (float) pt[1];
return new Vector2f(origin.getX() + newX, origin.getY() + newY);
}
Sounds like Uomoz needs to update his mod. LazyLibCombatPlugin is deprecated.
It's not present in the current release, as far as i know.
Caused by: org.codehaus.commons.compiler.CompileException: File data/scripts/plugins/LazyLibCombatHook.java, Line 5, Column 13: No applicable constructor/method found for zero actual parameters; candidates are: "org.lazywizard.lazylib.combat.CombatUtils()"
at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:9403)
at org.codehaus.janino.UnitCompiler.findMostSpecificIInvocable(UnitCompiler.java:6994)
at org.codehaus.janino.UnitCompiler.invokeConstructor(UnitCompiler.java:5975)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2524)
at org.codehaus.janino.UnitCompiler.access$24(UnitCompiler.java:2503)
at org.codehaus.janino.UnitCompiler$5.visitSuperConstructorInvocation(UnitCompiler.java:942)
at org.codehaus.janino.Java$SuperConstructorInvocation.accept(Java.java:2798)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:946)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:2071)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:539)
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)
... 5 more
I'm sure this kind of thing probably drives purists insane. :D
if (target != null && beam.getBrightness() >= 1f)
{
WeaponAPI weapon = beam.getWeapon();
if(weapon == null) return;
DerivedWeaponStatsAPI stats = weapon.getDerivedStats();
float dam = stats.getBurstDamage();
DamageType damType = weapon.getDamageType();
int heatMe = (int) Math.max(6f,dam / 2500f);
//Damage is now reduced, now that we have the "coverage"
dam *= 0.25f;
Vector2f targLoc = target.getLocation();
for(int i = 0; i < heatMe; i++)
{
//Gets a point far, far away and uses it as our ray-test point. Long distances work better than shorter ones.
Vector2f cloneLoc = MathUtils.getRandomPointInCircle(targLoc, target.getCollisionRadius() * 1.25f);
Vector2f colPoint;
//Are we in the bounds?
if(!CollisionUtils.isPointWithinBounds(cloneLoc, target))
{
//Try to get a valid collision point between our explosion's point source and the Entity.
colPoint = CollisionUtils.getCollisionPoint(cloneLoc, targLoc, target);
} else {
colPoint = cloneLoc;
}
//If we can't get a good collision point, use the center of the target Entity. This is potentially a balance issue (hits all going to one armor cell are pretty OP lol), but this case mainly covers little teeny drones and suchlike that should be registering hits from giant explosions nearby, but often don't, for whatever reason. Bigger things rarely fail, so it usually works out.
if(colPoint == null) colPoint = targLoc;
if(colPoint != null)//Must check this, getCollisionPoint returns null fairly frequently and that's a wrap
{
engine.applyDamage(
target, //enemy Entity
colPoint, //Our 2D vector to the exact world-position of the collision
dam, //DPS modified by the damage multiplier
damType, //Using the damage type here, so that Kinetic / Explosive / Fragmentation AOE works.
0f, //EMP (if any)
false, //Does not bypass shields.
false, //Does not do Soft Flux damage (unless you want it to for some strange reason)
beam.getSource() //Who owns this projectile?
);
}
}
}
"Heat" special projectile type.
When it (beam / projectile) hits, it generates multiple sub-hits around the target, potentially bypassing the shields. Thus it can knock out engines even as the target attempts to retreat and other Fun Things.
It's insidiously powerful; feel free to combine it with AOE for the ultimate in "crisping" fun. Space napalm, baby.
Requires LazyLib.
java.lang.NoSuchMethodError: org.lazywizard.lazylib.MathUtils.isPointOnLine(Lorg/lwjgl/util/vector/Vector2f;Lorg/lwjgl/util/vector/Vector2f;Lorg/lwjgl/util/vector/Vector2f;)Z
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)
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
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
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. :)
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)
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. :)
1.9 (July 04, 2014)
=====================
The game no longer crashes if a setting is missing from LazyLib's config file
Added org.lazywizard.lazylib.EllipseUtils:
- By popular request, this includes methods to deal with elliptical shapes
- Put into its own class to avoid further clutter in MathUtils
- getPointOnEllipse(Vector2f ellipseCenter, float ellipseWidth,
float ellipseHeight, float ellipseAngleOffset, float angle)
- getRandomPointOnEllipse(Vector2f ellipseCenter, float ellipseWidth,
float ellipseHeight, float ellipseAngleOffset)
- isPointWithinEllipse(Vector2f point, Vector2f ellipseCenter,
float ellipseWidth, float ellipseHeight, float ellipseAngleOffset)
Added org.lazywizard.lazylib.campaign.orbits.EllipticalOrbit:
- Implementation of OrbitAPI that travels along an elliptical path
Added org.lazywizard.lazylib.opengl.ColorUtils:
- glColor(Color color)
- glColor(Color color, float alphaMult, boolean overrideOriginalAlpha)
Changes to AIUtils:
- Added getBestInterceptPoint(Vector2f point, float speed,
Vector2f targetLoc, Vector2f targetVel) - all credit goes to Dark.Revenant
Changes to CargoUtils:
- Added moveMothballedShips(CargoAPI from, CargoAPI to)
Changes to CollisionUtils:
- Fixed getCollisionPoint() not properly updating the bounds facing/position
Changes to CombatUtils:
- Fixed getFleetMember() returning null when a hulk is passed in
- Added spawnShipOrWingDirectly(String variantId, FleetMemberType type,
FleetSide side, float combatReadiness, Vector2f location, float facing)
NOTE: This does not work in campaign using the vanilla FleetEncounterContext!
Changes to DrawUtils:
- Added drawEllipse(float centerX, float centerY, float width, float height,
float angleOffset, int numSegments, boolean drawFilled)
Changes to MathUtils:
- isPointWithinCircle() now returns true for points along the circumference
- Optimized getPointsAlongCircumference() and large numbers of points
- Added getMidpoint(Vector2f point1, Vector2f point2)
Changes to StringUtils:
- Fixed wrapString() appending a newline when the input string didn't have one
- Also fixed a rare bug with wrapString() where it wouldn't include the last
segment of a wrapped word if it was the final word in the entire String
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.9 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. :)
1.9b (August 27, 2014)
========================
Minor optimizations
Added support for Version Checker update notifications
Added org.lazywizard.lazylib.ModUtils:
- This class helps with non-gameplay related modding tasks
- isClassPresent(String classCanonicalName)
Changes to SimpleEntity:
- Added a constructor for mimicking the location of a ShipEngineAPI
- Added getEngine() method, returns null if another constructor was used
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.9b 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. :)
And once again, an important notice for modders using this library:QuoteSoon 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.9b 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.9b that has all the deprecated methods removed. Modders who want to make absolutely sure their mod is ready can download that version here (http://www.mediafire.com/download/oawj8qez1scxghd/LazyLib_1.9b_nodeprecated.zip) (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 (when compilation fails). If you're using jars, you'll need to swap out the LazyLib.jar you're using as a library in your IDE with the nodep version and do a clean build.
absolutely nobody is using FleetUtilsI used getEnemyFleetsInSystem() when I developed the new fleet AI stuff. I don't think I used any of it otherwise :) Anyhow, ported it out, so no need to worry about whether any of those methods still exist :)
2.0 (October 20, 2014)
========================
Updated to be compatible with Starsector .65a
Renamed FleetUtils to CampaignUtils
Changes to CampaignUtils:
- Changed all method arguments to use a SectorEntityToken instead of a
CampaignFleetAPI wherever applicable
- Removed methods that RepLevel now handles
- Removed methods that search for a specific subclass of SectorEntityToken
in favor of more generic methods
- Removed areAllies(CampaignFleetAPI fleet1, CampaignFleetAPI fleet2)
- Removed areEnemies(CampaignFleetAPI fleet1, CampaignFleetAPI fleet2)
- Removed areNeutral(CampaignFleetAPI fleet1, CampaignFleetAPI fleet2)
- Removed getNearestFleet(CampaignFleetAPI fleet)
- Removed getNearestAlliedFleet(CampaignFleetAPI fleet)
- Removed getNearbyAlliedFleets(CampaignFleetAPI fleet, float range)
- Removed getAlliedFleetsInSystem(CampaignFleetAPI fleet)
- Renamed getNearestEnemyFleet() to getNearestHostileFleet(), only returns
fleets who will actively attack on sight
- Renamed getNearbyEnemyFleets() to getNearbyHostileFleets(), only returns
fleets who will actively attack on sight
- Renamed getEnemyFleetsInSystem() to getHostileFleetsInSystem(), only returns
fleets who will actively attack on sight
- Removed getNearestStation(CampaignFleetAPI fleet)
- Removed getEnemyFleetsInSystem(CampaignFleetAPI)
- Added areSameFaction(SectorEntityToken token1, SectorEntityToken token2)
- Added areAtRep(SectorEntityToken token1, SectorEntityToken token2,
IncludeRep include, RepLevel rep)
- Added getReputation(SectorEntityToken token1, SectorEntityToken token2)
- Added getNearestEntityOfType(SectorEntityToken token, Class entityType)
- Added getNearbyEntitiesOfType(SectorEntityToken token, float range,
Class entityType)
- Added getNearestEntityByRep(SectorEntityToken token, Class entityType,
IncludeRep include, RepLevel rep)
- Added getEntitiesByRep(SectorEntityToken token, Class entityType,
IncludeRep include, RepLevel rep)
- Added getNearbyEntitiesByRep(SectorEntityToken token, float range,
Class entityType, IncludeRep include, RepLevel rep)
Changes to CargoUtils:
- Added isShipInMothballed(String fleetMemberId, CargoAPI cargo)
Changes to CombatUtils:
- Added centerViewport(Vector2f newCenter)
Changes to DefenseUtils:
- Added hasHullDamage(ShipAPI ship)
- Added hasArmorDamage(ShipAPI ship)
- Added getMostDamagedArmorCell(ShipAPI ship)
Changes to EllipseUtils:
- Added Vector2f getRandomPointInEllipse(Vector2f ellipseCenter,
float ellipseWidth, float ellipseHeight, float ellipseAngleOffset)
Changes to MathUtils:
- Added int getRandomNumberInRange(int min, int max)
Changes to VectorUtils:
- Added List<Vector2f> rotate(List<Vector2f> toRotate, float angle)
- Added List<Vector2f> rotateAroundPivot(List<Vector2f> toRotate,
Vector2f pivotPoint, float angle)
Changes to WeaponUtils:
- Fixed getNearestAllyInArc() returning the host ship
- Fixed getAlliesInArc() including the host ship
Removed all pre-existing deprecated methods from the code
Removed all methods with a 'sortByDistance' parameter
- Use Collections.sort(list, new CollectionUtils.SortXByDistance(location))
instead
Removed from AIUtils:
- List<ShipAPI> getEnemiesOnMap(CombatEntityAPI entity, boolean sortByDistance)
- List<ShipAPI> getNearbyEnemies(CombatEntityAPI entity, float range,
boolean sortByDistance)
- List<ShipAPI> getAlliesOnMap(CombatEntityAPI entity, boolean sortByDistance)
- List<ShipAPI> getNearbyAllies(CombatEntityAPI entity, float range,
boolean sortByDistance)
- List<MissileAPI> getEnemyMissilesOnMap(CombatEntityAPI entity,
boolean sortByDistance)
- List<MissileAPI> getNearbyEnemyMissiles(CombatEntityAPI entity, float range,
boolean sortByDistance)
Removed from CampaignUtils:
- List<CampaignFleetAPI> getEnemyFleetsInSystem(CampaignFleetAPI fleet,
boolean sortByDistance)
- List<CampaignFleetAPI> getNearbyEnemyFleets(CampaignFleetAPI fleet,
float range, boolean sortByDistance)
- List<CampaignFleetAPI> getAlliedFleetsInSystem(CampaignFleetAPI fleet,
boolean sortByDistance)
- List<CampaignFleetAPI> getNearbyAlliedFleets(CampaignFleetAPI fleet,
float range, boolean sortByDistance)
Removed from CollectionUtils:
- Removed CollectionUtils$SortObjectivesByDistance
(use SortEntitiesByDistance instead)
- List<T> weightedRandom(Map<T, Float> pickFrom, int numToPick)
- T weightedRandom(Map<T, Float> pickFrom)
Removed from CombatUtils:
- List<DamagingProjectileAPI> getProjectilesWithinRange(Vector2f location,
float range, boolean sortByDistance)
- List<MissileAPI> getMissilesWithinRange(Vector2f location, float range,
boolean sortByDistance)
- List<ShipAPI> getShipsWithinRange(Vector2f location, float range,
boolean sortByDistance)
- List<CombatEntityAPI> getAsteroidsWithinRange(Vector2f location,
float range, boolean sortByDistance)
- List<BattleObjectiveAPI> getObjectivesWithinRange(Vector2f location,
float range, boolean sortByDistance)
- List<CombatEntityAPI> getEntitiesWithinRange(Vector2f location,
float range, boolean sortByDistance)
- CombatEngineAPI getCombatEngine()
- float getElapsedCombatTimeIncludingPaused()
- float getElapsedCombatTime()
- float getTimeSinceLastFrame()
Removed from DefenseUtils:
- Vector2f getArmorCellAtWorldCoord(ShipAPI ship, Vector2f loc)
Removed from DrawUtils:
- drawArc(float centerX, float centerY, float radius, float startAngle,
float arcAngle, int numSegments
Removed from MathUtils:
- float getFacing(Vector2f vector)
(moved to VectorUtils)
- float getAngle(Vector2f from, Vector2f to)
(moved to VectorUtils)
- Vector2f getDirectionalVector(Vector2f source, Vector2f destination)
(moved to VectorUtils)
- Vector2f getDirectionalVector(CombatEntityAPI source, Vector2f destination)
- Vector2f getDirectionalVector(CombatEntityAPI source,
CombatEntityAPI destination)
- boolean isPointWithinBounds(Vector2f point, CombatEntityAPI entity)
(moved to CollisionUtils)
Removed from WeaponUtils:
- float calculateActualDamage(float baseDamage, WeaponAPI weapon)
- float calculateActualDamage(float baseDamage, WeaponAPI weapon,
ShipAPI target, DefenseType defense)
- float calculateDamagePerShot(WeaponAPI weapon)
- float calculateDamagePerShot(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- float calculateDamagePerSecond(WeaponAPI weapon)
- float calculateDamagePerSecond(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- float calculateDamagePerBurst(WeaponAPI weapon)
- float calculateDamagePerBurst(WeaponAPI weapon, ShipAPI target,
DefenseType defense)
- List<ShipAPI> getEnemiesInArc(WeaponAPI weapon, boolean sortByDistance)
- List<MissileAPI> getEnemyMissilesInArc(WeaponAPI weapon,
boolean sortByDistance)
2.0b (October 20, 2014)
=========================
Changes to CampaignUtils:
- Added getNearestEntityFromFaction(SectorEntityToken token, Class entityType,
FactionAPI faction)
- Added getNearbyEntitiesFromFaction(SectorEntityToken token, float range,
Class entityType, FactionAPI faction)
- Added getEntitiesFromFaction(LocationAPI location, Class entityType,
FactionAPI faction)
- Renamed getXByRep() methods to getXWithRep(), also made them no longer
include members of the passed in token's faction in their results
Errr, Well, i get this error, (seeing as i dont know how to show it other wise) Fatal: org/lazywizard/lazylib/LazyLib : Usupported major.minor version 51.0 Check starsector.log for more info. I havent looked at the log, But anyways, I made sure i capped all that was set capped, so yea,
Ive been lookin, and i cant find a single java 7 download that is from the site, i got java 8, So wtf? why is java 7 not there?Here is a link to java 7 https://java.com/en/download/manual_java7.jsp
Is this mod backwards compatible? I use mods that only work on 0.6.a yet need this to work...0.6.2a*
Never mind my comments, iI figured it out myself.Is this mod backwards compatible? I use mods that only work on 0.6.a yet need this to work...0.6.2a*
float damage = timeSinceLastArc
* WeaponUtils.calculateDamagePerSecond(beam.getWeapon());
/////
activeArc = CombatUtils.getCombatEngine().spawnEmpArc(
beam.getSource(), source,
currentEmitter, currentVictim,
DamageType.ENERGY, damage, emp, range,
"tachyon_lance_emp_impact", 15f,
FRINGE_COLOR, CORE_COLOR);
float damage = beam.getWeapon().getDamage().computeDamageDealt(timeSinceLastArc);
float damage = beam.getWeapon().getDerivedStats().getDps() * timeSinceLastArc;
CombatUtils.getCombatEngine() was removed after Global.getCombatEngine() was added to the API. You can switch to the latter with no problems.
The damage calculations in WeaponUtils were removed because at that time a lot of new mutable stats were being added to weapons, and it was a colossal pain to add support for and test all of them. Luckily the API also seems to support this sort of thing now. It'd be something along these lines:Code: javafloat damage = beam.getWeapon().getDamage().computeDamageDealt(timeSinceLastArc);
If that doesn't work, you can fall back to this line of code (which won't take stat bonuses into effect):Code: javafloat damage = beam.getWeapon().getDerivedStats().getDps() * timeSinceLastArc;
List<SectorEntityToken> nearbyFriendlyStations = CampaignUtils.getNearbyEntitiesWithRep(player, 1500f, OrbitalStationAPI.class, IncludeRep.AT_OR_HIGHER, RepLevel.NEUTRAL);
List<SectorEntityToken> nearbyFriendlyStations = CampaignUtils.getNearbyEntitiesWithRep(player, 1500f, Tags.STATION, IncludeRep.AT_OR_HIGHER, RepLevel.NEUTRAL);
2.1 (November 19, 2015)
=========================
Changes to AnchoredEntity:
- getLocation() no longer returns a direct reference to the anchor's location
when the anchored entity shares the same location
Changes to CampaignUtils:
- Added addShipToFleet(String wingOrVariantId, FleetMemberType type,
CrewXPLevel level, CampaignFleetAPI fleet)
- Removed all getXOfType() methods, replaced with getXWithTag() (was filtering
using class, now uses entity tags)
- All methods that took a "Class entityClass" argument have had said argument
replaced with "String tag"
- getNearbyFleets(), getNearbyHostileFleets(), get NearestHostileFleet(),
and getHostileFleetsInSystem() only include fleets that are visible to the
sensors of the token passed in to the method
- Fixed a few getNearbyX() methods potentially including the token they are
searching around
Changes to CollectionUtils:
- Added combinedList() and combinedSet() to simplify creating a List/Set from
multiple source Collections, take any number of Collections as arguments
Changes to ColorUtils:
- Fixed: glColor() alphaMult value isn't multiplied correctly when argument
"overrideOriginalAlpha" is true
My apologies, it looks like I forgot a step when packaging the mod. I blame the thirteen months between 2.0b and 2.1 (so, myself).
I updated the downloads to include the documentation. You can also download the latest javadoc directly from this link (https://bitbucket.org/LazyWizard/lazylib/downloads/javadoc.zip).
14975 [Thread-5] INFO com.fs.graphics.TextureLoader - Cleaned buffer for texture graphics/ships/buffalo/buffalo_pirates.png (using cast)
14976 [Thread-5] INFO com.fs.graphics.TextureLoader - Cleaned buffer for texture graphics/ships/hound/hound_substandard.png (using cast)
14992 [Thread-5] INFO org.lazywizard.lazylib.LazyLib - Running LazyLib v2.1 for Starsector 0.7a
14992 [Thread-5] INFO com.fs.starfarer.loading.LoadingUtils - Loading JSON from [lazylib_settings.json]
15006 [Thread-5] WARN com.fs.starfarer.loading.SpecStore - Description with id flarelauncher_fighter_SHIP_SYSTEM not found
15006 [Thread-5] WARN com.fs.starfarer.loading.SpecStore - Description with id traveldrive_SHIP_SYSTEM not found
15006 [Thread-5] WARN com.fs.starfarer.loading.SpecStore - Description with id inferniuminjector_SHIP_SYSTEM not found
15006 [Thread-5] WARN com.fs.starfarer.loading.SpecStore - Description with id skimmer_drone_SHIP_SYSTEM not found
15009 [Thread-5] INFO com.fs.graphics.TextureLoader - Cleaned buffer for texture graphics/particlealpha32sq.png (using cast)
15025 [Thread-11] INFO sound.oo0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO - Creating streaming player for music with id [miscallenous_main_menu.ogg]
15026 [Thread-11] INFO sound.H - Playing music with id [miscallenous_main_menu.ogg]
15036 [Thread-9] INFO sound.F - Creating music buffer #1
16373 [Thread-5] INFO com.fs.starfarer.campaign.save.CampaignGameManager - Reading save data from [..\saves\save_ADMKarpov_3332573060079872227\descriptor.xml]
16394 [Thread-5] INFO com.fs.starfarer.campaign.save.CampaignGameManager - Reading save data from [..\saves\save_AdmKingston_2093127268273572182\descriptor.xml]
16406 [Thread-5] INFO com.fs.starfarer.campaign.save.CampaignGameManager - Reading save data from [..\saves\save_AdmTripshore_7729020884772380354\descriptor.xml]
16408 [Thread-5] INFO com.fs.starfarer.campaign.save.CampaignGameManager - Reading save data from [..\saves\save_CptCUie_2414757829677731390\descriptor.xml]
16409 [Thread-5] INFO com.fs.starfarer.campaign.save.CampaignGameManager - Reading save data from [..\saves\save_CptCUie_2953172373566174271\descriptor.xml]
16410 [Thread-5] INFO com.fs.starfarer.campaign.save.CampaignGameManager - Reading save data from [..\saves\save_CptCUie_6938502034617090140\descriptor.xml]
16411 [Thread-5] INFO com.fs.starfarer.campaign.save.CampaignGameManager - Reading save data from [..\saves\save_Golol_4340986767572239102\descriptor.xml]
16413 [Thread-5] INFO com.fs.starfarer.campaign.save.CampaignGameManager - Reading save data from [..\saves\save_NewCorvusInc_2096498756251732626\descriptor.xml]
16527 [Thread-11] INFO sound.oo0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO - Creating streaming player for music with id [miscallenous_main_menu.ogg]
16527 [Thread-11] INFO sound.H - Playing music with id [miscallenous_main_menu.ogg]
16652 [Thread-5] ERROR com.fs.starfarer.combat.CombatMain - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.campaign.save.LoadGameDialog.o00000(Unknown Source)
at com.fs.starfarer.campaign.save.LoadGameDialog$1.o00000(Unknown Source)
at com.fs.starfarer.campaign.save.LoadGameDialog$1.compare(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.legacyMergeSort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.ArrayList.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at com.fs.starfarer.campaign.save.LoadGameDialog.<init>(Unknown Source)
at com.fs.starfarer.title.TitleScreenState.showLoadGameDialog(Unknown Source)
at com.fs.starfarer.title.TitleScreenState.menuItemSelected(Unknown Source)
at com.fs.starfarer.title.ooOO.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.interfacesuper.o00000(Unknown Source)
at com.fs.starfarer.ui.null.processInput(Unknown Source)
at com.fs.starfarer.ui.U.o00000(Unknown Source)
at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Is there a version of the LazyLib javadoc publicly available on the Web somewhere?
If not, do you mind if I put one up myself?
Is there a version of the LazyLib javadoc publicly available on the Web somewhere?
If not, do you mind if I put one up myself?
There's not, and feel free! :)
It's a bug with Kadur Theocracy (http://fractalsoftworks.com/forum/index.php?topic=10555.msg187912#msg187912).Thanks.
@DrakonST I think you have to remove some of the mods.Histidine has already given the answer. He was true.
Buggy:
- Bushi.
- Hiigaran Descendants.
- Kadur Theocracy.
- New Galactic Order (Have you implemented the fix for it that you have made?).
- Templars (There is an error with colour boundaries, I have a fix for that if you want).
- Project Valkyrie (It is outdated).
.
Other questionable mods in terms of stability & compatibility:
- ICE (I had a crash with it a few times, don't know why).
- Autonomous Ship.
- Piratos_noSS+ (What is this? Is it Extra Salvage / Boarding?)
.
Aside from these mods, you should be fine.
I would still listen to him though as most if not all of those mods are buggy and crash prone@DrakonST I think you have to remove some of the mods.Histidine has already given the answer. He was true.
Buggy:
- Bushi.
- Hiigaran Descendants.
- Kadur Theocracy.
- New Galactic Order (Have you implemented the fix for it that you have made?).
- Templars (There is an error with colour boundaries, I have a fix for that if you want).
- Project Valkyrie (It is outdated).
.
Other questionable mods in terms of stability & compatibility:
- ICE (I had a crash with it a few times, don't know why).
- Autonomous Ship.
- Piratos_noSS+ (What is this? Is it Extra Salvage / Boarding?)
.
Aside from these mods, you should be fine.
2.2 (April 21, 2017)
=======================
Updated to be compatible with Starsector 0.8a
LazyLib Javadoc now links to LWJGL, Starsector, and JSON Javadocs
Changes to CampaignUtils:
- Removed crew XP level argument from addShipToFleet()
116621 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain - java.lang.RuntimeException: Filenames are case-sensitive, [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\LazyLib\jars\LazyLib.jar] vs [C:\Program Files (x86)\Fractal Softworks\Starsector\mods\LazyLib\jars\LazyLib.jar]
java.lang.RuntimeException: Filenames are case-sensitive, [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\LazyLib\jars\LazyLib.jar] vs [C:\Program Files (x86)\Fractal Softworks\Starsector\mods\LazyLib\jars\LazyLib.jar]
at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Redownload Starsector to get the newest hotfix version (RC19).
package data.scripts.plugins;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.combat.BaseEveryFrameCombatPlugin;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.ViewportAPI;
import org.lazywizard.lazylib.ui.FontException;
import org.lazywizard.lazylib.ui.LazyFont;
import org.lwjgl.input.Mouse;
import java.awt.*;
public class LazyFontExample extends BaseEveryFrameCombatPlugin
{
private LazyFont.DrawableString toDraw;
// Set up the font and the DrawableString; only has to be done once
@Override
public void init(CombatEngineAPI engine)
{
// Load the chosen .fnt file
// Fonts are cached globally, so it's acceptable for each class using the same
// font to request their own copy of it - they will all share the underlying data
final LazyFont font;
try
{
font = LazyFont.loadFont("graphics/fonts/insignia15LTaa.fnt");
}
// FontException is thrown if the .fnt file does not exist or has malformed data
catch (FontException ex)
{
Global.getLogger(this.getClass()).error("Failed to load font", ex);
engine.removePlugin(this);
return;
}
// Create a renderable block of text (in this case, will be yellow with font size 15)
toDraw = font.createText("This is some sample text.", Color.YELLOW, 15f);
// Enable line wrapping when text reaches 400 pixels wide
toDraw.setMaxWidth(400f);
// If you need to add text to the DrawableString, do so like this:
toDraw.appendText("\nThis is a second line of sample text.");
toDraw.appendText("\nThis is a third line of sample text that shows off the automatic" +
" word wrapping when a line of text reaches the maximum width you've chosen.");
}
@Override
public void renderInUICoords(ViewportAPI view)
{
// Call draw() once per frame to render the text
// In this case, draw the text slightly below the mouse cursor
// The draw point is the top left corner of the textbox, so we adjust the X
// position to center the text horizontally below the mouse cursor
if (Global.getCombatEngine() != null)
{
toDraw.draw(Mouse.getX() - (toDraw.getWidth() / 2f), Mouse.getY() - 30f);
}
}
}
2.3 (November 12, 2018)
=========================
Bundled the Kotlin runtime library (v1.3.0) with LazyLib:
- Kotlin is an alternate JVM language that is 100% interoperable with Java
- "Core" LazyLib is and always shall be written in Java, though some features
such as the font classes are written in Kotlin for convenience's sake
- Kotlin extension methods can be found within the org.lazywizard.lazylib.ext
package in jars/LazyLib-Kotlin.jar (Java users can safely ignore this jar)
Added @Nullable and @NotNull annotations where appropriate
Added org.lazywizard.lazylib.ui.LazyFont:
- Represents a bitmap font (the same type Starsector itself uses)
- Load a font using the static method loadFont(String fontPath)
- Use createText() to create a reusable DrawableString, which can draw a
block of text repeatedly and very efficiently
- Use drawText() to manually draw text into a VBO or display list
- See LazyFont's javadoc for example usage
Changes to CampaignUtils:
- Added getEntitiesWithRep(SectorEntityToken token, String entityTag,
IncludeRep include, RepLevel rep)
- Added toWorldCoordinates(Vector2f screenCoordinates)
- Added toScreenCoordinates(Vector2f worldCoordinates)
Changes to CollectionUtils:
- Added implode(Enum toImplode)
- Added implode(Enum toImplode, String separator)
Changes to CollisionUtils:
- Added getNearestPointOnBounds(Vector2f source, CombatEntityAPI entity)
Changes to ColorUtils:
- Added glColor(Color color, float alpha)
Changes to CombatUtils:
- Added toWorldCoordinates(Vector2f screenCoordinates)
- Added toScreenCoordinates(Vector2f worldCoordinates)
Changes to FastTrig:
- Added atan() and atan2() that are much faster (though less accurate)
than the implementations in Java's core Math class
(roughly 5-20x faster; accurate to within 0.005 radians/~0.29 degrees)
Changes to MathUtils:
- Added FPI and FTAU constants, contain Math.PI and Math.PI * 2 as floats
- Added clamp(float/int toClamp, float/int min, float/int max). This clamps
the passed value within the given range. Variants are provided for both
integers and floats.
- Added getNearestPointOnLine(Vector2f source, Vector2f lineStart,
Vector2f lineEnd)
- Added getPoint(Vector2f center, float radius, float angle). This acts as an
alias for the existing getPointOnCircumference(), which is both the most
commonly used method in LazyLib as well as one of the most awkwardly named
Changes to ModUtils:
- Added isModEnabled(String modId)
- Added loadClassesIfClassIsPresent(String classCanonicalName,
List<String> classesToLoadCanonicalNames, boolean initializeClasses)
- Added getEnabledModIds()
- Added getOverrides(), returns vanilla files explicitly overridden by any
mod (ie: in that mod's mod_info.sjon 'replace' section)
Changes to VectorUtils:
- getFacing() and getAngle() now use FastTrig's new atan2() implementation
- Added getFacingStrict() and getAngleStrict(), which are slower but more
accurate (these use the old pre-2.3 atan2() implementations)
- Added isZeroVector(Vector2f vector)
- Added resize(Vector2f vector, float length)
- Added resize(Vector2f vector, float length, Vector2f dest)
- Added clampLength(Vector2f vector, float maxLength)
- Added clampLength(Vector2f vector, float maxLength, Vector2f dest)
- Added clampLength(Vector2f vector, float minLength, float maxLength)
- Added clampLength(Vector2f toClamp, float minLength, float maxLength,
Vector2f dest)
- Added rotate(Vector2f toRotate, float angle), convenience method that
stores the result in toRotate
- Added rotateAroundPivot(Vector2f toRotate, Vector2f pivotPoint,
float angle), convenience method that stores the result in toRotate
Removed from LazyLib:
- Removed isDevBuild()
Removed from SimpleEntity:
- Removed Object constructor (it used reflection, which is now blocked;
remaining options are Vector2f, WeaponAPI, and ShipEngineAPI)
Miscellaneous Javadoc improvements
2.4 (November 16, 2018)
=========================
Updated to be compatible with Starsector 0.9a
Updated bundled Kotlin runtime library to v1.3.10
Added org.lazywizard.lazylib.JSONUtils.CommonDataJSONObject:
- Provides a wrapper around a standard JSONObject
- save() method saves JSON to common data folder (saves/common), which will
persist between saves (and presumably survive Starsector updates)
- Constructor takes the filename under saves/common to save the data to
Changes to JSONUtils:
- Added clear(JSONObject toClear)
- Added loadCommonJSON(String filename)
(if file does not exist, returns an empty CommonDataJSONObject)
- Added loadCommonJSON(String filename, String defaultJSONPath)
(if file does not exist, copies existing data from defaultJSONPath)
2.4b (November 16, 2018)
==========================
Changes to JSONUtils:
- loadCommonJSON(String filename, String defaultJSONPath) will save the newly
created CommonDataJSONObject to disk immediately if defaultJSONPath exists
and filename does not
242012 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain - java.lang.NoSuchMethodError: org.lazywizard.lazylib.MathUtils.getPoint(Lorg/lwjgl/util/vector/Vector2f;FF)Lorg/lwjgl/util/vector/Vector2f;
java.lang.NoSuchMethodError: org.lazywizard.lazylib.MathUtils.getPoint(Lorg/lwjgl/util/vector/Vector2f;FF)Lorg/lwjgl/util/vector/Vector2f;
at data.scripts.ai.SCY_arcMissileAI.advance(SCY_arcMissileAI.java:197)
at com.fs.starfarer.combat.entities.Missile$GuidedMissileAIWrapper.advance(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
at com.fs.starfarer.title.TitleScreenState.advance(Unknown Source)
at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
242013 [Thread-10] INFO sound.null - Playing music with id [064.ogg]
2.4c (March 01, 2019)
=======================
Updated bundled Kotlin runtime library to v1.3.21
Changes to CombatUtils:
- All getXWithinRange() methods have been updated to use 0.9a's new
CollisionGridAPI, which should improve performance
- getEntitiesWithinRange() now includes BattleObjectiveAPIs
Changes to LazyFont:
- Fixed text blending issue
- Blend mode is no longer automatically enabled during rendering - if you want
your text to be drawn blended, you must ensure GL_BLEND is enabled and set
the blend func (usually glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA))
2.4d (March 03, 2018)
=======================
Changes to CombatUtils:
- Reverted changes to getEntitiesWithinRange() (it now only returns ships,
projectiles, missiles and asteroids as it did pre-2.4c)
2.4f (January 31, 2020)
=========================
Updated bundled Kotlin runtime library to v1.3.61
Javadoc is now available online at https://lazywizard.github.io/lazylib
Moved .version file hosting to GitHub
Updated bundled libraries:
- kotlin-stdlib: v1.3.61 -> v1.4.21
- kotlinx-coroutines: v1.2.0 -> v1.4.2
- jetbrains-annotations: v13.0 -> v20.1.0
- removed kotlinx-atomicfu (this was an erroneous dependency added by
an earlier version of kotlinx-coroutines and wasn't used for anything)
Changes to LazyFont:
- Rewrote DrawableString to use vertex buffers instead of display lists.
This should fix a bug that caused text corruption and visual glitches
when DrawableStrings were rendered in the campaign layer
Deprecated in LazyFont:
- Deprecated drawText(String text, float x, float y, float fontSize,
float maxWidth, float maxHeight), use createText() instead
2.5b (January 20, 2021)
=========================
Retroactively renamed v2.4g to v2.5
Changes to LazyFont:
- Added getFontName()
Changes to LazyFont.DrawableString:
- Fixed a crash with word-wrapped text that includes a hyphenated line break
- Added setRenderDebugBounds(), which draws a box showing the text's width,
height, and position
2.5c (January 23, 2021)
=========================
Changes to LazyFont.DrawableString:
- Fixed rendering issues on some computers (thanks to Dream from the
Discord server for reporting the bug and testing the fix)
- Added colored substring support
- Added appendText(String text, Color color)
- Added appendText(String text, Color color, int indent)
- Appending colored text only colors that substring, and all subsequent
text will return to the base color chosen at DrawableString creation.
To change the base color, call DrawableString.setColor()
2.6 (March 26, 2021)
======================
Updated to be compatible with Starsector 0.95a
Updated bundled libraries:
- kotlin-stdlib: v1.4.21 -> v1.4.31
- kotlinx-coroutines: v1.4.2 -> v1.4.3
The Javadoc's index is now one single page
Added org.lazywizard.lazylib.IOUtils:
- Contains methods to help with reading/writing files using the API
- byte[] readAllBytes(String filePath), an API-safe port of
java.nio.Files.readAllBytes()
Changes to LazyFont.DrawableString:
- Added tab support (2x the base vertical height of the text)
- Added append(String text)
- Added append(String text, Color color)
- Added appendIndented(String text, int indent)
- Added appendIndented(String text, Color color, int indent)
- Added getBlendSrc(), setBlendSrc(int blendSrc), getBlendDest(), and
setBlendDest(int blendDest) to control color blending
Deprecated in LazyFont.DrawableString:
- Deprecated all appendText() methods in favor of new append() equivalents.
The append() variants take any object and return the DrawableString so that
calls can be chained together
import org.lazywizard.lazylib.ext.combat.CombatExtensionsKt;
List<ShipAPI> shipList = CombatExtensionsKt.getNearbyEnemies(ship, nearbyShipAssessmentRange);
just started a new game, ran into a cryosleeper and attempted to engage it. got this error message a few seconds after starting the fight. here's the log for the crash; tried updating lazylib to the newest version but that didn't fix it so i'm out of ideas
45233 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain - java.lang.NoClassDefFoundError: org/lazywizard/lazylib/ext/combat/CombatExtensionsKt
java.lang.NoClassDefFoundError: org/lazywizard/lazylib/ext/combat/CombatExtensionsKt
at data.scripts.shipsystems.ai.AO_FluxConverterAI.assessNearbyThreats(AO_FluxConverterAI.java:166)
at data.scripts.shipsystems.ai.AO_FluxConverterAI.advance(AO_FluxConverterAI.java:104)
at com.fs.starfarer.loading.specs.M$1.super(Unknown Source)
at com.fs.starfarer.combat.ai.BasicShipAI.advance(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
at com.fs.starfarer.combat.CombatState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.lazywizard.lazylib.ext.combat.CombatExtensionsKt
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 12 more
2.7 (October 22, 2021)
========================
Fixed links to online Starsector API in javadoc.zip
Updated bundled libraries:
- kotlin-stdlib: v1.4.31 -> v1.5.31
- kotlinx-coroutines: v1.4.3 -> v1.5.2
- jetbrains-annotations: v20.1.0 -> 22.0.0
Changes to CombatUtils:
- Fixed a bug where ships spawned by spawnShipOrWingDirectly() would
report the wrong fleet side in some circumstances
Changes to LazyFont:
- Fixed log spam with some whitespace being considered unsupported characters
Changes to LazyFont.DrawableString:
- Fixed minor memory leak when dispose() is not called before GC
- Added TextAlignment, setAlignment(), and getAlignment(). TextAlignment
controls whether text is drawn left-aligned (the default), right-aligned,
or centered
- Added TextAnchor, setAnchor(), and getAnchor(). TextAnchor controls the
origin when drawing text; for example, TextAnchor.TOP_LEFT (the default)
will mean draw() will start drawing at the top left, so the text will
appear below and to the right of the position passed into draw()
- Added setBaseColor() and getBaseColor() (replace setColor()/getColor())
- Added isRebuildNeeded() and triggerRebuildIfNeeded() (unnecessary 99% of
the time as rebuilding happens automatically, but useful in fringe cases)
- Cleaned up some out-of-date documentation
Deprecated in LazyFont.DrawableString:
- Deprecated setColor() and getColor(), as users were assuming they set the
color of the next append. Added setBaseColor() and getBaseColor() as
replacements that better convey what these methods do (set/get the color of
all text that _doesn't_ have a color argument passed in)
2.7b (December 10, 2021)
==========================
Updated to be compatible with Starsector 0.95.1a
Updated bundled libraries:
- jetbrains-annotations: v22.0.0 -> 23.0.0
Changes to LazyFont.DrawableString:
- Center/right-aligned text no longer requires maxWidth to be set
- setRenderDebugBounds() now shows anchor and max size
Getting an error when attempting to engage a Domain Era Cryosleeper Guardian.
Getting an error when attempting to engage a Domain Era Cryosleeper Guardian.
Judging from log, its Archean Order issue, Flux Converter its its subsystem for it. Probably its got broken due new update, post this log in Archean Order topic.
Any chance of an update for the R6 version of 0.95.1?Why would it need one?
12348 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain - java.lang.RuntimeException: Error loading [org.lazywizard.lazylib.LazyLib]For anyone in the future having trouble running the game with just LazyLib with this error, check your antivirus (https://fractalsoftworks.com/forum/index.php?topic=24928.msg371075#msg371075).
java.lang.RuntimeException: Error loading [org.lazywizard.lazylib.LazyLib]
at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.lazywizard.lazylib.LazyLib
at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:179)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more
I keep getting this and can't figure out what im doing wrong, can anyone help a brother out?
Update please
downloaded uaf mod and run with new lazylib but it keep crashing,cant get a good mod experience
try to run with other mod but still no working sign,pls fix
Could someone please post the 2.6 version of this mod ?
2.8 (April 05, 2023)
======================
Updated to be compatible with Starsector 0.96a
Updated bundled libraries:
- kotlin-stdlib: v1.5.31 -> v1.6.21
- kotlinx-coroutines: v1.5.2 -> v1.6.4 (custom build)
- These are the last versions that support Java 7
Added org.lazywizard.lazylib.campaign.orbits.KeplerOrbit:
- Submitted by Liral, this provides more accurate orbits than EllipticalOrbit
Changes to CombatUtils:
- Updated to use CombatEngineAPI's bin-lattice system where applicable, as
requested by several modders since those methods introduction
2.8b (February 02, 2024)
==========================
Updated to be compatible with Starsector 0.97a
Changes to LazyFont:
- Changed default blendSrc back to GL_SRC_ALPHA (was GL_ONE since 2.4c)
Deprecated org.lazywizard.lazylib.campaign.orbits.KeplerOrbit:
- Deprecated at the request of its contributor
Version 2.8b is out, get it here (https://github.com/LazyWizard/lazylib/releases/download/2.8b/LazyLib.2.8b.zip) (mirror (https://www.nexusmods.com/starsector/mods/1?tab=files)) (mirror 2 (https://www.mediafire.com/file/pr0ycpiipmij8gz/LazyLib_2.8b.zip/file)).holy *** that response time, wtf?
Changelog:Quote2.8b (February 02, 2024)
==========================
Updated to be compatible with Starsector 0.97a
Changes to LazyFont:
- Changed default blendSrc back to GL_SRC_ALPHA (was GL_ONE since 2.4c)
Deprecated org.lazywizard.lazylib.campaign.orbits.KeplerOrbit:
- Deprecated at the request of its contributor
If I use version LazyLib v2.8b for 0.95.1. Will there be any problems?Won't work; newer releases are NOT backwards-compatible with older versions of StarSector.