Advertisement
yoorgh

RPGVXAce Text Replacement

Nov 6th, 2017
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.78 KB | None | 0 0
  1. begin
  2.  
  3.   # 1. Paste this script right above main
  4.   # 2. Run the game once in playtest mode, then exit
  5.   # 3. Close and reopen RPG Maker WITHOUT saving
  6.   # 4. Delete this script immediately afterwards
  7.  
  8.   old_string = "Ralph" # EDIT HERE
  9.   new_string = "Bongo" # EDIT HERE
  10.  
  11.   map_files = Dir['Data/Map???.rvdata2']
  12.   map_files.each { |file|
  13.     map_data = load_data(file)
  14.     map_data.events.each_pair { |i, event|
  15.       event.pages.each_with_index { |page, j|
  16.         page.list.each_with_index { |command, k|
  17.           if command.code == 401
  18.             text = command.parameters[0].gsub(old_string, new_string)
  19.             map_data.events[i].pages[j].list[k].parameters[0] = text
  20.           end
  21.         }
  22.       }
  23.     }
  24.     save_data(map_data, file)
  25.   }
  26.  
  27. end if true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement