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
876
Reaction score
574
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,424
Reaction score
602
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

Come, join Move That Box! DISCORD!
Feel free to check out our "Touch the Stars" gamejam submission, "Starlight, Starbright!"
just finished playing one shot. im kinda disappointed with return the sun ending ngl. i was hoping there would be some after credits scene that would play with my emotions
So apparently the surprise Google Search page browser game saves your progress when you close the browser.

This really makes me miss the golden age of Flash gaming.
ohh man im ending oneshot now (im doing the last stepping puzzle rn) and the music is so...sad...like...ive been thinking recently about how fast moments pass and...my anxious thoughts combined with that music and nostalgia...like...im comfortably sad...and want to cry internally

Forum statistics

Threads
113,560
Messages
1,075,831
Members
147,556
Latest member
rozmirp
Top