I have 100 switches with 100 corresponding variables and I need someway to check all of em efficiently.
I have 100 variables, each corresponding to a specific character that increments every time a "day" passes in my game, so during the event that switches to the next day all 100 variables are incremented by 1. I want to have certain events activate when any of these values reaches 10, however I only want that to happen if the character in question is relevant at that moment in game. I have 100 switches that each activate when a character becomes relevant, and deactivate when they stop being relevant. The way the game is set up any combination of these 100 characters is possible at any given time. Basically, I can set it up like this:
If switch(character1) = true, then variable(character1) += 1;
if variable(character1) == 10, then event;
the problem is this would require me to write literally 100 if statements, which I do not want to do.
Is there a better way of doing this? I'm open to JS and/or plugins is I'm lucky enough that those solutions exist.
I have 100 variables, each corresponding to a specific character that increments every time a "day" passes in my game, so during the event that switches to the next day all 100 variables are incremented by 1. I want to have certain events activate when any of these values reaches 10, however I only want that to happen if the character in question is relevant at that moment in game. I have 100 switches that each activate when a character becomes relevant, and deactivate when they stop being relevant. The way the game is set up any combination of these 100 characters is possible at any given time. Basically, I can set it up like this:
If switch(character1) = true, then variable(character1) += 1;
if variable(character1) == 10, then event;
the problem is this would require me to write literally 100 if statements, which I do not want to do.
Is there a better way of doing this? I'm open to JS and/or plugins is I'm lucky enough that those solutions exist.