I have a rule that should only be checked when the player is in HQ. I don’t want the parser to go through every rule all the time.
Before doing anything except saluting, looking, or helping in HQ:
say "HQ-only command executing";
if saluteRequired is "True":
follow the unsaluted rule;
However, the say statement appears everywhere except saluting, looking, or helping commands. I assumed that the rule would only be executed when the player is in HQ.
Am I doing this wrong? How do I restrict the scope of the rule?
Yep. I changed it to “…when location is HQ” and it worked. Does it shave off any parsing/response time to restrict a rule to a location? I assume it does, but this story is Slooow.
It can, but the speed impact of a rule like this is minimal. If you are having sufficient performance issues that you want to dig in and try to improve things, this thread has some good ideas/resources, though it can be complex stuff:
It can, if the rule does some big tedious calculation (say, calculating a bunch of routes through the map), and then throws away the result if it’s not relevant. But most rules don’t do that.