Spoiler
Thank you for the reply AuraIPC!! I'm not quite there yet, though
🙂
This works in that it doesn't give me an error. However it gives me the highest value from those variables, and not the variable ID of the variable that contains the highest value, which is what I want. Honestly though, I could need this in the future, so it's really useful information nonetheless!!
😀
When you say "create a scripte content" you mean type this into a Script Command (from the Event Command window, tab 3) right? Both of these gave me the same error I'm afraid.
View attachment 91252
99 is the ID of the variable I would like the information to go to, so... did I do something wrong?
😮
Thanks for your time so far though
🙂
No, you did nothing wrong, it was my bad. Sorry.
The first one I give you is what I am currently using, so I am sure it will work, just I misunderstand your request.
And the error on the other two simplfy solution, is also my bad.
I gave you something I didn't really understand. I was to arrogant.....
😢Really just want to bury myself, sorry to waste your time on that.
For make up to you, I can think of one way to help you locate the ID of the largest variable. And I am sure this will work, because we don't need script to do this.
Take the same example you give.
Variables 81 to 89.
Code:
Math.max.call(null,$gameVariables.value(X),$gameVariables.value(Y),$gameVariables.value(Z))
First, get the highest value from those variables, and store it into variable 99.
Then make few conditional branches below to check:
if variable x = variable 99
x being the variable ID of the variables you used to compare to get the max value.
In this case, they are 81 to 89.
So, basicly you will need to create 9 conditional branches for each of the variables in this case.
(Here, what we are doing with the conditonal branch is to check which variable has the same value of variable 99, which is the max value.)
Then, under each of the conditional branches, add a control variable content like below:
Control variable: variable 99 set x
Remeber? x is the ID numbers for the variables we used to compare to get the max value.
(x is just the ID number not the variable, so when you set up this control variable content, don't chose the variable, just type the ID number is the number colloum.)
Like above, make sure you put the corresponding x for each conditional branch.
So, this should give variable 99 the value of the ID number which contains the Max value.
I am a bit rush on my explaination, if there is anything I was not clear about, feel free to @ me, I will do my best to help.
And I am really really sorry about all the troubles I caused you with my last post.