Rpg newby here. I would like for game to fire some event every 100 game days. I have a calendar in a game and would like to have a condition like if $days mod 100 == 0 then something. But I cannot figure our how to make a conditional branch like this using the RPGmaker user interface. I am sure it is possible but how?
conditional based on a remainder
RPG Maker MV SupportConditional Branch -> 4th Tab -> Script
Where ID is the id of your days variable.
Code:
$gameVariables.value(ID) % 100 === 0
ahh. Script is where i can do these freeform expressions. Thank you. Three === for conditional equality check?! I assume one = for assignment?What are two == for?
=== is for value and type equality.
== is for value equality with type coercion. Meaning it will convert types, if necessary.
Examples:
== is for value equality with type coercion. Meaning it will convert types, if necessary.
Examples:
PHP:
'2' == 2 //true
'2' === 2 //false
[2] == '2' //true
[2] === '2' //false
Absolutely no need for a script unless you need to really speed up processing.
The control variable command also contains the modulo operation, so you only need one additional command "control variable temp = value mod 100" and then check the result in the temp variable with a regular conditional branch
The control variable command also contains the modulo operation, so you only need one additional command "control variable temp = value mod 100" and then check the result in the temp variable with a regular conditional branch
Original thread: https://forums.rpgmakerweb.com/threads/conditional-based-on-a-remainder.84832/