Histidine91/Nexerelin

Outsourceable things for 0.95 update

Closed this issue · 3 comments

  • SP option for agent actions to guarantee success.
    • Might want to refund the SP if the action is aborted.
      • If so, and the SP point use gives bonus XP, perhaps grant said bonus XP only on action completion? Or see if bonus XP can go negative if the player has used some of it and then we take it back.
  • Derelict Empire improvements
    • Make it use our own custom mod faction (clone the vanilla faction), so we can change its balance without touching regular derelicts.
    • Will require changing nex_marketPostOpenDerelicts and the two rules below it in rules.csv to point to the new factions.
    • Will require custom handling to make missions the player can receive not send them to the new derelict faction's markets. But I'll handle this later.

Ok I need some advice for the SP option for agent .

At the start, I wanted to add something like this:

// Confirm option
options.addOption(StringHelper.getString("confirm", true), Menu.CONFIRM);
if (!canProceed() || !hasEnoughCredits()) {
options.setEnabled(Menu.CONFIRM, false);
} else {
options.addOptionConfirmation(Menu.CONFIRM, getString("dialogConfirmText"),
StringHelper.getString("yes", true), StringHelper.getString("no", true));
options.setShortcut(Menu.CONFIRM, Keyboard.KEY_RETURN,
false, false, false, true);
}

But since a class already do the option and confirmation for SP usage (com.fs.starfarer.api.impl.campaign.rulecmd.SetStoryOption) I wanted to use it instead
The problem with this class is that it doesn't allow to enable or not the option.
I was wondering if I should copy this class in nexerelin something like Nex_SetStoryOption and add this option to enable disable.

Since the AgentOrdersDialog doesn't seems to use rule.csv
How can I call a script from java?

What should I do?

Hmm. I'll only be sure when I look at it closely tomorrow, but: The static set methods in SetStoryOption should be sufficient. i.e.

options.addOption("Use story point to guarantee success", myOptionId);
SetStoryOption.set(this, 1, myOptionId, bonusXPID, soundId, logText);
if (shouldDisableStoryPointOption()) {
  options.setEnabled(myOptionID, false);
}

(I have no idea what the various params of set are, so you'll have to try things out and look at examples in the API)

The two tasks are done. Thanks for the help!