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: Anubis-class Cruiser (12/20/24)

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Anexgohan

Pages: [1] 2 3 ... 6
1
Interesting thought.

2
v2.0.8
Changes for version v2.0.8
===========================
Title: we have lift off again

Commits:
Code
add: new custom made icon
fix: version checker updating
fix: mod info now reflects the current version
bug: crash fix
fix: actually upload the changed files this time

>By: Anexgohan
>Hash: 2f6ff49
>Date: 2024-05-25 01:25:21 +0530

----------------------------------------------


**Full Changelog**: https://github.com/Anexgohan/ConsoleGalaxy/compare/v2.0.6...v2.0.8

Latest Download: https://github.com/Anexgohan/ConsoleGalaxy/releases/latest/download/ConsoleGalaxy.zip

3
v0.3.1
Changes for version v0.3.1
===========================
Title: hotfix

Commits:
Code
fix: bugfix update
fix: trishul missile glow
fix: backend update
fix: release action auto asset generation

>By: Anexgohan
>Hash: ae45ccb
>Date: 2024-05-25 01:36:46 +0530

----------------------------------------------


**Full Changelog**: https://github.com/Anexgohan/AnexWeapons/compare/v0.2.9...v0.3.1

Latest Download: https://github.com/Anexgohan/AnexWeapons/releases/latest/download/AnexWeapons.zip

4
v2.0.6
Changes for version v2.0.6
===========================
Title: v2.0.6

Commits:
Code
fix: table was not rendering properly
fix: long list was getting cut
bug: table not getting set properly
feat: new implementation of tables
>By: Anexgohan
>Hash: c294cd8
>Date: 2024-05-17 17:10:21 +0530

----------------------------------------------


**Full Changelog**: https://github.com/Anexgohan/ConsoleGalaxy/compare/v2.0.5...v2.0.6

Latest Download: https://github.com/Anexgohan/ConsoleGalaxy/releases/latest/download/ConsoleGalaxy.zip

5
v0.2.9p
Changes for version v0.2.9p
===========================
Title: stable release

Commits:
Code
fix: trishul missile glow
fix: backend update

>By: Anexgohan
>Hash: 36589e5
>Date: 2024-05-19 03:26:34 +0530

----------------------------------------------


**Full Changelog**: https://github.com/Anexgohan/AnexWeapons/compare/v0.2.9n...v0.2.9p

Latest Download: https://github.com/Anexgohan/AnexWeapons/releases/latest/download/AnexWeapons.zip

6
Thanks! I don't see anything wrong there, so it looks like the problem must be something else. Hmm...
How certain are you that it's related to the max rep reduction setting? I'm having a hard time figuring out any way setting it to 1 could cause this kind of error (not to say it isn't, just that I can't find a link between the two things)
my game would crash with the same crash message a few days from the game load, 27th day i think. Could not progress beyond that, after putting that option to anything other than 1, the crash is gone and I have been playing it no crash more than a year after into the game.

7
Thanks! I took another look through the code and it looks like an error like that might happen if ruthless sector chooses a faction with an invalid color scheme to reduce your reputation with. Could you run the following in the console and let me know what it shows?

Quote
RunCode for(FactionAPI f : ruthless_sector.ModPlugin.getAllowedFactions()) { Console.showMessage(f.getBaseUIColor() + "(" + f.getId() + "/" + f.getDisplayName() + " )"); }

This is what the command outputs:


8
Hey, thanks for the report! I tried setting max reputation loss to 1 and waiting for a rep-loss message, but I didn't get any sort of error, so it looks like something else might've gone wrong in your save. Are you using any mods that change the color of the interface by any chance?

My Mods list:

