Rpg Maker Scripts Storing Algorithm for Scripters - Printable Version +- Save-Point (https://www.save-point.org) +-- Forum: Games Development (https://www.save-point.org/forum-4.html) +--- Forum: Tutorials (https://www.save-point.org/forum-19.html) +--- Thread: Rpg Maker Scripts Storing Algorithm for Scripters (/thread-4369.html) |
Rpg Maker Scripts Storing Algorithm for Scripters - Narzew - 09-18-2012 Hello. I'm explained the RMXP/VX/VXA scripts.rxdata structure and want to explain it to all. It has an array structure. Firstly, it's unique script ID. (??) (I wanna check more..) Secondly, it's script name. Thirdly, it's Zlib compressed script source. For Example : Script.rxdata = [ [23333439, "*First script", Zlib["source_code_of_script1"]], [39283232, "*Second script", Zlib["source_code_of_script2"]] ] The algorithm is not fully checked. It's works with unpacking. I'm not test it with packing too. If you want to build scripts.rxdata use 0 as first argument :) The second and third is 100 % checked. I must check the first unique ID generation :) I'll add it so soon. Nice working. Some practice : Content Hidden Nice working. RE: Rpg Maker Scripts Storing Algorithm for Scripters - hanetzer - 07-27-2013 As always this is an entirely too useful script; I've used it to load the entire Scripts.rxdat into my irb session. As a monument to the eternity of the internet here is the script: Code: require 'zlib' RE: Rpg Maker Scripts Storing Algorithm for Scripters - hanetzer - 03-06-2014 Heyo! Been fiddling with this for the sake of the ReGaL engine, and made a bit of what I'd call an improvement to it; instead of one large text file, It now dumps to individual files for each script; my code (thanks for the start Narzew): Code: def save_script(scriptfile='Data/Scripts.rxdata') RE: Rpg Maker Scripts Storing Algorithm for Scripters - hanetzer - 03-15-2014 I have completed your script; It can now be used to 1. Write scripts from Scripts.rxdata to individual script files and 2. Reconstitute the scripts from the individual scripts saved from the first use. The resultant Scripts.rxdata is in fact a perfect binary match for the original, sharing the same md5sum and sha512sum. Note, this is only because the dumped scripts were not edited; but, obviously, if you make changes to the script it will affect the output of the final scriptfile. I only state the fact its identical because it proves the process is perfect. Code: #!/usr/bin/env ruby dissassemble_scripts("Scripts.rxdata", "ScriptIndex.dat") will write out all the scripts in Scripts.rxdata into individual script text files and save an index file as ScriptIndex.dat assemble_scripts("ScriptIndex.dat", "Scripts.rxdata") will reconstitute the (edited, if so desired) scripts using the index we saved as ScriptIndex.dat and save the reconstituted file as Scripts.rxdata; I've not tested with a file named Scripts.rxdata actually existing, so not sure if it will work (I had deleted the file after disassembly in order to make sure I wasn't simply seeing the original Scripts.rxdata and assuming success) |