I'd like to be able to use the Battle Factory poccil added to the kit a little while ago for a very simple project, but it doesn't work. I imagine most people around here don't use the Frontier-type functionality too often (that's the impression I get, anyway, and I seem to be the first one to point out these errors) so I'm not sure if anyone will be able to help fix it off the bat... but maybe one of you more experienced scripters will at least know where I'm actually supposed to look to fix the problems myself, because as it stands now I can't even figure that out. :/
All right, time to paint a picture. I started with a clean, unedited copy of the latest version of Essentials (April 12th). I can playtest it/run the Game.exe and access the Battle Factory through that "Where would you like to go?" computer. I can speak to either attendant at the desks and get as far as confirming that I'd like to make a challenge. The game then gives me the option to "not generate teams" (run off of the default bttrainers and btpokemon files, I think), "generate existing teams" (pull from bttrainers or from any of the other files in trainerlists, like pikacup or fancycup), or "generate new teams" (which, if I'm understanding this correctly, uses the PokemonOrgBattleGenerator script to generate a selection of pokémon/moves completely at random). If I select "generate new teams", it tells me that the process will take a long time; if I confirm it, it starts to run the script, but then it throws this error:
I tried glancing at the scripts and lines in question and, unfortunately, couldn't make heads or tails of most of it or figure out what was wrong. I did notice that the code around line 183 in PokemonMultipleForms is where it starts defining the script for east/west shellos and gastrodon, and figured out that that one complaint, at the very least, was because there was no map data or similar defined for those pokémon's alternate forms and the generator didn't know what to do. That's probably an easy enough fix, even easier for me since I don't need shellos, gastrodon or any multiple-form pokémon at all at this point, so I commented that out and tried again. That got rid of all the complaints about PokemonMultipleForms, but then came up with this new error:
I can see that it's still having other issues with the PokemonOrgBattleGenerator script, in addition to the towersingleopen.rxdata file, but I'm not sure what those issues are or how to fix them. Everything looks like it's in working order according to my untrained eyes, though it's possible that I'm missing something.
Now, having the ability to generate brand new, random teams would be fun, but I don't
need it for my projects; all I need is the standard list of pokémon and trainers, and I can work with the other files (pikacuptr.txt, etc.) as well. So if no one knows how to fix that then it's no big deal. Unfortunately, though, the part of the factory that I *do* need is broken as well. If I tell the attendant that I don't want to generate any teams, or if I tell him to "generate from existing" and select one of the whatevercuptr files, it lets me save the game and follow him into the next room; it then throws another runtime error before it lets the game take my team and start the swap script.
I'm afraid I have absolutely no idea what's going on there, as I don't *think* there's anything wrong with the pbPrepareRentals section of code (line 737 in PokemonOrgBattle, iirc) it's complaining about.
And now for what's probably the biggest problem of all. I experimented with a few of the other Frontier-type facilities after being thoroughly stumped by these errors. I don't actually need any of the others, but I thought I might see whether or not they worked out of curiosity. I figured they would be okay--the second most recent version of Essentials that I have has a functioning Battle Tower, though that was the September 5th '09 release so much has obviously been changed. Anyway, as long as I don't select the "generate new teams" option, I can actually start a challenge in both the Battle Tower and the Battle Arena. I can select an attack and have my pokémon use it... and then it's my turn again. :/ If I don't knock the opponent out with my attack, it will just do nothing and immediately jump to my turn. If the opponent faints, the other trainer will not send out a new pokémon and it's
still my turn; I can select an attack, but obviously it says that there's no target and accomplishes absolutely nothing before going back to my turn
again. The opponent is completely unable to make a move, leaving me with no choices but a) forfeit, b) attack empty air until I run out of PP and am forced to struggle (I have no idea what would happen then, and I don't feel like sticking around to find out), or c) close the game outright*. There's no error message and no crash; the game just hums happily along while skipping the opponent's turn and leaving me stuck.
So I tried battling a normal, non-facility trainer on one of the test maps to see if something similar happened. It didn't, of course; the battles progressed as normal and my opponent's turn was never skipped. (And since regular trainer battles are a part of the kit that people actually
use, I'm sure someone would've said something before now if that was broken.)
What this means, as far as I can tell, is that the way normal trainer battles and "facility" trainer battles are handled is different. Whatever Essentials is using to make Frontier facility turn order work properly is fine and dandy as of September 5th of last year, but sometime between then and the April 12th release it was broken by some change or other. I've tried scouring the changelogs but so far haven't had any luck, especially since I can't quite tell which parts of which scripts are responsible for turn order and the like in the first place. It may very well be an easy fix--maybe all that needs to be done is copying and pasting something from whatever handles normal battles over to whatever handles Frontier battles--but I don't know what I'm looking for so that I can try that. :/
I realize that that's rather a lot to look through, but if you have any time to help out or point me in the right direction, even if it's just for one part of one problem, I'd really appreciate it. Thanks in advance.
*
Interestingly, this causes yet another problem--if I close the window without exiting the facility properly and then restart, the game erases all the pokémon in my party save for those I actually entered into the challenge. I haven't looked into why this happens yet, though I suspect it has to do with the game not saving them into the appropriate variable properly. I'm not terribly concerned about this at the moment--worst comes to worst I can just warn people "don't close the game without saving properly", and the project I'm working on won't involve any of the standard training/catching/leveling anyway so it's no great loss--but it seems like a rather nasty problem for someone who might be playing a game with a team they've actually spent time raising, etc..