Mods (92)
Code
A New Level of Confidence  v40 3.2  [pantera_ANewLevel40]
Adjusted Sector  v0.6.2  [Adjusted Sector]
AdvancedGunneryControl  v1.17.1  [advanced_gunnery_control_dbeaa06e]
Amazigh's Ship Foundry  v1.2.0  [A_S-F]
Anex Player Faction Flags  v1.1  [anexplayerflags]
Anex Weapons  v0.2.9l  [anexweapons]
Aptly Simple Hullmods  v1.9.0  [aptlysimplehullmods]
Arma Armatura  v3.0.6.1  [armaa]
Attuned Drive Field Hullmod  v0.1.3  [AttunedDriveField]
ZZ Audio Plus  v1.2.1  [audio_plus]
Automated Commands  v1.4  [automatedcommands]
Autosave  v1.2b  [lw_autosave]
Better Colonies  v1.88  [timid_admins]
Better Variants  v1.4.0  [better_variants]
BigBeans Ship Compilation  v0.1.98.4  [BSC]
Brighton Federation  v0.0.3c  [HMI_brighton]
Captain's Log  v0.2.0  [CaptainsLog]
Carter's Freetraders  v2.1.0  [CFT]
Carter's Junk Hull Mods  v0.9.1  [CJHM]
Combat Chatter  v1.14.1  [chatter]
Commissioned Crews  v1.999999gggg  [timid_commissioned_hull_mods]
Console Commands  v2023.5.05  [lw_console]
Console Galaxy  v2.0.4  [consolegalaxy]
Crew Replacer  v0.7.0  [aaacrew_replacer]
Detailed Combat Results  v5.4.0  [DetailedCombatResults]
Emergent Threats: IX Revival  v0.6.4  [EmergentThreats_IX_Revival]
Emergent Threats  v0.6.4  [EmergentThreats_Vice]
Fleet Journal  v1.1.2  [fleet_journal]
Fleet Size By DP  v1.0.2b  [fleetsizebydp]
Grand.Colonies  v2.0.e  [GrandColonies]
zz GraphicsLib  v1.9.0  [shaderLib]
Hazard Mining Incorporated  v0.3.7b  [HMI]
HMI Supervillains  v0.0.4e  [HMI_SV]
Hyperdrive  v2.5.2  [sun_hyperdrive]
Illustrated.Entities  v1.2.b  [illustrated_entities]
Industrial.Evolution  v3.3.e  [IndEvo]
Interesting Portraits Pack  v1.2  [interestingportraitspack]
Interstellar Imperium  v2.6.4  [Imperium]
Iron Shell  v1.18.3aj  [timid_xiv]
Junk Yard Dogs  v3.2.0  [JYD]
LazyLib  v2.8b  [lw_lazylib]
Leading Pip  v1.9.3  [leadingPip]
Logistics Notifications  v1.4.5  [logisticsNotifications]
Luddic Enhancement IED  v1.2.6a  [luddenhanceied]
Luddic Enhancement  v1.2.6e  [luddenhance]
LunaLib  v1.8.4  [lunalib]
MagicLib  v1.4.3  [MagicLib]
Marvelous Personas  v1.2.1  [Marvelous-Personas]
Mayasuran Navy  v11.0.0 RC1  [Mayasuran Navy]
Missile Ship Overhaul  v1.2.7  [MissileShipOverhaul]
Missing Names Mod  v0.7  [Missing Names Mod]
More HullMods  v1.12.0  [more_hullmods]
Music Switcher  v1.1  [Music_Switcher]
Nexerelin  v0.11.1x  [nexerelin]
Officer Extension  v0.6.7  [officerExtension]
 Phillip Andrada: Gas Station Manager  v1.14.1  [PAGSM]
