Yanntastisch

The yanntastic
Veteran
Joined
May 10, 2020
Messages
51
Reaction score
0
First Language
German
Primarily Uses
RMVXA
I want to disable a random switch between, for example, 1 and 50 in an event.
Is there a way of doing so or do I need a script for this?
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
979
Reaction score
618
First Language
Polish
Primarily Uses
RMMV
Depends how many switch it will be, I think for 50 you can do it. Set variable (let's call it "randomizer") to random value from 0 to 50, then make a conditional branch, where 1 means switch 1 off, 2 means switch 2 off, etc... Lot of clicking, but that's the only option if you don't want to use scripts or plugins.
 

Yanntastisch

The yanntastic
Veteran
Joined
May 10, 2020
Messages
51
Reaction score
0
First Language
German
Primarily Uses
RMVXA
well I already had that in mind. So I wanted to know if there's another way. A script would do. But I can't find one.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,425
Reaction score
603
First Language
Italian
Primarily Uses
RMVXA
If you randomize a variable (I am gonna call the id of this variable var_id) you can add a script call like this:
Code:
$game_switches[$game_variables[var_id]] = false

If you wanna have it even shorter you can go for this:
Code:
$game_switched[rand(50) + 1] = false

This last solution, however, does not allow you to keep track of which switch you turned off.
 
Last edited:

Yanntastisch

The yanntastic
Veteran
Joined
May 10, 2020
Messages
51
Reaction score
0
First Language
German
Primarily Uses
RMVXA
oh thank you. I think I'll go for the first one.
 

Latest Threads

Latest Posts

Latest Profile Posts

Doing RPG Maker News for 21st September 2021


Malak is still waiting for Dark Deception Chapter 4... This was him yesterday after another sugar crash.
Again, he's fine. He's just bored at this point, considering he's exhausted his entire vacation bucket list.
Am I the only one who files custom resources under specific folders to remember who to credit? :kaoswt2:
1632263519730.png
I always smile to myself when I see someone do the "immediate halt and spin around" from forgetting something. I find it sort of endearing how we all do it without ever being taught to.

Forum statistics

Threads
115,260
Messages
1,088,434
Members
149,864
Latest member
ratbyte
Top