Fractal Softworks Forum

Starsector => Mods => Topic started by: Blothorn on February 21, 2019, 09:28:03 PM

Title: [0.9.1a] AI Flag Tool 0.3.2
Post by: Blothorn on February 21, 2019, 09:28:03 PM
AI Flag Tool 0.3.2

Download (https://github.com/isturdy/ai-flag-tool/releases/download/0.3.2/ai-flag-tool-0.3.2.zip)
Required mods:
LazyLib (http://fractalsoftworks.com/forum/index.php?topic=5444.0)
MagicLib (http://fractalsoftworks.com/forum/index.php?topic=13718.0)

This is a utility directed at modders who want visibility into AI flags, primarily for writing ship system AIs. It shows the following information for a focused ship (defaults to the player ship, only useful when it is on autopilot):
The display can be toggled with alt-f; ctrl-f shifts focus to the player ship's current target, and displays its last 8 target/flag changes. These shortcuts are customizable in ai_flag_tool_settings.json (which is mergable; you can put a copy in a personal mod to protect it from updates).

This also includes a console command OverrideFlag, which allows forcing an AI flag to see how it affects ship behavior--see the help in console for details. (I will caution not to count on this behavior being the same as when the AI turns on the flag itself, since many flags seem to be partly or entirely descriptive.)
Title: Re: [0.9a] AI Flag Tool
Post by: Wyvern on February 22, 2019, 09:17:03 AM
This is a really neat idea; thanks for putting it together!
Title: Re: [0.9a] AI Flag Tool
Post by: Thaago on February 22, 2019, 10:26:34 AM
Oooh! This is fantastic!
Title: Re: [0.9a] AI Flag Tool
Post by: Blothorn on February 26, 2019, 11:52:28 PM
Updated to 0.2.0; the main features are the ability to toggle display (alt-f) or shift focus to the player ship's target (ctrl-f)--this also displays that ship's last eight target/flag changes, so that if you see an AI ship do something odd you can shift focus and hopefully better understand what it was thinking at the time.
Title: Re: [0.9a] AI Flag Tool 0.3.0
Post by: Blothorn on March 20, 2019, 10:10:04 PM
Updated to 0.3.0:
- ai_flag_tool_settings.json is now mergeable, so you can put overrides in a personal mod to prevent them from being overwritten by updates.
- Made the keyboard shortcuts configurable in settings. Let me know if the documentation of the syntax is unclear.
- Moved display of active flags from the ship status pain to the right hand of the screen (thanks to LazyWizard for making this so easy!).
- Added time since last change for flags. (No time displayed means the flag was active when the ship was focused or its AI enabled.) - Added the console command OverrideFlag, which sets the specified flag either once or every frame. See the help in the console for details.
Title: Re: [0.9.1a] AI Flag Tool 0.3.2
Post by: Blothorn on May 27, 2019, 03:09:37 PM
Updated to 0.3.2: now respects combat UI visibility.
Title: Re: [0.9.1a] AI Flag Tool 0.3.2
Post by: Dwarden on November 08, 2019, 05:42:08 PM
so, i started all of sudden getting this error

Spoiler
226425 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NoClassDefFoundError: Could not initialize class com.github.isturdy.aiflagtool.AiFlagTool
java.lang.NoClassDefFoundError: Could not initialize class com.github.isturdy.aiflagtool.AiFlagTool
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at com.fs.starfarer.loading.scripts.ScriptStore.Ó00000(Unknown Source)
   at com.fs.starfarer.launcher.ModManager.getEnabledModPlugins(Unknown Source)
   at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]

Spoiler
it's interesting as there is no 'hint' why as the mod was working fine until recently

note: narrowed the problem to recently updated mod : [0.9.1a] Kiith Nabaal Shipyard 1.2 - Vaygr Destroyer
here is the post with different crash https://fractalsoftworks.com/forum/index.php?topic=16360.msg271226#msg271226
and disabling it allows game load fine with AI Flag Tool
[close]

fixed
Title: Re: [0.9.1a] AI Flag Tool 0.3.2
Post by: Warior4356 on August 06, 2022, 02:52:28 PM
This mod does work in version 0.95 if you change mod_info.json to fit the current version, in case anyone was curious.