Planet Search  v1.2.2  [planet_search]
Planetary Shield: Access Control  v1.6  [wyv_planetaryShieldAccessControl]
PMMM  v1.6.1  [PirateMiniMegaMod]
Portrait Changer  v1.0.1  [portrait_changer]
Progressive S-Mods  v1.0.0  [progressiveSMods]
QoL Pack  v1.2  [pt_qolpack]
Quality Captains  v1.6.1  [QualityCaptains]
Random Assortment of Things  v2.2.0  [assortment_of_things]
zzz Mikohime Additionals Settings  v1.1.1  [Rouge_Redstar]
Ruthless Sector  v1.6.1  [sun_ruthless_sector]
Salvage Ship Expansion  v0.4.5  [salshiexp]
ScalarTech Solutions  v0.9.1  [scalartech]
Scan Those Gates  v1.5.7  [scan_those_gates]
Ship Browser  v1.1  [bruh_ship_browser]
Ship/Weapon Pack  v1.15.1  [swp]
Special Hullmod Upgrades  v1.5  [mayu_specialupgrades]
SpeedUp  v1.0.1  [speedUp]
Starship Legends  v2.5.2  [sun_starship_legends]
Stellar Networks  v3.1.3  [stelnet]
Supply Forging  v1.5a  [timid_supply_forging]
System Marker  v0.1.8  [System_Marker]
Tahlan Shipworks  v1.2.6  [tahlan]
Terraforming & Station Construction  v9.0.8  [Terraforming & Station Construction]
The Knights of Ludd  v1.1.1  [knights_of_ludd]
Too Much Information  v0.98a  [timid_tmi]
Truly Automated Ships  v1.2.5  [TrulyAutomatedShips]
Underworld  v1.8.3  [underworld]
United Aurora Federation  v0.7.5c  [uaf]
Unknown Skies  v1.0.11  [US]
Utility Console Commands  v1.0.0  [Shark_utilityconsole]
Variants Lib  v0.5.2  [variants_lib]
VIC  v1.6.3a  [vic]
Weapon Arcs  v1.7.2  [WEAPONARCS]
Which-Industry  v1.0.0  [which_industry]
WhichMod  v1.2.0  [whichmod]
WhichTMI  v1.2.0  [whichtmi]

Yeah let's not talk about the obvious long list okay. :p

9
Hello,

I'm getting crash to desktop with the following error:

