Fractal Softworks Forum

Starsector => Mods => Modding Resources => Topic started by: SafariJohn on November 20, 2018, 07:48:05 PM

Title: [0.95.1a] SafariJohn's Rules Tool v2.4.0
Post by: SafariJohn on November 20, 2018, 07:48:05 PM
(https://i.imgur.com/6wU07L5.png)
SafariJohn's Rules Tool
version 2.4.0
Download (https://github.com/SafariJohn/Rules-Tool/raw/main/SRT%202.4.0.zip)
Source Code (https://github.com/SafariJohn/Rules-Tool/raw/main/SRT%202.4.0%20src.zip)

Ever took a glance in rules.csv and NOPED right back out? Well no more! With this tool you can easily view, create, and edit rules to your heart's content. Consult the readme's Getting Started section if you have any trouble figuring things out.

Please report any bugs you find either here or on the Unofficial Starsector Discord (mention me @SafariJohn#5061).

This program does not officially support Mac. However, it should work correctly if run from the command line - see the readme's Installation section.

Spoiler
(https://i.imgur.com/SCleFBQ.png)
[close]

What people have said about SRT:
Okay so I already can't work on rules without this tool, so thanks for that! -Tartiflette

This is really good. rules.csv is a real pain to navigate using normal spreadsheet editors and I look forward to being able to work with it using a more user-friendly tool. -Inventor Raccoon

When Rules were introduced, I remember having to code around that.
This is a big improvement, merely being able to parse through Rules without too much mess and being able to see the relationships clearly.
-xenoargh

Great work, very intuitive.
Able to refactor and reorganise very quickly, maybe won't be chugging milk through my nostrils before 40.
-Armithaig

HOLY ***
never letting John's editor go, ever
I just saw my whole modding life improving drastically
-joaonunes


Changelog:
Version 2.4.0
 New Stuff:
 - Vanilla rules updated to 0.95.1a!
 - Completely identical rules are now highlighted orange.
   - Other rules with the same ID are still highlighted red.
   
 Bug Fixes:
 - An error message is now displayed when a ruleset's json file is malformed.
 - Fixed drag and drop not working for commands on the conditions panel.

Spoiler
Version 2.3.0
 New Stuff:
 - Vanilla rules updated to 0.95a!
 - Added Command support!
   - Let's you define the inputs to your commands so you don't have to try to remember them.
 - Automatically detected triggers and variables are now discarded when you save if they are unused.
 - Increased refresh speed for rules tree and data tabs.
 
 Changes:
 - The shortcut for Close Ruleset is now Ctrl-W.
 - Hopefully clarified the error message when rules.csv file has the wrong number of columns.
 
 Bug Fixes:
 - Massively reduced RAM usage:
   - Patched a memory leak in the spellchecker.
   - Optimized VM options.
 - Fixed freezes when selecting a text field.
 - Replaced error logging when logger failed to initialize (lol) with error popup.
 - Fixed OutOfBounds error when replacing multiple search results with a smaller string.
 - Fixed overwrite prompt appearing every time you saved.
 - Fixed copying rules with drag and drop not updating id overlap highlights.
 - Fixed searching so it detects slightly offset repeating patterns.


Version 2.2.0
 New Stuff:
 - Changed the new rule and new directory buttons to work by a single click (and they are now keyboad-friendly). The new rule/directory is added to the active directory or the directory of the active rule.
 - SRT's icon now shows up in the task bar, etc. instead of Java's icon.
 - Ruleset root directories now show the expand/collapse icon.
 
 Bug Fixes:
 - Reduced RAM usage.
 - Fixed bug with backing up directories that could invalidate the tree structure.
 - Fixed bug with Ctrl-Z when only the rules tree had been modified.
 - Fixed bug that prevented clearing fields in the Summary tab.
 - Fixed text replacement only working for the script field.
 - Fixed text replace garbling when replacement was longer than original.
 - Fixed tree selection changing from a directory to its parent under certain circumstances when collapsing it with the arrow keys.
 - Fixed bugs when loading CSVs while Safe Mode is enabled.
 - Fixed overwrite dialog appearing on every startup in certain cases.
 - Fixed bug when overwriting a loaded ruleset.
 - Reduced slowdown when rapidly changing the tree selection or expanding/collapsing folders.
 - Fixed freezing when typing into text fields, such as holding down a key.
 - Fixed a silent crash; the spellchecker library was compiled in Java 8 instead of 7.


Version 2.1.1
 Bug Fixes:
 - Fixed a save bug with newlines inside quotation marks.


Version 2.1.0
 New Stuff:
 - Added logging.
 
 Bug Fixes:
 - Fixed a minor settings failure when the active spellchecking language's dictionary can't be found.
 - Fixed rulesets duplicating vanilla triggers/commands/variables.

 
Version 2.0.1
 Bug Fixes:
 - Fixed trigger/command/variable duplication on load.
 - Fixed silent failure when trying to open a SRT-generated rules.csv file without a corresponding rulesets/NAME.json file.


Version 2.0.0
 New Stuff:
 - Simplified loading/saving. SRT now saves your changes directly to your rules.csv!
   - Use the Convert option in the File menu to convert your pre-2.0 data.
 - Added find & replace!
 - Added spellchecking!
 - You can now edit the included vanilla rules.
 - Editing has been enabled on the Summary tab.
 - Added Safe Mode, which protects your original rules.csv from in-progress changes.
 - Lowered minimum supported resolution from 1024x768 to 800x600.
 - Selecting a rule to edit is once again a single click.
 - SRT-generated CSV files now have #END lines marking the end of folders.
 
 Bug Fixes:
 - Added a confirmation dialog if you try to save a ruleset with the same name as another.
 - Fixed a save bug when a folder has a comma in its name.
 - The rules tree now focuses on the selected rule when changed from elsewhere.
 - Old files left when a ruleset is renamed are now cleaned up automatically.


Version 1.1.0
 New Stuff:
 - Updated vanilla rules to 0.9.1a.
 - The enter key can now be used in the rules tree to select a rule/folder for editing.
 
 Bug Fixes:
 - Copy/Paste now works in Dialog Options text box.
 - Collapsing a rules tree folder that contains the active rule/folder using the arrow keys sets it as the active rule/folder.
 - Fixed an infinite loop when trying to save to a non-existent directory.
 
 
Version 1.0.1
 New Stuff:
 - Can now cancel when exiting the program or closing a rule set.
 
 Bug Fixes:
 - Undo/Redo now works for the root folder of rule sets.
 - Now remembers a rule set between sessions if you change its name but don't save the change.
 - The Exit button in the File menu now exits correctly.


Version 1.0.0
 New Stuff:
 - To change which rule you are editing, you must now double-click the rule you want to edit.
 - Forcing/Blocking linked rules can now be done from the main interface. Drag rules from the rules tree to force them; select rules on the right and hit delete to block them.
 - Minor improvements to linked rules detection.
 - Close [Rule Set] menu button now has a shortcut: ctrl-b.

 Bug Fixes:
 - Fixed potential bug in trigger/command/variable drag-and-drop code.
 - Fixed typo - triggers now load correctly.
 - Moved vanilla "Remnant battlestation", "SALVAGE", and "CARGO PODS" folders out of "Smuggling investigation inspector" folder.
 - Double clicking a linked rule now changes the selection in the rules tree, as you would expect.


Version 0.3.0
 New Stuff:
 - Now officially supports Linux!

 Bug Fixes:
 - Opening rule sets in Linux now properly respects file order. (Thanks, Armithaig!)
 - Opening/saving/importing/exporting consistently use UTF-8 now. For example, Chinese will work correctly.


Version 0.2.0
 - Initial release for 0.9a.
[close]
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: SafariJohn on November 20, 2018, 07:48:18 PM
If anyone is familiar with distributing Java programs like this to Mac and/or Linux, could you please give me some pointers? I only have Windows, which makes it difficult to figure out.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: Inventor Raccoon on November 21, 2018, 02:22:02 PM
This is really good. rules.csv is a real pain to navigate using normal spreadsheet editors and I look forward to being able to work with it using a more user-friendly tool.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: Morrokain on November 22, 2018, 11:57:37 AM
Thank you for this!

I am going to try this out tonight but it will make my life a lot easier :)

I use Rules very heavily in my TC.

Question: does it support bulk rule creation/cloning of similar type? (So I can clone a bunch of rules and then add single parameter checks for things like reputation, personality or faction)

It would be beyond helpful if it could scope into a library of accepted commands too. I usually have to reverse-engineer existing rules and carefully examine local memory dumps to create the in-game behaviors I need to.


For instance: Getting fleets to back down universally in every situation is a real pain. A lot of entity behaviors override the nonHostile boolean so you have to explicitly disable every single one for my ceaseFire script. I still haven't run into them all, I'm sure. The only way to catch it is to have the script fail, then check the memory to find out why when I recreate it. :P
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: Originem on November 22, 2018, 06:51:58 PM
Can it just edit the existing file? It's somewhat troublesome to import and export.
And, the editor seems not support Chinese characters well(some become ??), can it be fixed?
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: SafariJohn on November 23, 2018, 06:31:52 AM
Question: does it support bulk rule creation/cloning of similar type? (So I can clone a bunch of rules and then add single parameter checks for things like reputation, personality or faction)

You can copy rules by holding control when you drag and drop them on the left side. I probably can't fit more advanced manipulations into the UI, but the rules are stored as a hierarchy of .jsons in the "rules" folder so you can use a batch file or whatever you like there.

It would be beyond helpful if it could scope into a library of accepted commands too. I usually have to reverse-engineer existing rules and carefully examine local memory dumps to create the in-game behaviors I need to.

For instance: Getting fleets to back down universally in every situation is a real pain. A lot of entity behaviors override the nonHostile boolean so you have to explicitly disable every single one for my ceaseFire script. I still haven't run into them all, I'm sure. The only way to catch it is to have the script fail, then check the memory to find out why when I recreate it. :P

I'm not sure what you're asking for here.


Can it just edit the existing file? It's somewhat troublesome to import and export.

Exporting is exactly like direct-edit saving would be, and you should only have to import once per mod. What exactly is causing you trouble?

And, the editor seems not support Chinese characters well(some become ??), can it be fixed?

I think it can be fixed, but I'm not sure. I will look into it.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: MShadowy on November 24, 2018, 10:55:26 AM
A, this is neat. B, holy crap this is slow as hell. The program starts to lag real fast. Still very handy, but only usable over short periods. Maybe it's a linux/open jdk thing.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: SafariJohn on November 24, 2018, 11:21:11 AM
A, this is neat. B, holy crap this is slow as hell. The program starts to lag real fast. Still very handy, but only usable over short periods. Maybe it's a linux/open jdk thing.

Weird, it should run pretty lightly. I take it it's eating up memory? Hopefully it's just a memory leak I can run down and not, as you say, a "linux/open jdk thing".
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: MShadowy on November 24, 2018, 11:58:04 AM
According the process log, it's only using about 244 MiB, so it is pretty lightweight.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: SafariJohn on November 24, 2018, 06:05:10 PM
According the process log, it's only using about 244 MiB, so it is pretty lightweight.

That memory usage is 50% higher than I can max it out at on Windows while having vanilla loaded twice + some mods' rules sets. (No sign of a memory leak, thank goodness.)

I suspect the JDK may be your problem. I've seen a lot of advice that says don't run programs with a JDK. Please try running it with a JRE and see if you still have slowdown.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: Tartiflette on November 25, 2018, 04:00:34 AM
Okay so I already can't work on rules without this tool, so thanks for that! But I may have a pair of requests:
Would it be possible to copy whole sections of rules from vanilla (or mods) to another mod? Like the whole default "getting a faction commision" section of vanilla.

Can we have a "reload" button to get edits to the rules.csv done by hand? For example after copy-pasting the mentioned rules from vanilla I have to close the rules AND delete the whole folder from your tool then reload it to get the changes. Not really practical.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: SafariJohn on November 25, 2018, 09:28:50 AM
Okay so I already can't work on rules without this tool, so thanks for that!

That's high praise, thank you.

Would it be possible to copy whole sections of rules from vanilla (or mods) to another mod? Like the whole default "getting a faction commision" section of vanilla.

Select all the rules/folders you want on the left (can include vanilla rules), pick them up, and hold control when you drop them (the mouse will show a little + sign). It will copy them to the given spot.

Can we have a "reload" button to get edits to the rules.csv done by hand? For example after copy-pasting the mentioned rules from vanilla I have to close the rules AND delete the whole folder from your tool then reload it to get the changes. Not really practical.

I thought about doing that and decided not to, but I'll reconsider. Hopefully you don't need it now, given the above answer.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: Armithaig on November 27, 2018, 10:32:21 AM
Great work, very intuitive.
Able to refactor and reorganise very quickly, maybe won't be chugging milk through my nostrils before 40.

However, does not seem to preserve order of files when reloading. Screenshot (https://i.imgur.com/DpPlGIr.png).
This is for every file, not just the top directory. Little heartbreak after happily shuffling my rules in order.

Linux specific issue perhaps, someone else can confirm.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: SafariJohn on November 27, 2018, 10:50:11 AM
I'm sorry you're having some trouble. To be sure: did you manually save after reordering your rules? If you didn't it should have asked you if you wanted to save when you exited; did you make sure your rule set was checked and that you clicked Save and Exit?

SRT clearly has write permission on your system, so that's not the problem. It should have given you an error message if it failed to overwrite/delete files; you didn't see anything like that?


Worst case: you can reorder the folders and files manually until I figure out what is causing the problem and release a fixed version.


Edit: Not related to the above I think, just curiosity, are you using WINE or running SRT natively on Linux?
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: Armithaig on November 27, 2018, 11:27:48 AM
Added to openFolder(), openFolderRecursive().
Code
files.addAll(Arrays.asList(rootDirectory.listFiles()));
Collections.sort(files); // Sort file collection.

Do not believe listFiles() guarantees any order so have to be sorted somehow, handling files is always weird between OS', Windows gave you in order I suppose.
Works now (https://i.imgur.com/w2Gj36h.png).

Running it natively, just added SRT.sh with this to folder.
Code
java -jar ./bin/SRT.jar

But really doesn't save much typing.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: SafariJohn on November 27, 2018, 12:09:26 PM
Added to openFolder(), openFolderRecursive().
Code
files.addAll(Arrays.asList(rootDirectory.listFiles()));
Collections.sort(files); // Sort file collection.

Do not believe listFiles() guarantees any order so have to be sorted somehow, handling files is always weird between OS', Windows gave you in order I suppose.
Works now (https://i.imgur.com/w2Gj36h.png).


Awesome! Thank you for finding that. I suspect it would have taken me a long while. The next version will include your fix.

Running it natively, just added SRT.sh with this to folder.
Code
java -jar ./bin/SRT.jar

But really doesn't save much typing.

That is simpler than I thought. So if I understand this correctly, a .zip for Linux would just replace the SRT.exe with SRT.sh; otherwise identical to Windows? Been a while since I've done anything with Linux.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.2.0)
Post by: Armithaig on November 27, 2018, 12:50:04 PM
No trouble, project's pretty well organised.

Some java applications bundle the JRE they're built against in case it can't be found on the target machine, Starsector's in ./jre_linux, but's ~130mb by default for 1.7.
Not reasonable for smaller apps. Modding Starsector, they'll have Java installed anyhow. Simple shell file will be fine.

Linux version of this game also runs through a shell file, but slightly different approach. Some hotspot VM options, -classpath with all the jars to reference, defines some paths and then shoves it on with com.fs.starfarer.StarfarerLauncher.

EDIT: Shot pull request your way. Added directory conditions.
Spoiler
(https://i.imgur.com/D1zZgMz.png)
[close]

Only works one way currently (export), will get around to muffin' with the imports as well but've gotta cook dinner.
Title: Re: [0.9a] SafariJohn's Rules Tool (v0.3.0)
Post by: SafariJohn on December 01, 2018, 10:09:09 AM
New version up! Download in the OP.

Changelog:
Version 0.3.0
New Stuff:
   Now officially supports Linux!

Bug Fixes:
   Opening rule sets in Linux now properly respects file order. (Thanks, Armithaig!)
   Opening/saving/importing/exporting consistently use UTF-8 now. For example, Chinese will work correctly.
Title: Re: [0.9a] SafariJohn's Rules Tool (v1.0.0)
Post by: SafariJohn on January 09, 2019, 09:11:01 AM
Version 1.0! Download in the OP.

As the number implies, SRT is 100% done. I'll fix any bugs that crop up and update for new versions of Starsector, but development on new features will be even more sporadic than it has been.

Changelog:
 New Stuff:
 - To change which rule you are editing, you must now double-click the rule you want to edit.
 - Forcing/Blocking linked rules can now be done from the main interface. Drag rules from the rules tree to force them; select rules on the right and hit delete to block them.
 - Minor improvements to linked rules detection.
 - Close [Rule Set] menu button now has a shortcut: ctrl-b.

 Bug Fixes:
 - Fixed potential bug in trigger/command/variable drag-and-drop code.
 - Fixed typo - triggers now load correctly.
 - Moved vanilla "Remnant battlestation", "SALVAGE", and "CARGO PODS" folders out of "Smuggling investigation inspector" folder.
 - Double clicking a linked rule now changes the selection in the rules tree, as you would expect.
Title: Re: [0.9a] SafariJohn's Rules Tool (v1.0.1)
Post by: SafariJohn on January 19, 2019, 10:13:46 AM
New version - 1.0.1 - patches up some problems. Download in the OP, per usual.

Changelog:
 New Stuff:
 - Can now cancel when exiting the program or closing a rule set.
 
 Bug Fixes:
 - Undo/Redo now works for the root folder of rule sets.
 - Now remembers a rule set between sessions if you change its name but don't save the change.
 - The Exit button in the File menu now exits correctly.
Title: Re: [0.9a] SafariJohn's Rules Tool (v1.0.1)
Post by: Morrokain on February 23, 2019, 10:40:44 AM
I've had some time to extensively use this tool, and thank you so much for making it so easy to add and edit rules!

This greatly reduces my development time to get rules content out there and wow is it useful to find bugs. :)

There were some conflicts I didn't even realize I had until the tool highlighted them for me.


I'd say this tool is now as essential as the Ship Editor for me. The downtime between updates that break the ship editor and the time it takes to get it compatible is truly felt.
Title: Re: [0.9a] SafariJohn's Rules Tool (v1.0.1)
Post by: Morrokain on February 23, 2019, 11:27:12 AM
A request:

Not sure if this is a bug or not, but I would really like to be able to copy paste the "Dialog Options:" field under the "Text" tab.

Not the worst thing to have to type all that out, so no worries if that would be a pain, just figured I'd request it. :)

Great job!
Title: Re: [0.9a] SafariJohn's Rules Tool (v1.0.1)
Post by: SafariJohn on February 23, 2019, 11:59:42 AM
Thanks! I'm glad it's useful.

Not sure if this is a bug or not, but I would really like to be able to copy paste the "Dialog Options:" field under the "Text" tab.

It is a bug. Not sure when I'll get around to fixing it, but I've put it on the todo list.

The downtime between updates that break [the ship] editor and the time it takes to get it compatible is truly felt.

Unlike ship_data.csv, I don't think rules.csv has ever changed, so no worries :)
Title: Re: [0.9a] SafariJohn's Rules Tool (v1.0.1)
Post by: xenoargh on March 13, 2019, 10:55:46 AM
I remember back in the day, having to hack the Dialogs from scratch in Java.  When Rules were introduced, I remember having to code around that. 

This is a big improvement, merely being able to parse through Rules without too much mess and being able to see the relationships clearly.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v1.1.0)
Post by: SafariJohn on May 21, 2019, 10:34:36 AM
Version 1.1.0 updates SRT with 0.9.1's vanilla rules and some other stuff. Download in the OP.

Changelog:
 New Stuff:
 - Updated vanilla rules to 0.9.1a.
 - The enter key can now be used in the rules tree to select a rule/folder for editing.
 
 Bug Fixes:
 - Copy/Paste now works in Dialog Options text box.
 - Collapsing a rules tree folder that contains the active rule/folder using the arrow keys sets it as the active rule/folder.
 - Fixed an infinite loop when trying to save to a non-existent directory.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v1.1.0)
Post by: SafariJohn on July 24, 2019, 05:04:33 PM
I am adding an options menu to SRT. Does anyone have any ideas for options they'd like to see?
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v1.1.0)
Post by: chancoco on July 24, 2019, 05:52:45 PM
I only just started using SRT so there's a lot I don't know about it yet, but could I ask for the option to open rules with a single-click instead of a double-click? I spend a lot of time looking at the rules and how they branch out to get a better idea of how things work. That extra millisecond saved per click adds up.

Fantastic tool btw. Thanks for working on it.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v1.1.0)
Post by: SafariJohn on July 24, 2019, 07:13:11 PM
I only just started using SRT so there's a lot I don't know about it yet, but could I ask for the option to open rules with a single-click instead of a double-click? I spend a lot of time looking at the rules and how they branch out to get a better idea of how things work. That extra millisecond saved per click adds up.

Fantastic tool btw. Thanks for working on it.

Thanks! I've been feeling the double-click delay, too. I might be able to swing single-click, depending on behind-the-scenes stuff.

In the meantime, try using the arrow keys/enter key and see if that feels better.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.0.0)
Post by: SafariJohn on August 05, 2019, 01:07:16 PM
2.0!

That's right, the Rules Tool is now 2.0! This is a big big big update! Streamlined saving/loading, find/replace, spellchecking, and more are all now included!

Download in the OP, see the changelog for details.

Changelog:
 New Stuff:
 - Simplified loading/saving. SRT now saves your changes directly to your rules.csv!
   - Use the Convert option in the File menu to convert your pre-2.0 data.
 - Added find & replace!
 - Added spellchecking!
 - You can now edit the included vanilla rules.
 - Editing has been enabled on the Summary tab.
 - Added Safe Mode, which protects your original rules.csv from in-progress changes.
 - Lowered minimum supported resolution from 1024x768 to 800x600.
 - Selecting a rule to edit is once again a single click.
 - SRT-generated CSV files now have #END lines marking the end of folders.
 
 Bug Fixes:
 - Added a confirmation dialog if you try to save a ruleset with the same name as another.
 - Fixed a save bug when a folder has a comma in its name.
 - The rules tree now focuses on the selected rule when changed from elsewhere.
 - Old files left when a ruleset is renamed are now cleaned up automatically.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.0.0)
Post by: Morrokain on August 10, 2019, 03:47:05 PM
Yay! Just in time for me to use it for my next dev sprint. I'll let you know if any bugs show up!
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.0.1)
Post by: SafariJohn on August 23, 2019, 01:36:21 PM
Found and fixed a couple bugs. Download in the OP.

