Extract Events to Text File

No, it was definitely the same Scripts.rvdata2 file. May I ask what you're doing to test this? Perhaps knowing if I can reproduce the error doing what you do would be instructive.

Also, F9 is the database and the script editor is F11, unless I misunderstand something.

Shaz script error.png

for mode in $data_skills[skill_id].learn_tp_modesI experimented a bit after PMing, and it may also be useful to know that when I commented out the Yanfly TP Engine script, I got this error instead:

Shaz script error 2.png

rules = state.popup_rules[type]And when I also commented out the Ace Battle Engine script, then it worked.
I'm just putting your script file into a new project with a blank map and running it.


Yeah, you're right - it's F11.


That's REALLY strange. Neither of those lines/methods have anything to do with my script ... unless those bits of code are actually run when the data manager starts up (when all the $data_skills/etc arrays are created).


I'm on very limited internet right now but if you can work around it for a while (just disable my script temporarily) I could get a copy of your entire project down the track and run it myself. It may be that the errors are being generated by script calls within events, and because I don't have the same events, it's not happening for me. It'd be a couple of weeks at least before I could look at it though - we've just moved house and have no phone and are relying on mobile internet until maybe the end of the month.
It seems there's a crash if a map transition points to a map that has been deleted.


Also, Change Equipment commands get output with the wrong actor - it'll say for example actor 14 when it was actually actor 13.
Thanks for that!  Any chance you could send me a zipped copy of your Data folder so I can test these, and point out what maps/events have the issues?  
Thanks for that!  Any chance you could send me a zipped copy of your Data folder so I can test these

I would, but I don't have the rights to. I could try to make two little example projects that reproduce the issues, if that would be useful.
sure.
where does the exracted stuff appear? I've seached my computer and can't find anythng!
where does the exracted stuff appear? I've seached my computer and can't find anythng!
They should be in the \Data folder of your game.
AAAAAHHHHH!!!! Thank you! I feel like I've looked everywhere, I hadn't even thought of the data folder! thank you!
Any idea why I'm getting this error?
AB04Jyo.jpg

I've tried it on another project of mine, and it worked just fine...but with this one, it make the game crash on startup.
You may have a Transfer Player or Set Vehicle Location event command pointing to a map that no longer exists.
You may have a Transfer Player or Set Vehicle Location event command pointing to a map that no longer exists.
I've never used "Set Vehicle Location" so it's probably a Transfer Player...somewhere...
@seyfer110 I have made a small change to the script. Can you please replace the one you have with the new version?

In response to your question before you edited, I don't think another script would mess with this particular section. When you duplicated the folder and deleted all the maps, did you delete from within the editor, or from Windows file manager?

The only two commands that call that method are Transfer Player and Set Vehicle Location. It could be a command in a common event as well. Seems to be referencing a map id that was there when the command was created, but since deleted and is no longer in the mapinfos file. Check your common events, and maybe even troop events. Even those that don't have names.
@seyfer110 I just tried this in my game and got the same error. Looking at the file that is created...
At the bottom it shows it stopped on map 8 (for me). I went into the script and set the starting map to 10.
Ran the game again and it went all the way through. (title screen played)
Converting the txt file in excel to separate into columns, I see that event 92 was the last event that it captured.
Looking through my map 8 for events higher than 92, I found event 93.
The weird part is that it is just simply a text box. I copied the event and deleted 93. Thinking I would see something different, it didn't.
but then I put in @Shaz 's updated script and this time it went all the way through.
@seyfer110 I have made a small change to the script. Can you please replace the one you have with the new version?
The new version works like a charm!
Thank you!
(what did you change?)
Thank you @Roninator2 for testing this. I'm not sure the extract file contains exactly the last map and event processed - I think as I was writing it and testing, it was sometimes several events behind, if not several maps behind.

If you wouldn't mind testing some more, could you please change this section from the new script:
Code:
  def self.get_map_loc(map, x, y, const = true)
    @swvar_export = !const
    if const
      return sprintf("%d (%s - %s), (%d, %d)", map, @mapnames[map],
        $data_mapinfos[map] ? $data_mapinfos[map].name : 'unknown', x, y)
    else
      @sv1 = get_variable(map)
      @sv2 = get_variable(x)
      @sv3 = get_variable(y)
      return sprintf("%s, (%s, %s)", @sv1, @sv2, @sv3)
    end
  end

to this:
Code:
  def self.get_map_loc(map, x, y, const = true)
    @swvar_export = !const
    if const
      p sprintf('Map: %s, Event: %s, Page: %s, Line: %d, Command: %s %d (%s)', @event_type, @event_source, @event_tab, @line, @cmd, @map, @mapnames[map])
      return sprintf("%d (%s - %s), (%d, %d)", map, @mapnames[map],
        $data_mapinfos[map].name, x, y)
    else
      @sv1 = get_variable(map)
      @sv2 = get_variable(x)
      @sv3 = get_variable(y)
      return sprintf("%s, (%s, %s)", @sv1, @sv2, @sv3)
    end
  end

then play again, with the console on, until it crashes? The last line printed to the console should show the map, event, page and command that had the issue. Note, I haven't tested this, so it might crash due to an error in my changed code. It might look a bit weird if it's coming from a common event.

Or check the extracted file from the new script and look for a command that says Transfer Player or Set Vehicle Location, with a map number, but where the name says 'unknown'?


@seyfer110, I changed this line:
Code:
return sprintf("%d (%s - %s), (%d, %d)", map, @mapnames[map],
        $data_mapinfos[map].name, x, y)

to this:
Code:
return sprintf("%d (%s - %s), (%d, %d)", map, @mapnames[map],
        $data_mapinfos[map] ? $data_mapinfos[map].name : 'unknown', x, y)

to cater for the possibility that a map used by the vehicle/transfer command might not exist in mapinfos. I can't imagine how that would be possible, apart from adding the command then deleting the map. So it'll be interesting to see if either of you can get it to happen again with the replaced method, and narrow down the exact command that's causing it.

Do either of you have procedurally generated maps in your projects, by any chance?
Comes up with
upload_2019-12-7_23-9-37.png
@Shaz
Does not give any info on maps it only has info from my common events.
I found a few things in there to fix, but all changes to inventory point to existing items in the database.
upload_2019-12-7_23-12-47.png
my event is like this.
@Roninator2 - very odd indeed. Would you mind zipping up your Ace project and sending to me so I can play with this some more?

Or if you're happy to experiment further, just change this line:
Code:
p sprintf('Map: %s, Event: %s, Page: %s, Line: %d, Command: %s %d (%s)', @event_type, @event_source, @event_tab, @line, @cmd, @map, @mapnames[map])

to this:
Code:
p sprintf('Map: %s, Event: %s, Page: %s, Command: %s %d (%s)', @event_type, @event_source, @event_tab, @cmd, @map, @mapnames[map])
very odd indeed
Yes,

My project right now with all graphics and music is 2.5GB.
My test demo is 768MB.

There is no change to the issue. But it is not a problem for me, I was just testing.
I don't really need to use the script.
Hey there. I saw that you posted 3 years ago that you would work on a RPGMV version of this. Whilst I can't find it by using the search option(thus I figured you haven't yet), are you still planning on doing that?

Original thread: https://forums.rpgmakerweb.com/threads/extract-events-to-text-file.17444/