(https://i.imgur.com/OR5wYZM.jpg)
The goal of MagicLib is to create an Open Source, community-driven "library" of useful (and well documented) scripts and plugins that can be leveraged and contributed to by every modder.
All contributions are welcome!
(https://i.imgur.com/GMCkkky.png)
Download (https://bitbucket.org/CodingTartiflette/magiclib/downloads/MagicLib_0.29_rc3.zip)
NexusMods mirror (https://www.nexusmods.com/starsector/mods/10/)
Requires LazyLib (http://fractalsoftworks.com/forum/index.php?topic=5444.0)
(https://i.imgur.com/8EpNARt.png) (http://starsector.wikia.com/wiki/MagicLib)
(https://i.imgur.com/AnkilqL.png) (https://bitbucket.org/CodingTartiflette/magiclib)
Fully usable release, if anyone wants to contribute you are more than welcome to do so as it is intended to be a community tool. Do check the Wiki to get a lot of details on the current content.
Curent content:
Functions
MagicModuleRetreatCleaner
Fixes the bug with retreating ships with modules preventing the combat from ending.
MagicIncompatibleHullmod
A uniform solution for the "incompatible hullmod" issue with vanilla hullmods.
MagicInterference
Adds a cross-mod mechanic to balance very powerful weapons.
MagicAnim
A collection of functions to make smooth animations.
MagicFakeBeam
Creates convincing punctual beams from arbitrary coordinates.
MagicLensFlare
Creates "cinematic" lens flares.
MagicRender
Draw arbitrary sprites on-screen with constraints to entities/camera when needed. (aka "SpriteRenderManager")
MagicTargeting
Allows "smart" target selection for systems and missiles within distance and search cone parameters, plus it can use ship-class preferences.
MagicTrails
Allows to create missile-style trails anywhere, from ships to bullets, with a lot of customization options. Also includes a CSV based manager that should be able to handle most projectile use cases with negligible overhead.
MagicUI
Draws UI elements such as a system-like charge-bar/tick box next to the normal ship-system for special systems, or an extra status bar above the flux/hull bars.
Loose scripts
Scripts that can be used "as it is" or can be copied to individual mods to personalize the result.
MagicVectorThruster
Manages vectoring or vernier-style attitude thrusters.
MagicMissileAI
A very customizable and lightweight missile AI script usable without any java knowledge.
MagicGuidedProjectileScript
A weapon script that allows regular projectiles to track their target.
Planned / considered content:
MagicRotary
A loose script to make rotary weapons animations with smooth spin up and down.
Contributors:
Dark.Revenant (MagicUI)
Deathfly (MagicFakeBeam)
jtyotJOTJIPAEFVJ (MagicAnim.cycle)
Kitta Khan (bugfixes)
Nicke (MagicTrails, MagicGuidedProjectileScript)
Snrasha (MagicUI)
Tartiflette
(https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png) (http://creativecommons.org/licenses/by-nc-sa/4.0/)
MagicLib is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (http://creativecommons.org/licenses/by-nc-sa/4.0/).
Any derivative work must also comply with Starsector's EULA
(https://i.imgur.com/OR5wYZMl.jpg)
0.9.1 update: Added render order overrides for MagicTrail and MagicRender, plus an optional override boolean for the CSV based Trail manager.
Download available in the OP (http://fractalsoftworks.com/forum/index.php?topic=13718.)
Encountered a crash with ScyNation (whenever a SN ship enters combat) but the actual cause might be this error that appears when loading the game:
Spoiler
148451 [Thread-4] INFO com.fs.starfarer.campaign.save.CampaignGameManager - Loading stage 31
148451 [Thread-4] INFO com.fs.starfarer.campaign.save.CampaignGameManager - Loading stage 32
148451 [Thread-4] INFO com.fs.starfarer.campaign.save.CampaignGameManager - Loading stage 33
149043 [Thread-4] INFO com.fs.starfarer.loading.LoadingUtils - Loading CSV data from [DIRECTORY: C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\MagicLib]
149044 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - Invalid line, skipping
(https://i.imgur.com/OR5wYZMl.jpg)
Small bugfixes update to solve the Linux case issue as well as the Screencheck culling function being too aggressive.
This won't break any saves or mods.
Download available in the OP (http://fractalsoftworks.com/forum/index.php?topic=13718.)
(https://i.imgur.com/OR5wYZMl.jpg)
Added a couple new functionalities as per a few modder request:
MagicAnim.cycle (allows a variable to cycle within an arbitrary range)
MagicGuidedProjectileScript (allows projectiles to track their target)
This won't break any saves or mods.
Download available in the OP (http://fractalsoftworks.com/forum/index.php?topic=13718.)
I'm getting a crash, probably because I'm using the method wrong but I didn't find any sample code to go off of.
33855 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.campaign.CustomCampaignEntity.readResolve(Unknown Source)
at com.fs.starfarer.campaign.CustomCampaignEntity.<init>(Unknown Source)
at com.fs.starfarer.campaign.BaseLocation.addCustomEntity(Unknown Source)
at data.scripts.plugins.MagicCampaignTrailPlugin.advance(MagicCampaignTrailPlugin.java:59)
at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
at com.fs.starfarer.campaign.CampaignState.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(Thread.java:745)
The calling code is identical to:
Global.getSector().addScript(new MagicCampaignTrailPlugin());
The player is on the campaign layer, in a dialog, when that's called.
Here's the actual source: https://github.com/davidwhitman/Gates-Awakened/blob/331041fad49b6f0518d99e02fd17c1f6d019759c/src/main/kotlin/org/wisp/gatesawakened/jumping/Jump.kt#L64
Any thoughts? It's crashing inside of addCustomEntity in this MagicLib code:
associatedEntity = Global.getSector().getPlayerFleet().getContainingLocation().addCustomEntity("nictoy_unique_custom_trail_tracker_object", "YOU SHOULD NOT SEE THIS",
"nictoy_campaign_trail_custom_entity", Factions.INDEPENDENT, this);
(https://i.imgur.com/OR5wYZMl.jpg)
Fixed a few bugs and added a couple of new functionalities as per a few modder request:
0.29
Added MagicInterferencePlugin
. Makes exceptionally strong weapons with the "Interference" trait have negative effects when more that one is mounted on a given ship.
. Those weapons need to trigger the plugin to check for possible other interference sources from a CSV file.
. If other sources are found, it will add a hullmod that reduced the ship's dissipation depending on the number of interfering weapons and their interference strength.
Added MagicBasicInterferenceEffec loose weapon script to trigger an interference check.
Added MagicIncompatibleHullmods
. Proposes a uniform "incompatible hullmod" solution.
. When triggered as two incompatible hullmods are added, it will remove the offending hullmod and add a hullmod to warn the player about that operation.
. The added hullmod's tooltip will indicate which hullmod was removed and why.
Added MagicModuleRetreatCleaner
. Fixes the bug with retreating ships with modules preventing the combat from ending.
MagicRender:
. Added optional blending modes to the sprite renders.
MagicUI:
. Fixed crash when used the first frame in combat.
This won't break any saves or mods.
Download available in the OP (http://fractalsoftworks.com/forum/index.php?topic=13718.)
I have some problems with the lastest version
Spoiler
74474 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_4cmrailgunshot
74474 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_4cmrailgunshot
74475 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_6cmrailgunshot
74475 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_6cmrailgunshot
74475 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_9cmrailgunshot
74475 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_9cmrailgunshot
74475 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_12cmrailgunshot
74475 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_12cmrailgunshot
74475 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_20cmrailgunshot
74475 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_20cmrailgunshot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_NTKcannon_shot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_squiggle_whistler_shot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_howler_shot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_hellspear_shot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_hellspear_shot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_omniblaster_core_shot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_artillery_shot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_artillery_shot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_scatterlaser_core_shot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_scatterlaser_sub_shot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_blaze_shot
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_TBM_submunition
74476 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_bomblet2
74477 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_electrogun_shot
74477 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_electrogun_shot
74477 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_plasmadisruptor_shot
74477 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_plasmadisruptor_shot
74477 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_pulseripper_shot
74477 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_pulseripper_shot
74477 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_plasmadriver_shot
74477 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_plasmadriver_shot
74477 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_plasmadriver_shot
74477 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_dem_pulse
74477 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_dem_pulse
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_thermalmortar_shot
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_thermalmortar_shot
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_jackalblade_lg
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_jackalblade
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_breakerLRMbombB
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_shellback_shot
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_shellhead_shot
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_phaserail_shot
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_phaserail_shot
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_phaserail_shot
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_miniphaserail_shot
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_miniphaserail_shot
74478 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_miniphaserail_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_energymortar_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_energymortar_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_calliope_submunition
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_phaseblaster_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_phaseblaster_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_phasedbuster_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_phasedbuster_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_phasedbuster_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_bravepulse_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_bravepulse_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_bravekinetic_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_bravekinetic_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_bravekinetic_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_bravemissile_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_bravemissile_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_bravemissile_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_alaudapulse_shot
74479 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - missing layer override for istl_alaudapulse_shot
74480 [Thread-4] ERROR data.scripts.plugins.MagicAutoTrails - Invalid line, skipping