Edit 3: Updated Image Hello! Normally, I like to keep my open threads to one at a time, but my one in Script Support is taking far too long. Sorry! I'm designing a survival game with mechanisms to prevent players from screwing around for too long. The longer the game plays, the higher "difficulty" gets, until the game is downright unfair. Part of this is the current area I'm designing, wherein NPCs leave after a certain period of time. The game reads the number of NPCs remaining as a variable,...
Edit 3: Updated Image
Hello! Normally, I like to keep my open threads to one at a time, but my one in Script Support is taking far too long. Sorry!
I'm designing a survival game with mechanisms to prevent players from screwing around for too long. The longer the game plays, the higher "difficulty" gets, until the game is downright unfair. Part of this is the current area I'm designing, wherein NPCs leave after a certain period of time. The game reads the number of NPCs remaining as a variable, and uses that to determine with a coin flip which group of NPCs is subtracted from.
To put it more simply:
You have, for example, Group A with 10 members, and Group B with 5. The game tracks these both as variables. It adds them as 15, and chooses a random number from 1-15. If the number picked is 10 or lower, Group A loses a member, and vise versa. I want the maximum value to always reflect the number of remaining NPCs.
The problem is that this doesn't seem possible. When you set a variable to a random number, it seems you can only choose a whole number (I'm aware you can use letters, and there's even arrays, but I'm not that advanced yet.), rather than equating the minimum or maximum to another variable. I've thought of several ways around this, but all so far would ruin the accuracy of the proposed way. The only other way I see to do it is to create a Conditional for every possible maximum value, which would be extremely tedious, and difficult to adjust. Does anyone know a way around this restriction?