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)

Author Topic: [0.9.1a] AI Flag Tool 0.3.2  (Read 52220 times)

Blothorn

  • Commander
  • ***
  • Posts: 116
    • View Profile
[0.9.1a] AI Flag Tool 0.3.2
« on: February 21, 2019, 09:28:03 PM »

AI Flag Tool 0.3.2

Download
Required mods:
LazyLib
MagicLib

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):
  • Displays a red diamond on the maneuver target.
  • Displays a blue diamond on the ship target.
  • Displays a green diamond on the mouse position.
  • Displays all active AI flags and their custom data (if any) on the right side of the screen.
  • When flags are set/unset, displays them as floating text above the ship (in green/red text, respectively).
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.)
« Last Edit: May 27, 2019, 03:09:19 PM by Blothorn »
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3786
    • View Profile
Re: [0.9a] AI Flag Tool
« Reply #1 on: February 22, 2019, 09:17:03 AM »

This is a really neat idea; thanks for putting it together!
Logged
Wyvern is 100% correct about the math.

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7174
  • Harpoon Affectionado
    • View Profile
Re: [0.9a] AI Flag Tool
« Reply #2 on: February 22, 2019, 10:26:34 AM »

Oooh! This is fantastic!
Logged

Blothorn

  • Commander
  • ***
  • Posts: 116
    • View Profile
Re: [0.9a] AI Flag Tool
« Reply #3 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.
Logged

Blothorn

  • Commander
  • ***
  • Posts: 116
    • View Profile
Re: [0.9a] AI Flag Tool 0.3.0
« Reply #4 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.
Logged

Blothorn

  • Commander
  • ***
  • Posts: 116
    • View Profile
Re: [0.9.1a] AI Flag Tool 0.3.2
« Reply #5 on: May 27, 2019, 03:09:37 PM »

Updated to 0.3.2: now respects combat UI visibility.
Logged

Dwarden

  • Commander
  • ***
  • Posts: 196
    • View Profile
Re: [0.9.1a] AI Flag Tool 0.3.2
« Reply #6 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
« Last Edit: November 08, 2019, 10:56:16 PM by Dwarden »
Logged

Warior4356

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: [0.9.1a] AI Flag Tool 0.3.2
« Reply #7 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.
Logged