math script condition branch
RPG Maker MV SupportThere is no such structure in code as a < b < c
If: Script: $gameVariables.value(5) > 20 && $gameVariables.value(5) < 30
If: Script: $gameVariables.value(5) > 20 && $gameVariables.value(5) < 30
So here's a little background on what's happening and why it's always returning true no matter what variable value you test with.
"true" has a value of 1 and "false" has a value of 0. So:
20 < 15 < 30
false < 30
0 < 30
true
"true" has a value of 1 and "false" has a value of 0. So:
20 < 15 < 30
false < 30
0 < 30
true
Always remember, codes execute one step at a time, you can't feed it two steps and expect it to do it simultaneously
thank you all
I use stencyl before and it a gui help that had this 3<x<5
and serch on java scritp web that had test like this
dunno that in rmmv can’t do that
I use stencyl before and it a gui help that had this 3<x<5
and serch on java scritp web that had test like this
dunno that in rmmv can’t do that
Its possible to do in a GUI because the GUI could have an underlying code which converts it into two statements, while the script option for conditional branch (and the script option as a whole) runs whatever is written directly.
IMHO, its still better to just separate it because its easier to determine problems when everything is laid out step by step.
PS: Can you give a link to that web javascript that showed you it runs a<b<c coz I have been searching for such and it always show the a<b && b<c version
IMHO, its still better to just separate it because its easier to determine problems when everything is laid out step by step.
PS: Can you give a link to that web javascript that showed you it runs a<b<c coz I have been searching for such and it always show the a<b && b<c version
https://www.w3schools.com/js/js_comparisons.asp
you are right it's not the web that teach
I just write my usual on the test
and as Aesica says
20 < 15 < 30
false < 30
0 < 30
true
the test box just return with this and I think it work
but the true is not
you are right it's not the web that teach
I just write my usual on the test
and as Aesica says
20 < 15 < 30
false < 30
0 < 30
true
the test box just return with this and I think it work
but the true is not
Original thread: https://forums.rpgmakerweb.com/threads/math-script-condition-branch.106221/
