Page 1 of 1

KoA: Reckoning - 010 Editor Templates/Scripts

Posted: Wed Dec 25, 2019 8:03 am
by atom0s
Here is a simple script to read the 'xp_to_level_table' entry inside of the compiled lua_bxml file:
  1. // Read and print the table name..
  2. local int table_name_len = ReadByte(FTell());
  3. FSeek(FTell() + 1);
  4. local string table_name = ReadString(FTell(), table_name_len);
  5. FSeek(FTell() + table_name_len);
  6. Printf("String Length: %d\n", table_name_len);
  7. Printf("String       : %s\n", table_name);
  8.  
  9. // Read the entries..
  10. local int index = 0;
  11. local int x = 0;
  12. local int entry_t = 0;
  13. local int entry_v = 0;
  14.  
  15. for (x = 0; x < 46; x++)
  16. {
  17.     BigEndian();
  18.     entry_t = ReadByte(FTell());
  19.     entry_v = ReadUInt(FTell() + 1);
  20.     LittleEndian();
  21.     Printf("Type: %d || Index: %d || Value %d\n", entry_t, index, entry_v);
  22.     FSeek(FTell() + 5);
  23.     index++;
  24. }