Utility Script: Switch, variable and common event sorting

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
Hey guys!

I had this thread a few days ago where I asked whether it is possible to readout RPG Maker VX Ace map data, so I can change, for example, all common events that are called at once and stuff like that. Now, while it didn't seemed possible to readout map data from the map files, someone gave me a short script that could be used to replace all "Call Common Event: x" with "Call Common Event: y".

http://forums.rpgmakerweb.com/index.php?/topic/19901-readout-vx-ace-map-data/

(The script is at the end of the topic.)

That was extremely useful, and I would really appreciate it if someone expanded upon it a bit. Things that would further decrease the work that must be done in order to have everything clean and sorted, would be the following:

- Shift a range of common event calls up/down by x common event IDs (if you have 100 common events and want to insert a new one at position 3)

- The possibility to also change switches and/or variables used in event commands (similarly to common events: if you have 100 switches and want to insert a new one at position 3)

- Alternatively: Change common events, switches or variables in a "x -> y, z -> a, b -> c, ..." fashion, so not by shifting, but by changing their ID, so to speak.

- Auto-Common-Event: Goes through all maps and stores identical command chains of 2 or more commands into a common event and calls that.

Now, the third and fourth ones seem extremely difficult to me, so those are just some crazy ideas. The first and/or second function, however, would be much appreciated. :) I think anyone could use that to maintain or establish some order in his project.

I really hope someone feels called upon. :) I don't ask for all four things, of course. Every bit of code in this general direction helps, really.
 
Last edited by a moderator:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
Yes, a translation would be very kind. :)

As far as switches and variables are concerned: The switches and variables themselves are not stored in the map data, but the event commands using them are. So if I have variable "1: Side Quest X" and variable "2: Side Quest Y" or something like this that are used in different events on the map, I would like to change it to "1: Side Quest Y" and "2: Side Quest X". I can easily rename the variables in the editor, but I also want to tell all map events that I did so. I want the event commands* that formerly used variable 1 to use variable 2 now, and vice versa.

*It would actually be enough if "Change Variable" and "Conditonal Branch" commands would be taken into account here. Other things like "Get Location Info" that can use variables, too, aren't that important, because there are only a few instances of those which I can change manually. But "Change Variable" and "Conditional Branch" are so common it's really a pain to change them one by one.
 
Last edited by a moderator:

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,268
Reaction score
1,422
First Language
English
Primarily Uses
RMXP
Switches and variables are saved in the data files and it is possible to rearrange them even if it is tedious.

RPG::System contains the names of the switches and variables.

  • System.rvdata2
The actual use of the events are stored in the various events (map/battle/common) which you would need to read and change as appropriate.

  • CommonEvents.rvdata2
  • MapXXX.rvdata2
  • Troops.rvdata2

I have something like that a while back for RPG Maker XP: http://www.mediafire.com/download/uxo1m3zznog/SwitchSwapper.zip

Anyone can feel free to reuse the concepts and code in a RPG Make VX Ace script.

*hugs*
 
Last edited by a moderator:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
Give me some time then. Since my english isn't so good. XD
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I have written a script that extracts all event commands to text files. Based on that, I can tell you that a script to do as you're requesting (ignoring the "combine 2 or more common lines into a common event" request) will have to be very detailed, and will fall to pieces the very moment you use a Call Script command, or a Script command in a move route, or something in your Scripts file, that references switches or variables.


Assuming the developer has done NOTHING like that, you would need to check conditions on common events, troop events, and individual pages of map events. There are also many commands that either change or use switches or variables (especially variables), as well as use of \v[x] in commands that show text and even database descriptions.
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
I would be okay with parts of all that. For example, it the script doesn't change variables in battle events, that's all right, too. :) I could do EVERYTHING manually, of course, but every bit helps to reduce the workload.

I also don't have ANY script calls anywhere.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Reconsider that ... why would you want a script that changes variables in some places but not others? It would be even WORSE than having to go through and do it manually - some references to a variable id would be correct, but some would be incorrect, so then you'd STILL have to find every one, and in addition, you'd have to look at its context and decide whether it needs to be changed or not.


