I'm currently having some issues trying to get game data like my player's stat values through scripting. I'm trying to create a formula that generates a value based of the player's stat with some variation. I wanted to do this through "Control Variables" window and using the "Script" operand yet I can't seem to find where the game data are stored.
I'm aware that I could get the stat value if I used "Game Data", but it won't let me do anything else with it. Something like:
Math.floor(gameData.actor[0].stat.attack / 10) + ( Math.random() * (max - min) )
Where actor[0] is player and such (this is pure guesswork as example).
In fact, if you believe there are other objects or functions that are generally helpful in scripting, please include.
Thanks
Update: I realize someone might point out that I could do this by having several "Control Variables" work in order, something like:
1) Get Player Attack value, store at variable[2]
2) Divide variable[2] by 10,
3) Add random value between min and max to variable[2].
But it'll be so much easier to just do something like this through scripting. Especially if I had more complex algorithms/formulas.
I'm aware that I could get the stat value if I used "Game Data", but it won't let me do anything else with it. Something like:
Math.floor(gameData.actor[0].stat.attack / 10) + ( Math.random() * (max - min) )
Where actor[0] is player and such (this is pure guesswork as example).
In fact, if you believe there are other objects or functions that are generally helpful in scripting, please include.
Thanks
Update: I realize someone might point out that I could do this by having several "Control Variables" work in order, something like:
1) Get Player Attack value, store at variable[2]
2) Divide variable[2] by 10,
3) Add random value between min and max to variable[2].
But it'll be so much easier to just do something like this through scripting. Especially if I had more complex algorithms/formulas.