Yanntastisch

The yanntastic
Veteran
Joined
May 10, 2020
Messages
67
Reaction score
2
First Language
German
Primarily Uses
RMMZ
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
1,197
Reaction score
816
First Language
Polish
Primarily Uses
RMMZ
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
67
Reaction score
2
First Language
German
Primarily Uses
RMMZ
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,462
Reaction score
625
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
67
Reaction score
2
First Language
German
Primarily Uses
RMMZ
oh thank you. I think I'll go for the first one.
 

Latest Threads

Latest Posts

Latest Profile Posts

I guess I should send my CV to Hasbro. I've made Monopoly cheaters edition more fun and challenging. I've developed custom cheats and chest/chance cards for it. And I've cleared many nightmares through my cards and rules.
I'm only missing 2 more bgms for my game but maaaaan, searching for these tracks is killing me. Can't find anything good to replace MZ's Theme 2 and Scene 5 I have as placeholders. Everything is too epic or too evil or too alarming. That 'scene 5' track in particular would fit nicely with my scene. Well, at least I finally figured what my last click-fest of a gameplay element will be like, so something positive :D
Finding new interesting stuff to make for the resource calendar becomes harder every year D:
ScreenShot_8_19_2022_2_3_18.png
FINALLY got the mood system in the game during battle. Since the game is called Panic Attack, I figured you should have certain moods present including Panic. so the main 3 or Hype, Depressed, and Anxious. Panic is only when stunned.
Red_V2.png
Red's design is finally finished (his hair is blue on purpose, it's a joke!). Out of all of the compulsory party members, he spends the most time with you. Just like the character he's based on, he presents himself as a simple person who only wants to help others, but there's obviously more to him than meets the eye.

Forum statistics

Threads
124,698
Messages
1,165,340
Members
163,513
Latest member
seraphonics
Top