Hi all, looking for help with Galv's duel minigame for Ace. I keep crashing when I try to enter a duel while using Victor's Actor Battlers, though both scripts work just fine for me on their own. I'm especially puzzled because Galv specifically added support for Victor's script.
The error that pops up when crashing is:
Script 'Victor Actor Battlers' Line 366: NoMethodError occured. Undefined method '*' for nil:NilClass
Here is the script snippet that it directs me to, with line 366 in bold.
# * New method: get_sideview_x
#--------------------------------------------------------------------------
def get_sideview_x
if VE_BATTLE_CENTRALIZE
size = $game_party.max_battle_members
x = dist[:x] / 8
position = -index * (index * x - x * size) + Graphics.width - 160
else
position = index * dist[:x] + Graphics.width - 192
end
position
end
Does anyone have any ideas? I would greatly appreciate the help, I've spent so much time on this project so far.
I don't have experience with either of these scripts, but I believe the error is happening because "index" hasn't been defined anywhere (in scope) at the point this line is hit. Look to see where "index" is defined ("index = blahblahblah...") and try to figure out why that line is not being hit before this get_sideview_x is being called.
Also, notice that the "if" branch is checking whether VE_BATTLE_CENTRALIZE exists at all (or whether it's set to True), but the line that is throwing an error (and therefore we know it's being called) is the else block! This means that VE_BATTLE_CENTRALIZE either doesn't exist at all, or is an option that is set to False. Check whether that's a user option or not. If it's not a user option, it means that it's looking to see whether a feature exists, and that feature is probably present in either one of Viktor's other plugins or in one of his Core scripts that you might need to add into your project. With that being said, "index" is also being referenced in the if block, so this may not solve your issue, but it's worth pointing out because the fact that the else block was hit here seems a little strange.
Wavelength,
Sound logic! I’ll look into it once I leave the office. I know that I have all prerequisites and that the scripts encounter no errors when used on their own in my project, so your hypothesis about a user option may very well be correct. If not, I’ll try backtracking and looking for the index snag.
Fingers crossed! If all else fails, I’ll post a copy of my demo for someone with far more knowledge on scripting than myself (isn’t hard to find lol).
I did a little poking through and narrowed it down, though I haven't figured out the answer yet. Hopefully with this, though, somebody who's familiar with the scripts can figure out what line to write.
There is a method near the beginning of Victor's script "def index" which defines the index it wants to use, I guess, of the actor for picking a sideview sprite or something. When I changed the long line in that method to just a "0", everything worked properly in Galv's duel system, and the normal sideview battle worked fine too.
I think that only having a 0 in there will mean that only the party leader's sprite will be displayed (for everyone), so if you are planning on having multiple characters in battle at the same time, this will not be a tenable solution. (It will be a good workaround if you only have one character at a time, though!) It did, however, lead us to the place where the problem is. We need to figure out what line to replace the existing code in def index with.
Can anyone help us figure out what line to write in here?
One other interesting note: When I left def index alone, and switched the "Battle Formation" option to :front rather than :side (leaving the "Centralize" option On), I got a different error that was very similar to the one you initially posted (except on line 364) - an undefined method "+" meaning that index wasn't defined. I still have no idea what "-@" is supposed to mean in the recent error you received (I got it too in your demo), but it might be a sign that there's some kind of incompatibility with Centralize On and Sideview Battlers when using the script together with Galv's.
Well, that was lucky then! 🙂 I hope someone can figure out what was actually happening here, but I'm glad the workaround has you set for now.