Where are we going to put the scripts? I suggest that we make a folder called Data/Scripts and put all scripts in there. The scripts will be simply .rb files and the filename will be their order number in the script editor plus a dot and the script name. e.g.
0.Game_Actor.rb
1.Game_Party.rb
2.Game_Switches.rb
We can easily put all scripts in a file called Scripts.arc when we compile it all and put it into the MsgPack format.
Files not matching this pattern will be ignored when loading the scripts. These files also won't be put into Scripts.arc.
will the order number also affect the load order, as we all know with RGSS, some scripts need to be above or bellow other script in order to make them work properly
also, would there be a main.rb and what would happen if you had like 0.Game_Actor.rb and 0.Game_Party.rb, would it then go in alphabetical order
This is for development only.
The scripts will be packaged together in a single file for the release version.
That's what the numbers at the beginning are for. We can't leave just the names as there would be no way to know in which order to load the scripts except if we used an external file. I want to avoid such a file, because the deletion of that file will mess up your script order. So we are using those numbers at the beginning of the filenames to determine which order the scripts are in.
The scenario with 0.Game_Actor.rb and 0.Game_Party.rb will never happen if you use the editor (and should never happen because it is actually an invalid order). But if you edit the scripts manually, you can make this happen. In this case we have to use the alphabetical order so the editor doesn't crash.
you could also stick a comment in the first line of each script and then make some simple code to read the first line of each file and determine the order. It's a bit slower, but since it is a one time process the tradeoff for filename cleanliness could be worth it.
Not really. Deleting a script or changing order would be too messy.
Quote from: Blizzard on August 21, 2011, 03:34:52 am
...make a folder called Data/Scripts and put all scripts in there...the filename will be their order number in the script editor plus a dot and the script name...we can easily put all scripts in a file called Scripts.arc when we compile it all and put it into the MsgPack format...files not matching this pattern will be ignored when loading the scripts. These files also won't be put into Scripts.arc.
That.. I think it's a very good idea.