Changelog:
 Bug Fixes:
 - Fixed trigger/command/variable duplication on load.
 - Fixed silent failure when trying to open a SRT-generated rules.csv file without a corresponding rulesets/NAME.json file.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.0.1)
Post by: xenoargh on August 25, 2019, 11:33:39 AM
I'm getting "a Java exception has occurred" errors on startup with 2.01.

I've already copy-pasted the JRE into the application's base directory, etc.

Does SRT presume Starsector's on the C:/ drive?
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.0.1)
Post by: SafariJohn on August 26, 2019, 02:33:21 PM
Sorry, the forum failed to notify me of your reply.

That's one of Java's error messages, not SRT's, so I would need to know more to have any hope of troubleshooting it.

SRT does not presume what drive you are using; I run it on my D drive. You don't need the JRE in SRT's directory, either, it should detect an installed version on its own.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.0.1)
Post by: xenoargh on August 26, 2019, 05:32:07 PM
Hmm.  The error was generic.  Does it print a log somewhere?
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.0.1)
Post by: SafariJohn on August 26, 2019, 06:19:20 PM
I'm afraid it doesn't. You might be able to tell your JRE to log and that might show something, though.

Anyways, if 2.0.0 worked fine for you, then 2.0.1 should as well.

Some things to check:
- SRT has write permissions for where it is.
- The settings.json and rulesets/[ruleset].json files don't have invalid file paths.
- If you copied a ruleset.json from 2.0.0, make sure it doesn't have any crazy long arrays from the now-fixed duplication bug.
- Finally, see if a clean redownload/install fixes it.

