Background:
I'm devising a game where the player is protecting a village.
The village is comprised of 9 families.
Each family has a cohesion stat - tracked by a variable for each family.
An event decides that an terror will take place, it assigns 1 of the 9 families at random.
The player undertakes a quest to help the family.
If they succeed the family cohesion is unchanged.
If the player fails a family member dies and the cohesion score is lowered.
Goal:
What I'm trying to do is make this system as scalable as I can, without relying on too many switches.
I want to see if I can use arrays to track each family's status and that's where I'm running into problems.
variable ID 22 family_assign represents the family being selected by the event, it does so by random number generation (1-9)
It then checks to make sure they're eligible, this is where the arrays come in.
I have a variable: family_KO_array which I store an empty array at game start using a common event and Control Variables command. See the screenshot below:
The above example didn't produce an error
When a family falls below the cohesion threshold - currently 50 - the common event pushes their number (1 to 9) to the array.
This generates my second error, same as the first from what I can see in the debug.
Error1:
Should the above just be a script on its own instead of using control variables?
The event randomly assigns a family via a generated number between 1-9 storing it in "family_assign" (variableID 22)
In the screenshot below I'm trying to check if the value of family_assign is stored in family_KO_array (varioable28)
This of course generates an error as well.
Error2:
I've tried .includes and .some with the same result.
Any guidance in this endeavor is appreciated.
I'm devising a game where the player is protecting a village.
The village is comprised of 9 families.
Each family has a cohesion stat - tracked by a variable for each family.
An event decides that an terror will take place, it assigns 1 of the 9 families at random.
The player undertakes a quest to help the family.
If they succeed the family cohesion is unchanged.
If the player fails a family member dies and the cohesion score is lowered.
Goal:
What I'm trying to do is make this system as scalable as I can, without relying on too many switches.
I want to see if I can use arrays to track each family's status and that's where I'm running into problems.
variable ID 22 family_assign represents the family being selected by the event, it does so by random number generation (1-9)
It then checks to make sure they're eligible, this is where the arrays come in.
I have a variable: family_KO_array which I store an empty array at game start using a common event and Control Variables command. See the screenshot below:
The above example didn't produce an error
When a family falls below the cohesion threshold - currently 50 - the common event pushes their number (1 to 9) to the array.
This generates my second error, same as the first from what I can see in the debug.
Error1:
Should the above just be a script on its own instead of using control variables?
The event randomly assigns a family via a generated number between 1-9 storing it in "family_assign" (variableID 22)
In the screenshot below I'm trying to check if the value of family_assign is stored in family_KO_array (varioable28)
This of course generates an error as well.
Error2:
I've tried .includes and .some with the same result.
Any guidance in this endeavor is appreciated.