1
Modding / Help request - Scripting rules for when a campaign ability disables another
« on: February 28, 2022, 09:08:58 AM »
Hello,
I want for Sustained Burn to remain active when Remote Survey and other abilities are used.
When an activatable ability is used, it deactivates some toggleable abilities (like sustained burn) but not others (like Go Dark, or Trasponder on).
I found the following method inside com.fs.starfarer.api.impl.campaign.abilities.BaseAbilityPlugin, line 73:
Which calls isCompatible(), line 85:
Apparently the script recognizes which abilities to deactivate based on some ability tags, but I cannot figure out where to find those.
I don't know how to use the AbilitySpecAPI to get the tags.
Thanks a lot for your help!
I want for Sustained Burn to remain active when Remote Survey and other abilities are used.
When an activatable ability is used, it deactivates some toggleable abilities (like sustained burn) but not others (like Go Dark, or Trasponder on).
I found the following method inside com.fs.starfarer.api.impl.campaign.abilities.BaseAbilityPlugin, line 73:
Code
protected void disableIncompatible() {
CampaignFleetAPI fleet = getFleet();
if (fleet == null) return;
for (AbilityPlugin curr : fleet.getAbilities().values()) {
if (curr == this) continue;
if (!isCompatible(curr)) {
curr.forceDisable();
}
}
}
Which calls isCompatible(), line 85:
Code
protected boolean isCompatible(AbilityPlugin other) {
for (String tag : spec.getTags()) {
if (spec.isPositiveTag(tag) && other.getSpec().hasTag(tag)) return false;
if (other.getSpec().hasOppositeTag(tag)) return false;
}
return true;
}
Apparently the script recognizes which abilities to deactivate based on some ability tags, but I cannot figure out where to find those.
I don't know how to use the AbilitySpecAPI to get the tags.
Thanks a lot for your help!