Export contents of an event to a txt file script?

Is there any scripts that can export the contents of an event to a txt file using a custom script call that comes with the script?

This would not only benefit me, but anybody else who is looking to troubleshoot big or complex events. Screenshots can only capture what is visible. A txt file would capture everything the event has in it.

Ideally, the script call would be placed at the top of a not working properly event and it will log everything in the event to a txt file while retaining indentations made by conditional branches as such.

The generated txt file could be uploaded to the forums in one of the help boards.

Is there anything like that or could one be made?

I would appreciate a script like this and I am sure that many people could benefit from something like this.
Seems that there's actually a script for that:
In line with that script I understand the intent of @MoltresRider
You keep asking for help and people want to see your event.
While it is very difficult to create an exact replica of your event in a text file, using Shaz's Extract Events script and this add on I made you can use a command to get the contents of an event to share with us.
Spoiler: Shaz's Extract Events Addon
Ruby:
#============================================================================
# EXTRACT EVENTS - Addon Event Specific Command
# v1.01 by Shaz
#----------------------------------------------------------------------------
# This script extracts ALL event commands into a number of text files.
# These can be opened in a spreadsheet, split into columns, searched and
# sorted.
#
# The difference with this and the original script by Shaz is that this
# will run only with the event script command.
# be sure to disable the last line in Shaz's script before playing
#
# Data/Map(id)-Event(id)-Contents.txt
# Contains ALL event commands
# - useful for perusing, searching for anything in any event
# - this also includes everything in the following two files
#
# Data/Map(id)-Event(id)-Dialogue.txt
# A subset of EventContents.txt
# Contains any event commands to do with text - Show Text, Show Choices,
# actor names, etc
# - useful for proofreading and translation (there is no facility to replace
#   text with translations - this is JUST an extract)
#
# Data/Map(id)-Event(id)-SwitchesVariables.txt
# A subset of EventContents.txt
# Contains any event commands and conditions to do with switches and variables
# - useful for finding where they've been used
#----------------------------------------------------------------------------
# To Use:
# You "call" this script command with a script command at the start of the event
#     export_event
#
# The script will extract the event contents and export
# to text files in data folder 
#
# Once the files have been created, open them in a spreadsheet and use the
# Text to Columns feature to separate based on your chosen delimiter
#----------------------------------------------------------------------------
# Terms:
# This is a DEVELOPMENT ONLY script.  You may use it when creating free or
# commercial games, but PLEASE remove the script before the game is released.
# You do NOT need to credit me in the game.
# If you share this script, PLEASE keep this header intact, and include a
# link back to the original RPG Maker Web forum post.
#----------------------------------------------------------------------------
# Revisions:
# 1.00  Sep 20 2023 - Initial Publish
#============================================================================

module EVExport
  @cb = ","
  def self.export_event(map, id)
    @file_all = File.open("Data/Map#{map}-Event#{id}-Contents.csv", 'w')
    @file_text = File.open("Data/Map#{map}-Event#{id}-Dialogue.csv", 'w')
    @event_seq = 3
    $game_map.setup($game_map.map_id)
    @event = $game_map.events[id]
    return if @event.nil? || @event.pages.nil?
    for page in [email hidden] - 1
      @event_tab = (page + 1).to_s
      @cond = @event.pages[page].condition
      @list = @event.pages[page].list
      self.export_event_list
    end
    @file_all.close
    @file_text.close
  end
  def self.export_command
    # get rid of any double spaces
    while @arg.gsub!(/  /) { " " } != nil
    end
    @expline += 1
    indchar = INDENT ? @ind * @indent : ""
    text = sprintf("%s%s%s%s%s",
      @cmd, @cb, indchar, @arg, @lb)
    @file_all.print(text)
    @file_text.print(text) if @text_export
  end
end
   
class Game_Interpreter
  def export_event
    EVExport.export_event(self.map_id, self.event_id)
  end
end
Use the event script command - export_event

Then it will make three text files in your data folder.
With the map and event id numbers included
e.g. Map7-Event12-Contents.txt

* The most important part though is to disable the last line in Shaz's script, Other wise it will run every time you do a play test.
1695224292940.png
Neither of those scripts work for me and I am having an issue with an event.

Every time the script call runs, I always get "RGSS3 Player has stopped working"

And no txt files are generated.


Edit: I had to do some tinkering. I got it to work.
Neither of those scripts work for me and I am having an issue with an event.

Every time the script call runs, I always get "RGSS3 Player has stopped working"

And no txt files are generated.


Edit: I had to do some tinkering. I got it to work.
I updated the code above, now it will save as a csv file (for excel) and it does not have all the data at the beginning of the line for the event info, just the command and text.
Should be easier when you need to share info.

Original thread: https://forums.rpgmakerweb.com/threads/export-contents-of-an-event-to-a-txt-file-script.161297/