• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Bug when about to battle a trainer

This is the second instance in which this bug popped up, and I have no idea what the trigger for it is - didn't then, still don't now.

Code:
---------------------------
Touhoumon Faith & Prayer Version 1.8
---------------------------
Exception: NoMethodError

Message: undefined method `[]' for nil:NilClass

PBIntl:578:in `getFromMapHash'

PBIntl:691:in `getFromMapHash'

PBIntl:751:in `_MAPINTL'

PokemonMessages:652:in `command_101'

Interpreter:304:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'



This exception was logged in 

C:\Users\Andrew_2\Saved Games/Touhoumon Faith _ Prayer Version 1_8/errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK   
---------------------------
I cannot figure out what the trigger is, if someone could enlighten me as to what us causing this I'd be much appreciative.
 
Can we see your trainers.txt?
 
It has nothing to do with the Trainer PBS file or the trainer battle itself, you seem to have a faulty event. The game is crashing when you're using the "show text" command in RMXP event editor.

Again, the error tells you exactly what's wrong. Command 101, the "show text" command (which you can find out with a quick Ctrl + Shift + F) is not working. Maybe you're typing in faulty text functions, like "\v[number]" with a variable that does not exist. Check through the "show text" options in the event, and find the mistake that's causing it.
 
Here's the event of one of the trainers acting up in question:
[PokeCommunity.com] Bug when about to battle a trainer

[PokeCommunity.com] Bug when about to battle a trainer


I don't have any fancy formating in the trainers, and the events are completely unedited. None of the events have fancy formating.
 
"pbTrainerBattle(PBTrainers::TAMER,"Ferdinand",_I("Help! I've been beaten by an average trainer!"),false,0,false)" is the code that is lodged inside the conditional branch.
 
Nothing seems to be wrong with that at first glance, but the interpreter seems to be spazzing out for some reason. Try deleting the event and re-creating it from scratch. See if you run into the same problem again. There could have been some hick-up during compilation or something.

EDIT: Maybe this could also happen if your individual "map#.rxdata" and "MapInfos.rxdata" have differences in map information. In any case, try making a new event with the same trainer battle (but not just copy-pasting the previous conditional branch), and see if you get the same thing again.
 
Last edited:
Like I said, I've encountered this error twice now. That was one of the first things I tried when I got the error. I don't think it's the event that's the issue, so much as it is the map. I have copied the event to a different map, and it works perfectly fine on that map.
I also made a new map, and copied the event to that new map, and then the game produces the same error again. So I'm honestly not sure what exactly is causing it.

EDIT:
EDIT: Maybe this could also happen if your individual "map#.rxdata" and "MapInfos.rxdata" have differences in map information. In any case, try making a new event with the same trainer battle (but not just copy-pasting the previous conditional branch), and see if you get the same thing again.


Would I go about that by just following the standard trainer creation procedure, then?
 
Last edited:
If the same event works on a different map, your map has to be faulty then (see my edit above). In any case, the error is not related to Trainer Battles messing up. If the interpreter is messing up, it could be due to bad compilation of map files.

EDIT: Check your other events on the map too. It could be that their errors are affecting the other event.
 
Then this raises two questions.
Question 1: Should I attempt a hard recompile (Holding Ctrl upon running the game from the editor)? Or is there another method I should do.
Question 2: I take it this would apply to brand new maps, maps created after I got the error, as well?

EDIT:
EDIT: Check your other events on the map too. It could be that their errors are affecting the other event.
But if it's the other events contributing, then the event would have worked when I placed it alone on a brand new map. The event I pasted was the event shown above.
 
Hehe, I'm not really too sure about those things. The most efficient solution would probably be to delete the entire map with all it's events, and then completely re-create them from scratch. I don't know what other advice to offer you. From the error report, what I gathered was, that the map was checking for some messages/text on the map, and it did not exist. There could be several things causing that though. If it's not the event, it should be the map then. It can't make sense that the map and the events are both fine.
 
To appease my curiosity, I just made a brand new event - dialogue only - and tested it. It also broke with the exact same error.
[PokeCommunity.com] Bug when about to battle a trainer

I'm gonna try testing creating a brand new event on a brand new map, see if it yields any results.

EDIT: Creating a brand new, sparkling like a perfectly clean and brand new object, event on a new map, made just a few seconds ago, yields the error result again.
[PokeCommunity.com] Bug when about to battle a trainer


EDIT 2: My friend had a theory that it is related to the Multilanguage that was provided in the Bug Reporting thread. It is a theory, but I can't see how that would explain events working on some maps, not working on others, and new events on new maps not working at all.
 
Last edited:
After downloading the current development version of Touhoumon Faith & Prayer, I got the trainers to speak (whereas they wouldn't before because the error popped up) by commenting out line 652 in PokemonMessages that triggered the error:

Code:
message=_MAPINTL($game_map.map_id,message)

I got a new error with these trainers, whereas I didn't with the other trainers on other maps:

Code:
---------------------------
Touhoumon Faith & Prayer Version 1.8
---------------------------
Exception: RuntimeError

Message: Script error within event 4, map 27 (Fuchsia City Gym):

Exception: NoMethodError

Message: Section043:578:in `getFromMapHash'undefined method `[]' for nil:NilClass

***Full script:

pbTrainerBattle(PBTrainers::TAMER,"Ferdinand",_I("Help! I've been beaten by an average trainer!"),false,0,false)

Interpreter:243:in `pbExecuteScript'

PBIntl:691:in `getFromMapHash'

PBIntl:751:in `_MAPINTL'

PBIntl:747:in `_I'

(eval):1:in `pbExecuteScript'

Interpreter:788:in `eval'

Interpreter:243:in `pbExecuteScript'

Interpreter:788:in `command_111'

Interpreter:320:in `execute_command'

Interpreter:193:in `update'



Interpreter:276:in `pbExecuteScript'

Interpreter:788:in `command_111'

Interpreter:320:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'



This exception was logged in 

C:\Users\Mugendai\Saved Games/Touhoumon Faith _ Prayer Version 1_8/errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK   
---------------------------
 
Mugendai and I have isolated the issue and it was, indeed, related to the Language scripts. Now I know for an undeniable fact that this time I followed FL's intructions to the very letter of his posts. We reverted the changes back to how they are in Essentials vanilla, and the trainers worked again. We're trying to isolate exactly what broke it now. I have a theory, but I'll save it for if the theory is actually correct.
 
Okay, we figured out the issue. The error activates if the corresponding map header is missing in the intl.txt/intl.dat files being used by the Language scripts, and in order to fix it, you have to extract and recompile the text.
 
Oh, ok. I was assuming this was vanilla Essentials error you were talking about (you didn't really indicate otherwise). Glad that you figured out what was causing problems.
 
Back
Top