If you've changed anything with your JRE lately, I would look into that, too.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.0.1)
Post by: xenoargh on August 26, 2019, 06:36:19 PM
I'll take a look at the paths; probably something silly like that...
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.0)
Post by: SafariJohn on October 08, 2019, 10:27:26 AM
v2.1.0 released! Download in the OP.

Error logging is the new feature here, and I cleaned up a couple more bugs introduced by 2.0.

Changelog:
 New Stuff:
 - Added logging.
 
 Bug Fixes:
 - Fixed a minor settings failure when the active spellchecking language's dictionary can't be found.
 - Fixed rulesets duplicating vanilla triggers/commands/variables.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.0)
Post by: SafariJohn on October 08, 2019, 06:08:16 PM
The Vanilla.csv was kind of wonky, so I have hotfixed the download to 2.1.0b.

For some reason the salvage and cargo pod rules were in conversation subfolders. ???
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.1)
Post by: SafariJohn on October 10, 2019, 08:03:42 PM
I just discovered that there's a long-standing bug with newline symbols after a quotation mark being converted to text so that it shows up as "\n" in your rules.csv and in-game. Conversion was only supposed to happen for the script column, where each command must be on one line. A true fix is not possible at present, so I've decided to just disable conversion entirely.

That means, when you use a script command like AddText or SetTooltip and want to have multiple paragraphs, you'll have to remember to type "\n" instead of hitting enter. Thankfully, if you forget, the game gives you a helpful "unmatched quotes" error pointing to exactly where you messed up.

