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?