Add flatbuffer schema & conversion bat files

put encount_data_*.bin in the same folder, run bin2json to get json for
use in GGWE, replace and use json2bin to get encount_data_*.bin
This commit is contained in:
Kurt
2018-11-26 16:12:49 -08:00
parent 7b61760420
commit 3442fbcbb7
4 changed files with 73 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
for %%f in (*.bin) do call flatc -t encount_data.fbs -- %%f --defaults-json --raw-binary
pause

View File

@@ -0,0 +1,69 @@
namespace pkNX;
table EncounterTables7b {
EncounterTables:[EncounterTable7b];
}
table EncounterTable7b {
ZoneID:ulong;
TrainerRankMin:uint;
TrainerRankMax:uint;
GroundSpawnAllowed:bool;
GroundSpawnCountMax:uint;
GroundSpawnDuration:uint;
GroundTableEncounterRate:uint;
GroundTableLevelMin:uint;
GroundTableLevelMax:uint;
GroundTableRandChanceTotal:uint;
GroundTable:[EncounterSlot];
WaterSpawnAllowed:bool;
WaterSpawnCountMax:uint;
WaterSpawnDuration:uint;
WaterTableEncounterRate:uint;
WaterTableLevelMin:uint;
WaterTableLevelMax:uint;
WaterTableRandChanceTotal:uint;
WaterTable:[EncounterSlot];
OldRodTableEncounterRate:uint;
OldRodTableLevelMin:uint;
OldRodTableLevelMax:uint;
OldRodTableRandChanceTotal:uint;
OldRodTable:[EncounterSlot];
GoodRodTableEncounterRate:uint;
GoodRodTableLevelMin:uint;
GoodRodTableLevelMax:uint;
GoodRodTableRandChanceTotal:uint;
GoodRodTable:[EncounterSlot];
SuperRodTableEncounterRate:uint;
SuperRodTableLevelMin:uint;
SuperRodTableLevelMax:uint;
SuperRodTableRandChanceTotal:uint;
SuperRodTable:[EncounterSlot];
SkySpawnAllowed:bool;
SkySpawnCountMax:uint;
SkySpawnDuration:uint;
SkyTableEncounterRate:uint;
SkyTableLevelMin:uint;
SkyTableLevelMax:uint;
SkyTableRandChanceTotal:uint;
SkyTable:[EncounterSlot];
}
table EncounterSlot {
Probability:int;
Species:int;
Form:short;
}
root_type EncounterTables7b;
file_extension "bin";

Binary file not shown.

View File

@@ -0,0 +1,2 @@
for %%f in (*.json) do call flatc -b encount_data.fbs %%f --defaults-json
pause