Additionally, you will need to fix any mistakenly converted newlines in your rules.csv yourself, which can be done in the Rules Tool (search for "\n" in the find dialog and exclude Scripts from the results).

Please download v2.1.1 in the OP.

Changelog:
Version 2.1.1
 Bug Fixes:
 - Fixed a save bug with newlines inside quotation marks.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.1)
Post by: Morrokain on October 11, 2019, 04:31:47 PM
Thanks I did notice that but wasn't sure if it was me or not (I had thought I typed the wrong slash or something)
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.1)
Post by: xenoargh on January 27, 2020, 01:30:13 AM
I've finally gotten around to this.  Sorry, I've been busy.

It's still throwing a Java Exception on startup, unfortunately.  Where is the log printed to?  I don't see one in the application's directory.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.1)
Post by: SafariJohn on January 27, 2020, 04:04:26 AM
That's where it prints to.

Hrm, starting the log should be the first thing it does, but I see now I've let some other code go first. I'll send you a modified jar to test.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.1)
Post by: Hydra7-1 on April 15, 2020, 12:55:41 PM
not sure if others have this issue but I completely freeze up if I hot backspace and have to shut down from task manager. Besides that this has worked really well for me.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.1)
Post by: SafariJohn on April 15, 2020, 01:21:06 PM
What do you mean "hot backspace"? Using backspace to delete text works fine for me.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.1)
Post by: Hydra7-1 on April 15, 2020, 04:15:30 PM
I meant to type hit, should have double checked.. but when I backspace more than one letter at a time the whole thing freezes up so I have just been selecting what I want and using the delete key.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.1)
Post by: SafariJohn on April 15, 2020, 04:22:17 PM
Everything seems to be working fine on my copy. AFAIK I did not code anything related to backspace, so your problem is either in the backend I am using or on your end. I advise seeing if the issue appears in other programs like Word or Notepad and to try switching to a different keyboard.

