Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Is it possible to go past 5000 switches in XP?

Azier

Member

Hey, guys. I'm a newbie here and with RPG Maker, and I can't really find the answer to my question, so please forgive me if it's been asked a million times before. Basically, the project I'm working on is planned to be really long and I want to make sure I don't run out of switches. Since this is my first project, I have no real way of gauging exactly how much I will actually be using, but I don't really want to get 90% of the way through the game and run out. Basically, this game is going to be the length of your average commercial RPG with a lot of cutscenes, and maybe all in all this is a silly question, I just want to make sure I get all the way to the end.
 
Try modifying the Game_Switches class. Anyhow, I really doubt you'll be using that many switches, without mattering how long your project is. Remember, you can always use other conditionals besides switches, such as variables, and local switches. For most of your needs, local switches will do, such as chests and other events of similar nature. Try to rationalize your switches for big events: killing a boss, clearing a quest, etc. Also, try to think of places where you can substitute a switch for a variable. If you're unhappy with my answer, search the scripts forums. I'm sure someone has written a script for this specific purpose.
 
Well, let's roll up the topic a bit...

You can't surpass the 5000 switches limit without modifying the program's source code, which you aren't allowed by the terms you agreed on upon install. You can change the amount of switches stored, but you'd still need a way to address them through the RMXP interface, which you don't have... unless you want to call scripts with $game_switches[5019] = true all the time.
Another way COULD be editing the Switches.rxdata file, as it holds the array of boolean values that are basically your switches - if you edit 10000 instead of 5000 false[i/]s in there, you might get them to show up within RMXP's interface. If this is reverse engineering or not I can't tell ya though...

Basically, local switches is what you need in a big project: They're unlimited, event-specific and therefore 90% of the switches you'll actually need. Problem is: There aren't any in RMXP, if I'm not mistaken. Therefore, getting a script that incorporates local switches there might be the way to go for you. Obviously, use variables where you should (not can, should!), as medinastories said already.
 
How about this? I was thinking of this all night long, and it should work. Switches are basically a long array of booleans. So, you create your own Switches.rxdata file and work with it. You make your own class called Game_Switches to handle your file. This way, you can have as many switches as you want. But really think about it. Is it necessary?
 
I remember there is a script for this made by some guy on RRR whos name started with a "W". Not only did it increase the max switches, it also could increase database size, maps, variables, and a whole lot of other things... try searching for it
 
Velocir_X":22ou06ak said:
I remember there is a script for this made by some guy on RRR whos name started with a "W". Not only did it increase the max switches, it also could increase database size, maps, variables, and a whole lot of other things... try searching for it

The script you're referring to is the database limit breaker, although I can't remember the author.
 
True, I recall it was called self switches in one and local switches in the other... in that case, absolutely no reason to break the 5000 switches limit unless one's too blank to figure out how to use them.

As for the Database Limit Breaker... I recall the one by woratana, as well as one by some guy named shadowlink... still, no real need for that if switches is your only problem, as local switches are able to handle the shit out of everything you need (and from looking at the setup instructions for woratana's script, it doesn't seem to be worth the effort...).
 

Zeriab

Sponsor

It is luckily fairly simple to change the maximum number of global switches ^_^

You can use this snippet and change 20000 to the maximum number of switches you want. (You can only increase it)

[rgss]# This snippet can only increase, never decrease the number of switches
number_of_switches = 20000 # The number of switches you want
system = load_data('Data/System.rxdata')
new_switches = number_of_switches - system.switches.size
if new_switches > 0
  system.switches += [""] * new_switches
  save_data(system, 'Data/System.rxdata')
  p 'Done!'
else
  p 'You already have enough switches available'
end
exit
[/rgss]

Next go to Game_Switches and change the two occurrences of 5000 to the number you chose.


As the others talked about each event has four self-switches (A,B,C,D) which you can use.
Do note that you cannot always use self switches instead of global switches. (Unless you script)
Sometimes using global switches is preferable over self-switches and sometimes using self-switches is preferable. There probably also are a lot of cases where it's more a matter of taste than anything else.

If you don't know how they function you definitely should learn about self-switches as it is a great tool :smile:

*hugs*
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top