Tool for remove unused variables and swtiches in VX Ace

toto8080

Villager
Member
Joined
Feb 26, 2018
Messages
15
Reaction score
0
First Language
German
Primarily Uses
RMVXA
There is a program called RMTool for RM2k and RM2k3, which scans RPG Maker games for missing files and gives instructions on how we can fix them.
My project is pretty huge, and I want to be sure, that I didn't left any unused variables, switches, events in the final product. The problem is, that the RMTool isn't compatible with newer RM versions.

So, is there any kind built-in mechanism, or Tool for VX Ace, that works the same as RMTool did?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
4,685
Reaction score
5,357
First Language
Indonesian
Primarily Uses
RMVXA
The question is why bother? Unused switches and variables won't do much on your project (it wont drop your game performance, nor contribute in the game size), unlike unused files.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,317
Reaction score
2,443
First Language
French
Primarily Uses
RMVXA
@toto8080 I'm not sure if your question has been correctly formulated, as your example with RM2K is about *missing* resources while your example with VXAce is about *extra* resources (switches, in that case).
 

toto8080

Villager
Member
Joined
Feb 26, 2018
Messages
15
Reaction score
0
First Language
German
Primarily Uses
RMVXA
The question is why bother? Unused switches and variables won't do much on your project (it wont drop your game performance, nor contribute in the game size), unlike unused files.
The mentioned project is for education purposes, therefore it's not really good, if I leave in some unused variables and switchies. It will probably confuse the user, which I dont want, of course.

@toto8080 I'm not sure if your question has been correctly formulated, as your example with RM2K is about *missing* resources while your example with VXAce is about *extra* resources (switches, in that case).
If I know it correctly, the program could do both. So if there were missing resources it could warn us, and if you had extra resources, you could remove them just one mouseclick with this program. I'm looking for a tool, that is capable to do the second thing, so I could delete the extra, unused resources. :)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,186
Reaction score
6,758
First Language
German
Primarily Uses
RMMV
I think you're mixing up things that have nothing to do with each other.

It is technically impossible to "remove unused variables", because the variables are organized by ID and removing any part of that array will cause all later variables to become unusable and wrong. Your game will simply no longer work.
And the second wrong assumption is that the user can see the variables - variables are internal and completely invisible to the player unless you (as the developer) specifically display them somewhere.
Third, while files have their representations, variables and switches have not - there is nothing to remove from a game.

The only thing you can do is before you deploy and distribute your game, you can go into the variables window and change the maximum to that of the highest switch or variable ID used.
If you skipped some ID numbers in that list, your only option is to manually change all variables in every event for a new list.
This can never be automated for a lot of reasons.
 

toto8080

Villager
Member
Joined
Feb 26, 2018
Messages
15
Reaction score
0
First Language
German
Primarily Uses
RMVXA
It is technically impossible to "remove unused variables", because the variables are organized by ID and removing any part of that array will cause all later variables to become unusable and wrong. Your game will simply no longer work.
Thats actually not true. Switches and variables act different than events, and their ID's wont shift up when you delete them manually.

And the second wrong assumption is that the user can see the variables - variables are internal and completely invisible to the player unless you (as the developer) specifically display them somewhere.
Third, while files have their representations, variables and switches have not - there is nothing to remove from a game.
I would like to write a tutorial about the distributed program, and I dont want to show the unused variables in the pictures, because it may confuse the reader. It would be much better and cleaner, if I could just remove the switch, which serves no purpose (idk, maybe there is a tool which can detect variables that are declared, but never used)

Like you mentioned, it is a possible solution, if I change the ID's manually, but I have a huge project, and it's very likely, that I accindentally forget to change one or two... this is the reason why Im asking about a tool, which could do this job for me, but it seems like that kind of program doesnt exist yet.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,442
Reaction score
12,010
First Language
English
Primarily Uses
RMMV
Switches and variables act different than events, and their ID's wont shift up when you delete them manually
Which is why it's pointless to try to "remove" them. The best you can do is remove their names, which might save your game a few bytes for each one, but the switch/variable itself is still there because you haven't remove it - you've only removed the name you applied to it. Hardly worth the trouble. And, for the record, if you go into the GameSystem.json file and delete switch and variable names, without leaving a 'null' or something like that in its place, the IDs WILL shift up.

The reason you could do that (clear the names of unused switches & variables) in the older engines is that the engines controlled ALL use of switches and variables. If it was found in a condition or an event command, you knew it was in use. If it couldn't be found anywhere in the database or events, you knew it wasn't in use. From XP onwards, that is no longer true. The moment scripts were introduced (and plugins for MV), you no longer have full visibility into where switches & variables are used. Just because you can't find it being used in the database or event commands or conditions, does not mean it's not used. There are a number of scripts/plugins that use switches & variables and you never have to use them anywhere else in your game. These would not be picked up by such a tool, so the tool would incorrectly think they're unused.
 

toto8080

Villager
Member
Joined
Feb 26, 2018
Messages
15
Reaction score
0
First Language
German
Primarily Uses
RMVXA
Oh, I see! Thank you for the explanation! :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

That moment when you post the wrong download link to your game and wonder why it got so few downloads... :mad:
Trying to make it so my map is cleared of "random" events after the player leaves the map... to little success >.<
Had my first interaction with a legit homophobe concerning one of my games today. Tempting to engage, but pointless.
The BIGGEST immersion breaker for Sword Art Online is that Kirito keeps finding overpowered playstyles using "bad things nobody uses cuz its bad". Players WILL use bad gear BECAUSE it's bad.
When I said I'd make 20 games in 2020, I scared myself. Now it's mid-February, and I've made 6 games. So I got this. But, then again...do I got this?

Forum statistics

Threads
94,238
Messages
919,284
Members
123,942
Latest member
pioneroh2
Top