Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 7 8 [9] 10 11 ... 16

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

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: LazyLib v2.0 (.65a, released 2014-10-20)
« Reply #120 on: October 20, 2014, 01:47:15 PM »

2.0 is up, get it here (mirror).

This release mostly removes all the deprecated methods that have been cluttering this library for the last several versions. It also expands campaign functionality to support custom entities and the new .65a faction relationship system, as well as fixes a few bugs.

I should note that this hasn't been thoroughly tested yet (.65a was only released half an hour ago), so a patch might be coming soon if something doesn't work properly. I felt it was more important to get a release out quickly so other modders could update their own mods. :)

If you're waiting on any of my other mods, those will probably be updated tomorrow.

Changelog:
Spoiler
Quote
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)
[close]
« Last Edit: October 20, 2014, 02:16:43 PM by LazyWizard »
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: LazyLib v2.0b (.65a, released 2014-10-20)
« Reply #121 on: October 20, 2014, 03:58:33 PM »

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

Changelog:
Quote
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
Logged

Codyrex123

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: [0.65.1a] LazyLib v2.0b (released 2014-10-20)
« Reply #122 on: November 13, 2014, 06:58:48 PM »

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,
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: [0.65.1a] LazyLib v2.0b (released 2014-10-20)
« Reply #123 on: November 13, 2014, 07:04:17 PM »

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,

I'm guessing you have Starsector set to use your system's java? You probably have an older JRE, Starsector uses Java 7.
Logged

Codyrex123

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: [0.65.1a] LazyLib v2.0b (released 2014-10-20)
« Reply #124 on: November 13, 2014, 08:52:41 PM »

You mean Lazylib uses Java 7, Becuase when am running lazylib it shows up, not when it unmodded,
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: [0.65.1a] LazyLib v2.0b (released 2014-10-20)
« Reply #125 on: November 13, 2014, 08:59:04 PM »

Starsector upgraded the bundled JRE to Java 7 in version 0.6.2a, but the base game continues to work with 6 just fine. I started using the Java 7 language features because it's the version the game ships with. :)
Logged

Codyrex123

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: [0.65.1a] LazyLib v2.0b (released 2014-10-20)
« Reply #126 on: November 14, 2014, 09:27:40 PM »

Guess i gota look for teh java then
Logged

Codyrex123

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: [0.65.1a] LazyLib v2.0b (released 2014-10-20)
« Reply #127 on: November 15, 2014, 01:04:54 PM »

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?
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2846
  • Your Friendly Forum Friend
    • View Profile
Re: [0.65.1a] LazyLib v2.0b (released 2014-10-20)
« Reply #128 on: November 15, 2014, 01:11:51 PM »

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
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

Nanao-kun

  • Admiral
  • *****
  • Posts: 829
    • View Profile
Re: [0.65.1a] LazyLib v2.0b (released 2014-10-20)
« Reply #129 on: November 15, 2014, 01:47:20 PM »

Doesn't Starsector and Lazylib work just fine with Java 8? It's what I use and I haven't had any problems.
Logged

Nemerid

  • Ensign
  • *
  • Posts: 16
    • View Profile
Re: [0.65.2a] LazyLib v2.0b (released 2014-10-20)
« Reply #130 on: February 15, 2015, 12:32:42 PM »

Is this mod backwards compatible? I use mods that only work on 0.6.a yet need this to work...
Logged

Nemerid

  • Ensign
  • *
  • Posts: 16
    • View Profile
Re: [0.65.2a] LazyLib v2.0b (released 2014-10-20)
« Reply #131 on: February 15, 2015, 12:33:32 PM »

Is this mod backwards compatible? I use mods that only work on 0.6.a yet need this to work...
0.6.2a*
Logged

Nemerid

  • Ensign
  • *
  • Posts: 16
    • View Profile
Re: [0.65.2a] LazyLib v2.0b (released 2014-10-20)
« Reply #132 on: February 15, 2015, 12:38:04 PM »

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.
Logged

DefiasOne

  • Commander
  • ***
  • Posts: 205
    • View Profile
Re: [0.65.2a] LazyLib v2.0b (released 2014-10-20)
« Reply #133 on: March 03, 2015, 06:51:18 AM »

While trying to revamp the Bushi mod I've come across this little problem in some of the weapon scripts:

Code
 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);

CalculateDamagerPerSecond and getCombatEngine() is an unknown symbol, is there any equivalent function to this or is it deprecated now ? If not I will scrap the script for later reimplementation.
« Last Edit: March 03, 2015, 06:53:01 AM by DefiasOne »
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: [0.65.2a] LazyLib v2.0b (released 2014-10-20)
« Reply #134 on: March 03, 2015, 11:51:05 AM »

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: java
float 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: java
float damage = beam.getWeapon().getDerivedStats().getDps() * timeSinceLastArc;
« Last Edit: March 03, 2015, 11:58:41 AM by LazyWizard »
Logged
Pages: 1 ... 7 8 [9] 10 11 ... 16