This means multiple rules have the same score and so one is picked randomly. Add a "score" to one of the conditions in your rule to make it take precedence, i.e.
$tag:whatever score:100
The base score (in the absence of "score:" parameters) is 1 point for each condition matched.
@Inventor Raccoon -On scoring from my experience:
- Depending on how many rules entries this particular entity may have in the future, I strongly encourage you to have a scoring system in place ahead of time.
For example: I have separate instances of greeting dialogues- based on both faction and rep. If I make the score the same for each check, unintended dialogue may pop up at random if I add additional factors in the future (like supply count or a custom script checking a boolean in memory).
For my system, generic sorting factors like
faction get a base score of 10. Higher than default by quite a few checks, but still fairly low overall.
Things I consider "one off" encounter checks, like for story bools in memory, get a score of 1000. They only occur once, typically, so it is very important they always take precedence. But this gives a large window to add lower level checks without jeopardizing the story later.
2. Oh, yeah, I see. Thanks.
1. So, something like the code in the spoiler?
Spoiler
package data.scripts.plugins;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.BaseCampaignPlugin;
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.rules.MemoryAPI;
import static data.scripts.campaign.ids.AECommodities.SIERRA_CORE;
public class AECampaignPluginImpl extends BaseCampaignPlugin {
public String getId() {
return "AECampaignPluginImpl";
}
public void updatePlayerFacts(MemoryAPI memory) {
CampaignFleetAPI fleet = Global.getSector().getPlayerFleet();
memory.set("$ae_sierracore", (int)fleet.getCargo().getCommodityQuantity(SIERRA_CORE), 0);
}
}
And then I'd replace $player.supplies with $player.ae_sierracore?
I believe so, yes.