Advertisement
Guest User

bla

a guest
Apr 26th, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.13 KB | None | 0 0
  1.  
  2. # Fix Pillars of Eternity save game with locked 1 per Encounter ability (In my case Grimoire Slam)
  3.  
  4. # mkdir save
  5. # cd save
  6. # unzip ../*.savegame # unzip only one you want to fix
  7. # cp MobileObjects.save  MobileObjects.save_ORIG
  8.  
  9. # Run in python interpreter:
  10.  
  11. import re
  12. data = open('MobileObjects.save_ORIG').read()
  13.  
  14. # Fix / patch (selected as the most common in my savegame)
  15. good='m_activated\x06\x01\x11\x01\x06\x01\x00\x06\x01'
  16.  
  17. # Pattern to find and fix (only 1 occurence in my savegame)
  18. pattern='m_activated\x06\x01\x11\x01' + '\x06\x01\x01\x06\x01'
  19. fixed = re.sub(pattern, good, data)
  20.  
  21. f = open('MobileObjects.save', 'w')
  22. f.write(fixed)
  23. f.close()
  24.  
  25.  
  26. # zip -r 'savegamename.savegame' *
  27. # cp savegamename.savegame ..
  28. # Try loading
  29.  
  30.  
  31. # Useful snippets
  32. #print "\n".join(repr(x).replace(r'\t', '\\x09') for x in re.findall('m_activated\x06.{8}', data))
  33. # Various states (you need to select the one connected with the grimoire/broken ability
  34. # set(repr(x).replace(r'\t', '\\x09') for x in re.findall('m_activated\x06.{8}', data))
  35. # My broken pattern:
  36. # m_activated\\x06\\x01\\x11\\x01\\x08\\x01\\x00\\x06\\x01'
  37. # Author: bla
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement