Hi everyone,
The title sounds very complex, but I will try to explain as best as I can what I'm looking for.
In my game the player has a number of troops (from now on called X) I want the number of enemy troops to be randomly assigned, but based on this number of troops the player has.
What I'm basically looking for is to do this:
EnemyTroops = PlayerTroops +/- (0 to 0.5) PlayerTroops
So as an example, if PlayerTroops is 200, I would want EnemyTroops to be anywhere within the range of 100-300
I know this will somehow require a randomization, but with my limited knowledge of scripting I can't figure out how this would work.
Edit: Perhaps something like this? But I don't know whether this would work.
0.5 * $gameVariables.21 + Math.random($gameVariables.21)
Thanks in advance!
The title sounds very complex, but I will try to explain as best as I can what I'm looking for.
In my game the player has a number of troops (from now on called X) I want the number of enemy troops to be randomly assigned, but based on this number of troops the player has.
What I'm basically looking for is to do this:
EnemyTroops = PlayerTroops +/- (0 to 0.5) PlayerTroops
So as an example, if PlayerTroops is 200, I would want EnemyTroops to be anywhere within the range of 100-300
I know this will somehow require a randomization, but with my limited knowledge of scripting I can't figure out how this would work.
Edit: Perhaps something like this? But I don't know whether this would work.
0.5 * $gameVariables.21 + Math.random($gameVariables.21)
Thanks in advance!