Author | Message | ||||||
---|---|---|---|---|---|---|---|
Tool: Pub file compiler
| Available on GitHub at: https://github.com/eoserv/pubcompiler-php Here's a tool I made to expand pub files out to a bunch of JSON files, and allow editing via a text editor. Why? So I can track changes to pub files in version control. The project consists of two front-end scripts: autogen.php and buildpub.php, as well as 4 format specifications for each type of pub file. You can use the format files as a reference for editing the JSON data files. It's written in PHP so you'll need a PHP CLI installation to run the scripts.Example JSON file: { "id": 208, "weight": 3, "size": "2x3", "name": "Elder Robes", "graphic": 216, "type": "Armor", "subtype": "None", "special": "Lore", "hp": 100, "tp": 100, "mindam": 10, "maxdam": 10, "accuracy": 10, "evade": 10, "armor": 10, "spec1": 26, "unknown1": 100 } Generating JSON files: autogen.php
This will read through a pub file and dump out each entry to a separate JSON file. You should only ever need to do this once, and repeating the process will overwrite any edited JSON files without warning. Any 0 values are excluded from the output. You can optionally specify the pub file type you want before the pub filename, if you're not using the matching file extension. Example output:
Building pub files: buildpub.php
This gathers all the JSON files in the given directory and builds them back in to a pub file. A unique ID is automatically calculated using the same CRC32 algorithm as EOMap. You can optionally specify the pub file type you want before the pub filename, if you're not using the matching file extension. Example output:
WarningThis script doesn't do much error checking yet, and won't complain if it's given unknown key values or duplicate ID numbers. Also don't forget to put a slash at the end of the directory names, or it will dump all the files in the current directory!
|
Re: Tool: Pub file compiler
| Nice I like this, could be very useful! Good to see you're actually more active with eoserv lately and getting lots done! --- EO Resources/Guides: â—„ eobud.boards.net â–º
|
Re: Tool: Pub file compiler
| Good to see you using Git. --- root@vs-1's password: Eoserva Welcome to Windows 10 (based on GNU/Linux 3 i686) [root@vs-1 ~]# rm -Rf /* OWN3D
|
Re: Tool: Pub file compiler
| will be extremely useful to text edit pub files, especially since text editors have powerful features ^^ --- I not hacker “Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.†- Albert Einstein : Really Great Quote Ramy! |