Advertisement
Faschz

Majora's Mask - SoS Message Script

Nov 4th, 2018
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. -- sos_messages.lua
  2. --
  3. -- For use with Majora's Mask (U)
  4. -- Open up the Song of Soaring menu before activating the script
  5. -- The resulting messages will be stored in a file called 'SoS_Messages.txt'
  6. --
  7. -- Author: @Faschz
  8. -- Created: November 4th, 2018
  9.  
  10. -- Address for the message table and corresponding length of message in the table
  11. MESSAGES = 0x1D0714
  12. LENGTH = 0x1D07C4
  13.  
  14. file = io.open('SoS_Messages.txt', 'w')
  15.  
  16. -- Normally there are 11 messages in game...
  17. -- However, with clever use of 'Index Warp' new strings can be written
  18. -- to the text box that appears. This also overwrites unintended ranges of
  19. -- memory.
  20. for m=0, 10 do
  21.     length = mainmemory.read_u16_be(LENGTH + m*2) - 1
  22.     for c=0, length do
  23.         file:write(string.char(mainmemory.readbyte(MESSAGES + m*16 + c)))
  24.     end
  25.     file:write('\n')
  26. end
  27.  
  28. file:close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement