EDIT: I have another question though, is there a way to flag ships as no-retreat? I seem to be getting some fatal errors when ships dynamically spawned in-combat retreat from the 'Full Retreat' command.
This is the aforementioned error, by the way, if it's of interest:
ERROR com.fs.starfarer.combat.CombatMain - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.combat.ai.movement.maneuvers.RetreatManeuver.o00000(Unknown Source)
at com.fs.starfarer.combat.ai.movement.maneuvers.RetreatManeuver.o00000(Unknown Source)
Hmm - I suspect this may be due to how you're adding the ship; if this was a universal problem I'd imagine a lot of other things that work in mods, wouldn't.
I'm adding GUI sliders to a part of the new game dialog. But when I call the rules.csv row that's supposed to read their values, the sliders no longer exist (opts.hasSelector returns false). Even though I haven't left the dialog "page" where I added the sliders yet and the dialog option that calls said rule is in the same page as the sliders.
I have a working implementation of sliders elsewhere in my new game dialog, but can't tell why that one works and this doesn't.
Help plz
Do your options add any other options somewhere along the way? That would cause the old (slider) options to get cleared out. Do any of the rule commands you run return true in their doesCommandAddOptions() method? That would also cause the options to get cleared out, even if the command doesn't actually add any.
Edit: on re-reading, it sounds like the options are not, in fact, getting cleared out, so probably never mind that. But on the other hand, looking at the code, it seems... let's say unlikely? ... that the getSelector() option would return false if the right parameter was passed in and the options were *not* cleared, since the map that holds the selectors is *only* cleared when the options are cleared.