Code
ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException: Cannot invoke "java.awt.Color.getRed()" because "<local12>" is null
java.lang.NullPointerException: Cannot invoke "java.awt.Color.getRed()" because "<local12>" is null
        at com.fs.graphics.super.C._o00000(Unknown Source) ~[port.common_obf.jar:?]
        at com.fs.graphics.super.C.super(Unknown Source) ~[port.common_obf.jar:?]
        at com.fs.graphics.super.C._o00000(Unknown Source) ~[port.common_obf.jar:?]
        at com.fs.graphics.super.C.String(Unknown Source) ~[port.common_obf.jar:?]
        at com.fs.starfarer.ui.d.___o0000(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.ui.d.render(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.ui.o000.renderImpl(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.ui.thissuper.render(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.ui.o000.renderImpl(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.ui.impl.StandardTooltipV2.renderImpl(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.ui.thissuper.render(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.campaign.comms.C.renderImpl(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.ui.thissuper.render(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.ui.o000.renderImpl(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.campaign.comms.super.renderImpl(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.ui.thissuper.render(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.ui.o000.renderImpl(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.ui.thissuper.render(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.campaign.CampaignState.render(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.BaseGameState.traverse(Unknown Source) ~[port_obf.jar:?]
        at com.fs.state.AppDriver.begin(Unknown Source) ~[port.common_obf.jar:?]
        at com.fs.starfarer.combat.CombatMain.main(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.StarfarerLauncher.super(Unknown Source) ~[port_obf.jar:?]
        at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source) ~[port_obf.jar:?]
        at java.base/java.lang.Thread.run(Thread.java:1575) [?:?]

I have traced it down to this option
"Ruthless Sector>Factions>Maximum Reputation Loss" if set to 1, then CDT guaranteed within next few days.


Thanks.

10
Every so often I crash after winning a station defense mission and I'd like some help figuring out the issue, if someone can make better sense of the log then I do;

Quote
24965754 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
   at data.scripts.hullmods.acs_frigate_on_hangar.isApplicableToShip(acs_frigate_on_hangar.java:101)
   at progsmod.data.campaign.rulecmd.ui.plugins.HullModSelector.disableUnapplicable(HullModSelector.java:214)
   at progsmod.data.campaign.rulecmd.ui.plugins.HullModSelector.update(HullModSelector.java:115)
   at progsmod.data.campaign.rulecmd.PSM_BuildInHullModNew$SelectorContainer.updateAll(PSM_BuildInHullModNew.java:321)
   at progsmod.data.campaign.rulecmd.ui.plugins.HullModSelector.updateItems(HullModSelector.java:109)
   at progsmod.data.campaign.rulecmd.ui.plugins.HullModSelector.init(HullModSelector.java:100)
   at progsmod.data.campaign.rulecmd.PSM_BuildInHullModNew$1.createCustomDialog(PSM_BuildInHullModNew.java:187)
   at com.fs.starfarer.ui.newui.oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.<init>(Unknown Source)
   at com.fs.starfarer.ui.newui.o0Oo.showCustomDialog(Unknown Source)
   at progsmod.data.campaign.rulecmd.PSM_BuildInHullModNew.createPanel(PSM_BuildInHullModNew.java:120)
   at progsmod.data.campaign.rulecmd.ui.plugins.ShipSelector.onSelected(ShipSelector.java:37)
   at progsmod.data.campaign.rulecmd.ui.plugins.Selector.checkIfModified(Selector.java:111)
   at progsmod.data.campaign.rulecmd.ui.plugins.Selector.buttonPressed(Selector.java:70)
   at com.fs.starfarer.ui.newui.I.actionPerformed(Unknown Source)
   at com.fs.starfarer.ui.o0O0.buttonPressed(Unknown Source)
   at com.fs.starfarer.ui.int.Ò00000(Unknown Source)
   at com.fs.starfarer.ui.int.processInput(Unknown Source)
   at com.fs.starfarer.ui.o0O0.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.thissuper.processInput(Unknown Source)
   at com.fs.starfarer.ui.o000.dispatchEventsToChildren(Unknown Source)
   at com.fs.starfarer.ui.o000.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.thissuper.processInput(Unknown Source)
   at com.fs.starfarer.ui.o000.dispatchEventsToChildren(Unknown Source)
   at com.fs.starfarer.ui.o000.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.impl.StandardTooltipV2.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.thissuper.processInput(Unknown Source)
   at com.fs.starfarer.ui.g$Oo.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.thissuper.processInput(Unknown Source)
   at com.fs.starfarer.ui.o000.dispatchEventsToChildren(Unknown Source)
   at com.fs.starfarer.ui.o000.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.g.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.thissuper.processInput(Unknown Source)
   at com.fs.starfarer.ui.o000.dispatchEventsToChildren(Unknown Source)
   at com.fs.starfarer.ui.o000.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.newui.I.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.thissuper.processInput(Unknown Source)
   at com.fs.starfarer.ui.o000.dispatchEventsToChildren(Unknown Source)
   at com.fs.starfarer.ui.o000.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.thissuper.processInput(Unknown Source)
   at com.fs.starfarer.E.I.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.thissuper.processInput(Unknown Source)
   at com.fs.starfarer.ui.o000.dispatchEventsToChildren(Unknown Source)
   at com.fs.starfarer.ui.o000.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.O.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.newui.oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.thissuper.processInput(Unknown Source)
   at com.fs.starfarer.ui.o000.dispatchEventsToChildren(Unknown Source)
   at com.fs.starfarer.ui.o000.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.O.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.newui.o0Oo.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.thissuper.processInput(Unknown Source)
   at com.fs.starfarer.ui.o000.dispatchEventsToChildren(Unknown Source)
   at com.fs.starfarer.ui.o000.processInputImpl(Unknown Source)
   at com.fs.starfarer.ui.thissuper.processInput(Unknown Source)
   at com.fs.starfarer.campaign.CampaignState.processInput(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.super(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:748)

I got you covered bud,
By sheer fluke, this caught my eye and I know the fix.

Ruthless Sector:


11
is it safe to add mid save?
Yes.
safe to add mid save but not remove

12
v2.0.1
Changes for version v2.0.1
===========================
Title: Release Candidate v2.0.1

Commits:
Code
fix: code refactor
fix: removed old redundant entries
fix: minimized the scope of the mod for better end experience
fix: removed broken or half finished code entries
bug: extensive bug fixing to remove crashes, should be stable now for main game
docs: GitHub actions overhaul to make the release cycle smoother and error checking.

feat: fully supports Tri-OS mod Manager

deprecated: Incompatible with Original

>By: Anexgohan
>Hash: ff9b531
>Date: 2024-05-02 07:28:36 +0530

----------------------------------------------
Latest Download: https://github.com/Anexgohan/ConsoleGalaxy/releases/latest/download/ConsoleGalaxy.zip

**Full Changelog**: https://github.com/Anexgohan/ConsoleGalaxy/compare/v1.2.22...v2.0.0

13
<reserved>

14
Mods / [0.97a] Console Galaxy v2.0.8 - Pheonix (released 2024-05-19)
« on: April 28, 2024, 06:15:21 AM »

All releases are tested and working in Starsector v0.97a.RC11

This mod is a fork:
Spoiler
"[0.95a] Explore the Galaxy 1.2.3"
https://fractalsoftworks.com/forum/index.php?topic=21800.0
[close]
Not compatible with original "Explore the Galaxy"

Search for your ideal system with the Console Commands, easy to use:

Commands:

1. Explore [all] [exclude/include] [hazard] [gate] [stableloc] [jumppoint] [planets] [conditions]
    Searches all star systems for specified conditions:
    - all - write `all` to search even planets you haven't surveyed yet (default doesn’t search, if searched, sets survey level to full);
    - exclude/include - write `exclude/include` to exclude or include systems in the Core world and claimed systems (default: exclude)
    - planets - the minimum number of planets a system must include (default: planets=1)
    - gate - write `gate` to filter by systems that have a gate;
    - stableloc - write `stableloc=NUMBER` to filter by stable locations (default 0);
    - jumppoint - same as stableloc (default 0);
    - hazard - write `hazard=NUMBER` to filter by systems which planets are below or equal to the specified value (doesn’t filter by default);
    - [conditions] - a comma-separated, no-space list of planetary conditions that must be met (supports * as a wildcard), e.g.: \[habitable=2,rare_ore*=1,*abundant=1] at least TWO habitable planets and ONE with transplutonic ore and ONE with ore/transplutonic ore that is abundant.

Example:
Code
explore all exclude planets=5 [habitable=2,rare_ore*=1,volatile*=1,very_hot=1] hazard=200 gate

this finds all the systems in the galaxy that have at least 5 planets, excluding core/claimed worlds, further filtering the planets by at least 2 habitable and the entire system must not have any planets above 200 hazard rating and must have a gate in the system.

The [conditions] inside the brackets indicate specific conditions for the planets in the systems you want to explore:
habitable=2: Only include systems where there are 2 habitable planets.
rare_ore*=1: Only include systems where there is at least 1 planet with rare ores.
volatiles_plentiful=1: Only include systems where there is at least 1 planet with plentiful volatiles.
very_hot=1: Only include systems where there is at least 1 very hot planet.

2. SystemInRange <entity>[entity] [LY] [planets]
    Finds systems in specified range (integer) of an entity (coronal_tap, derelict_cryosleeper, inactive_gate):
    - if two entities are listed coronal_tap,cryosleeper, a table will be shown at the end listing systems within range of both;
    - LY - distance in light years (default is 10);
    - planets - filters by number of planets

Example: SystemInRange coronal_tap,cryosleeper 10

Change log:
Spoiler
v1.0.0a
Initial release
[close]

15
Modding Resources / Re: VSCode setup for Starsector modding (2024)
« on: April 28, 2024, 03:29:59 AM »
Bonus:
Create a local latest.zip of your mod on windows
If you are publishing your mod I would suggest github actions instead to auto-create latest.zip upon push.

Make a file in your mod folder called "make-latest-zip.bat"
paste the following in it:
Spoiler
Code
@echo off
setlocal enabledelayedexpansion

::     "version": { "major":"0", "minor": "2", "patch": "9f" },, "minor": "2", "patch": "9f" },
:: Set the input and 7zip directories
set "sevenZip=C:\Program Files\7-Zip\7z.exe"
set "sourceDir=D:\Games\Space-4x\Starsector-mod-dev\mods\Explore the Galaxy"
set "modsDirectory=D:\Games\Space-4x\Starsector-mod-dev\mods\Explore the Galaxy\output"

:: get the name of the mod from the sourceDir
:: for %%i in ("!sourceDir!") do set "modName=%%~nxi"

set "mod_info-filePath=!sourceDir!\mod_info.json"
:: if the above file is not fount prompt user and exit the script with any key
if not exist "%mod_info-filePath%" (
    echo File not found: %mod_info-filePath%
    pause
    exit /b
)

:: there are multiple lines in mod_info-filePath with the format "name": "*.*", save the first line to a variable
for /f "delims=" %%i in ('findstr /C:"name" "%mod_info-filePath%"') do (
    set "nameLine=%%i"
    goto :break
)
:break
:: Extract everything after ["name":] and save it to a variable "modFolderName"
for /f "tokens=2 delims=:," %%i in ("!nameLine!") do set "modFolderName=%%i"
:: remove the quotes from the variable
set "modFolderName=!modFolderName:"=!"

REM set "modFolderName=!modFolderName:~1,-1!"

:: remove the first and last space from the variable, do not delete the spaces in the middle or any characters
for /f "tokens=*" %%i in ("!modFolderName!") do set "modFolderName=%%i"

:: echo Mod folder name:!modFolderName!

:: Search for the string and save it to a variable
for /f "delims=" %%i in ('findstr /C:"version" "%mod_info-filePath%"') do set "versionLine=%%i"
:: Display the result
:: echo !versionLine!

:: Extract the version number from the string and save it to separate variables
:: tokens define the parts of the string to extract
for /f "tokens=4,6,8 delims=:, " %%i in ("!versionLine!") do (
    set "major=%%i"
    set "minor=%%j"
    set "patch=%%k"
)
:: remove the quotes from the variables
set "vMajor=!major:"=!"
set "vMinor=!minor:"=!"
set "vPatch=!patch:"=!"
:: set a variable to the version number with the format "Explore the Galaxy-major.minor.patch"
set "versionFormat=!modFolderName!-!vMajor!.!vMinor!.!vPatch!"
:: display mod info taken from the mod_info-filePath file
echo.
echo    Mod Name: "!modFolderName!"
echo    Version:
echo    Major: "!vMajor!" Minor: "!vMinor!" Patch: "!vPatch!"
echo    Mod Folder will be created as: "!versionFormat!"

:: Set the output and extract directories using the modName
set "outputDir=%modsDirectory%\zip\!versionFormat!.zip"
:: set outputDirVar to the outputDir without the !versionFormat!.zip
set "outputDirVar=%modsDirectory%\zip"
set "extractDir=%modsDirectory%\!versionFormat!"


:: print multiple lines of text to the console\
echo _______________________________________________________________
echo    Source Directory:
echo    "%sourceDir%"
echo _______________________________________________________________
echo.
echo    This will create the zip file in a temporary folder:
echo    "%outputDir%\%versionFormat%.zip"
echo    this temporary folder will be deleted after extraction
echo _______________________________________________________________
echo.
echo    zip file will be extracted to the mods folder:
echo    "%extractDir% "
echo    with the folder name "%versionFormat%"
echo _______________________________________________________________
echo.
echo    any folder with the name : "%versionFormat%" or matching "!modFolderName!-*.*.*" will be deleted
echo _______________________________________________________________
echo.
set /p userInput=" Press Enter to continue..."

:: delete the extractDir if it exists
if exist "%extractDir%" rd /s /q "%extractDir%"
:: delete any folder in "modsDirectory" that matches "modFolderName-*.*.*"
for /d %%i in ("%modsDirectory%\!modFolderName!*") do rd /s /q "%%i"

:: use the 7zip command to create a zip file from the source directory, files and folders are defined below:
"%sevenZip%" a -tzip -bb1 "%outputDir%" "%sourceDir%\data" "%sourceDir%\graphics" "%sourceDir%\jars" "%sourceDir%\sounds" "%sourceDir%\src" "%sourceDir%\mod_pictures" "%sourceDir%\exploration.version" "%sourceDir%\mod_info.json" "%sourceDir%\icon.png"
"%sevenZip%" x -bb0 "%outputDir%" -o"%extractDir%"
:: set the size of the zip file and the extracted directory
for %%A in ("%outputDir%") do set "size=%%~zA"
set /a "sizeMB=%size% / 1024 / 1024"
set /a "sizeRemainder=%size% %% (1024 * 1024) * 1000 / (1024 * 1024)"
echo Size of the zip file is %sizeMB%.%sizeRemainder% MB

:: set the size of the extracted directory and display it
for /r "%extractDir%" %%A in (*) do set /a "dirSize+=%%~zA"
set /a "dirSizeMB=%dirSize% / 1024 / 1024"
set /a "dirSizeRemainder=%dirSize% %% (1024 * 1024) * 1000 / (1024 * 1024)"
echo Size of the extracted directory is %dirSizeMB%.%dirSizeRemainder% MB

:: delete the "outputDirVar" if it exists
@REM if exist "%outputDirVar%" rd /s /q "%outputDirVar%"

:: Initialize a counter
set /a "count=0"

:: Loop over the .zip files in reverse date order
for /f "delims=" %%A in ('dir /b /o-d /a-d "%outputDirVar%\*.zip"') do (
    :: Increment the counter
    set /a "count+=1"

    :: Skip the first file (the latest .zip file)
    if !count! gtr 1 (
        :: Delete the file
        del "%outputDirVar%\%%A"
    )
)

endlocal
pause
[close]

Edit the following lines to suit your needs:
location of 7zip.exe
Code
set "sevenZip=C:\Program Files\7-Zip\7z.exe"
your mods working folder
Code
set "sourceDir=D:\Games\Space-4x\Starsector\mods\mymod"
folder where mod and zip will be extracted to
Code
set "modsDirectory=D:\Games\Space-4x\Starsector\mods\mymod\output"

under this you can pass the folders and files names that you want included in you mod zip
search for this line or goto line 97
Code
:: use the 7zip command to create a zip file from the source directory, files and folders are defined below:
Code
"%sevenZip%" a -tzip -bb1 "%outputDir%" "%sourceDir%\data" "%sourceDir%\graphics" "%sourceDir%\jars" "%sourceDir%\src" "%sourceDir%\mod_info.json" "%sourceDir%\icon.png"
to add any folder
"%sourceDir%\<foldername>"
to add any file
"%sourceDir%\<filename.txt>"

Note:
You must have a "mod_info.json" in your "sourceDir"
with the following syntax, you are free to change the numbers as you like
"version": { "major": "1", "minor": "0", "patch": "0" },

Pages: [1] 2 3 ... 6