Other than that, no idea. Probably not something I can do anything about. Sorry :(
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.1)
Post by: tomatopaste on April 20, 2020, 06:06:50 AM
Having issues using v2.1.1. Editor works as expected until trying to edit the id (i.e. typing into id field) of a newly created rule, after which the program rapidly loses fps and eventually freezes. I'm using windows 10, latest update (afaik), and installed the program into a normal folder on a secondary drive, with it pointing at the mods folder correctly. Didn't appear to be hemorrhaging RAM usage, but I'm not familiar with the program. I'll have to get into rules editing manually now, I guess :P
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.1.1)
Post by: SafariJohn on April 20, 2020, 07:09:28 AM
Typing normally into a field works for me, but if I hold a key down (but not the space bar, strangely) then the program consumes all the CPU time and starts freezing up as described. It did return to normal after a couple seconds, though, so try typing slowly, I guess.

It also looks like the RAM usage is still excessive and there is a known memory not!leak which gradually uses more RAM as you create/load more rules. I had vanilla loaded twice and it was approaching 2 gigs, so browser tab hoarders and people with limited RAM should be wary until I can track down what is using so much memory.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.2.0)
Post by: SafariJohn on May 24, 2020, 03:04:16 PM
v2.2.0 released! Download in the OP.

Focus was on running down bugs and performance issues. If you still have crashes/freezes/slowdowns, or any other problems, please post here or on the Unofficial Starsector Discord (mention me @SafariJohn#5061.

Changelog:
 New Stuff:
 - Changed the new rule and new directory buttons to work by a single click (and they are now keyboad-friendly). The new rule/directory is added to the active directory or the directory of the active rule.
 - SRT's icon now shows up in the task bar, etc. instead of Java's icon.
 - Ruleset root directories now show the expand/collapse icon.
 
 Bug Fixes:
 - Reduced RAM usage.
 - Fixed bug with backing up directories that could invalidate the tree structure.
 - Fixed bug with Ctrl-Z when only the rules tree had been modified.
 - Fixed bug that prevented clearing fields in the Summary tab.
 - Fixed text replacement only working for the script field.
 - Fixed text replace garbling when replacement was longer than original.
 - Fixed tree selection changing from a directory to its parent under certain circumstances when collapsing it with the arrow keys.
 - Fixed bugs when loading CSVs while Safe Mode is enabled.
 - Fixed overwrite dialog appearing on every startup in certain cases.
 - Fixed bug when overwriting a loaded ruleset.
 - Reduced slowdown when rapidly changing the tree selection or expanding/collapsing folders.
 - Fixed freezing when typing into text fields, such as holding down a key.
 - Fixed a silent crash; the spellchecker library was compiled in Java 8 instead of 7.
Title: Re: [0.9.1a] SafariJohn's Rules Tool (v2.2.0)
Post by: SafariJohn on March 28, 2021, 02:17:49 PM
There is currently a typo in the 0.95a vanilla rules.csv. The gaFCArchonAskGalOption2 rule has a backtick in the 8th column (after the notes column), which causes the Rules Tool to fail to load the csv. The solution is simple: open the csv in a spreadsheet editor like Excel and delete the entire 8th column.
Title: Re: [0.95a] SafariJohn's Rules Tool (v2.3.0)
Post by: SafariJohn on April 28, 2021, 09:34:35 AM
v2.3.0 released! Download in the OP.

Updated the vanilla rules to 0.95a and added Command support! You are no longer required to remember the inputs to every script!

Also massively reduced RAM usage. For me it now stays around 100 to 150 MB.

Changelog:
 New Stuff:
 - Vanilla rules updated to 0.95a!
 - Added Command support!
   - Let's you define the inputs to your commands so you don't have to try to remember them.
 - Automatically detected triggers and variables are now discarded when you save if they are unused.
 - Increased refresh speed for rules tree and data tabs.
 
 Changes:
 - The shortcut for Close Ruleset is now Ctrl-W.
 - Hopefully clarified the error message when rules.csv file has the wrong number of columns.
 
 Bug Fixes:
 - Massively reduced RAM usage:
   - Patched a memory leak in the spellchecker.
   - Optimized VM options.
 - Fixed freezes when selecting a text field.
 - Replaced error logging when logger failed to initialize (lol) with error popup.
 - Fixed OutOfBounds error when replacing multiple search results with a smaller string.
 - Fixed overwrite prompt appearing every time you saved.
 - Fixed copying rules with drag and drop not updating id overlap highlights.
 - Fixed searching so it detects slightly offset repeating patterns.
Title: Re: [0.95a] SafariJohn's Rules Tool (v2.3.0)
Post by: Histidine on May 08, 2021, 06:29:27 AM
Can we get a 'copy rule' function? Would really help when I need to make a bunch of rule rows for similar cases.
Title: Re: [0.95a] SafariJohn's Rules Tool (v2.3.0)
Post by: SafariJohn on May 08, 2021, 05:27:36 PM
Hold down control I think while dragging a rule. The drop symbol will change from an empty box to one with a plus sign. You can copy multiple rules at a time.
Title: Re: [0.95a] SafariJohn's Rules Tool (v2.3.0)
Post by: SafariJohn on January 01, 2022, 04:03:40 PM
v2.4.0 released! Download in the OP.

Mainly just updating the vanilla rules to 0.95.1a.

Changelog:
Version 2.4.0
 New Stuff:
 - Vanilla rules updated to 0.95.1a!
 - Completely identical rules are now highlighted orange.
   - Other rules with the same ID are still highlighted red.
   
 Bug Fixes:
 - An error message is now displayed when a ruleset's json file is malformed.
 - Fixed drag and drop not working for commands on the conditions panel.
Title: Re: [0.95.1a] SafariJohn's Rules Tool v2.4.0
Post by: willthefunperson on April 03, 2023, 06:48:01 PM
This tool is wonderful! Thank you. Without it, making mods with rules changes would be so much more difficult. I have noticed a few issues, though. It has run slowly and even crashed before when displaying a large number of rules like if I had vanilla open while working with another large rule set. And the Triggered By box and May Trigger is not always correct. It includes incomplete matches, like if the option were abc it would say it could trigger a rule with option abcd. I use Ubuntu with version 2.4
Title: Re: [0.95.1a] SafariJohn's Rules Tool v2.4.0
Post by: SafariJohn on April 03, 2023, 07:54:23 PM
Yes, it is a bit buggy. I started on a reimplementation in Kotlin using JavaFX, but I've shelved that in favor of other projects because 2.4.0 works okay for now.

The connections detection code will never be better than an approximation because so much is handled in scripts that the Rules Tool can't determine the results of. Its main purpose is to help avoid simple but common blunders.
Title: Re: [0.95.1a] SafariJohn's Rules Tool v2.4.0
Post by: Ær on April 13, 2023, 08:42:21 AM
The tool is really cool, thanks, SafariJohn! It really helps to structurize the textwall of rules.csv and to properly get relations between rules.

Btw, on Win10 it was not sufficient to simply copy "jre" folder from Starsector: the program ran, but refused to do anything, even to close (killing the process is the only option). So, it's best to install Java from official site right away.