If you have a script do this, you WANT it to be incredibly thorough. Otherwise you're going to end up with an absolute mess of a game. And even if I were writing this script myself, I would tell you to backup EVERYTHING beforehand, or I would force you to do it by writing the backup of all files into the script, because changing your database and your map files in such a significant way is NOT something I would trust myself to do accurately right up, and all it takes is for you to run it once, with one mistake in it, and you'll end up with a potential disaster.


Also, think more carefully about your idea of converting repeated commands into a common event. I can understand why you'd want to be able to (and I understand your reasons for the other parts of your request - I'm a bit OCD and your desire to have everything "just right" is perfectly reasonable). But what you're asking here could make your project VERY unreadable and difficult to maintain.


It would create goodness-knows-how-many common events - all unnamed, some with as few as 2 lines, and not grouped logically. So you'd have to investigate each one, give it an appropriate name, and then, since you're so particular about how everything is ordered in your database, you'd want to shuffle them all around everywhere so they're grouped in a logical order. That would be a HUGE amount of work (work which isn't necessary and is taking you away from actually getting your game done). In addition, you'd end up with events on your map that will consist of a few understandable lines here and there, with lots of 'call common event' commands scattered through it. You could end up with events that are almost nothing but 'call common event' commands, for the sake of merging 2 lines into 1. And if you really wanted to see everything that event was doing, you'd have to look up each of those common events to see what's happening inside them. Again, making your project difficult to follow and more difficult to maintain.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
What is that script doing that I couldn't do with the cut-paste or multi-copy functions?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I think you have missed the point (and ignored everyone else's posts that have been made in this thread discussing the complexity of this request).


The request was to allow the user to move a common event or change a variable that's being used. This requires you to not only move the common event or change the variable in the database, but to go EVERYWHERE ELSE in the project where that common event or variable could be used, and change it to the new one as well.


Not much point in moving a common event 15 to slot 18, if all of your map events are still calling common event 15 ;)
 

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,268
Reaction score
1,422
First Language
English
Primarily Uses
RMXP
It is a nice concept you have theodoric.

To expand on it I suggest you also look through references to the ids and change those as well. This would make your tool truly useful and less of a hazard.

A fun aspect of the problem are ranges such as batch change of switches and variables. How should you deal with those?

@Shaz:

This present an excellent training opportunity :D

Can you create a cross-references tool? One where given an id (5, 42, etc) and type (actor, weapon, switch, etc.) it will tell you where that is used. You know, in which events, page properties, etc.

Just ask if you need anything or want advice. I may be kind and give it to you.

Not that such a tool would be useful in solving the OPs problem >_>

*hugs*

 - Zeriab
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
why would you want a script that changes variables in some places but not others? It would be even WORSE than having to go through and do it manually - some references to a variable id would be correct, but some would be incorrect, so then you'd STILL have to find every one, and in addition, you'd have to look at its context and decide whether it needs to be changed or not.
Well, I, personally, am relatively sure that I know about all instances of these more "advanced" uses of switches or variables in my project, because I don't use them all that often. So I can find and change them manually. Single instances I missed would certainly be discovered during testplay. But simple "Change Switch/Variable" commands I use all over the place. This might render the script not that useful for people who tend to use those commands not covered a lot, of course, but for people like me, it would be super helpful. :)

It would create goodness-knows-how-many common events - all unnamed, some with as few as 2 lines, and not grouped logically. So you'd have to investigate each one, give it an appropriate name, and then, since you're so particular about how everything is ordered in your database, you'd want to shuffle them all around everywhere so they're grouped in a logical order. That would be a HUGE amount of work
I agree on this one. It was merely a crazy idea of mine in the first place, so the top priority would be the sorting of multiple common events at once, followed by changes of switch/variable order in simple "Change Switch/Variable" commands, followed by the more "advanced" ways of using switches/variables (like in "Get Location Info", for instance). So if anyone would like to only give me the possibility to shift multiple common events around like the script in the linked topic does for single ones, that would already be a great help for me. I don't ask for a script that does everything I mentioned. :)

@theodoric: I'm afraid your script doesn't do the things I wanted to do. There must have been a misunderstanding. I'm sorry you translated it only to hear that it was in vain. :( Well, maybe someone else can take advantage of your translated version now.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top