- Joined
- May 19, 2017
- Messages
- 112
- Reaction score
- 10
- First Language
- Italian
- Primarily Uses
- RMMV
Hi,
I'm using in a conditional branch this script;
let text = $gameVariables.value(x).toLowerCase(); text.indexOf("word 1") < text.indexOf("word 2")
to check if "word 1" comes before "word 2" in a string stored in var(x) (using a free input text plugin).
This scripts works fine BUT how can I add other variants without using more Conditional Branches?
I.e. if "word 1" comes before "word 2" OR "word 3"?
I found out that in javascript || means "or" and I tried something like;
let text = $gameVariables.value(x).toLowerCase(); text.indexOf("word 1") < text.indexOf("word 2") || let text = $gameVariables.value(x).toLowerCase(); text.indexOf("word 1") < text.indexOf("word 3")
let text = $gameVariables.value(x).toLowerCase(); text.indexOf("word 1") < text.indexOf("word 2") || text.indexOf("word 1") < text.indexOf("word 3")
But none of the two works...
I'm using in a conditional branch this script;
let text = $gameVariables.value(x).toLowerCase(); text.indexOf("word 1") < text.indexOf("word 2")
to check if "word 1" comes before "word 2" in a string stored in var(x) (using a free input text plugin).
This scripts works fine BUT how can I add other variants without using more Conditional Branches?
I.e. if "word 1" comes before "word 2" OR "word 3"?
I found out that in javascript || means "or" and I tried something like;
let text = $gameVariables.value(x).toLowerCase(); text.indexOf("word 1") < text.indexOf("word 2") || let text = $gameVariables.value(x).toLowerCase(); text.indexOf("word 1") < text.indexOf("word 3")
let text = $gameVariables.value(x).toLowerCase(); text.indexOf("word 1") < text.indexOf("word 2") || text.indexOf("word 1") < text.indexOf("word 3")
But none of the two works...


