Help with Galv's Duel Minigame

Discussion in 'RGSSx Script Support' started by Tagger101, Jun 6, 2019.

  1. Tagger101

    Tagger101 Veteran Veteran

    Messages:
    30
    Likes Received:
    1
    Location:
    New York
    First Language:
    English
    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.
     
    #1
  2. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,434
    Likes Received:
    3,714
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    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.
     
    #2
    Tagger101 and Ebanyle like this.
  3. Tagger101

    Tagger101 Veteran Veteran

    Messages:
    30
    Likes Received:
    1
    Location:
    New York
    First Language:
    English
    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).
     
    #3
  4. Tagger101

    Tagger101 Veteran Veteran

    Messages:
    30
    Likes Received:
    1
    Location:
    New York
    First Language:
    English
    @Wavelength So sure enough there IS an option for battle centralization. I set this to true and now I'm getting another crash with an error in the same snippet of script, this time line 364: undefined method '-@' for nil:NilClass. I'll paste the code again with the offending line in bold, and I've attached a link to a small test room demo that shows my issue. Battles work fine, the duel minigame doesn't. Maybe you can take a look if you have a minute? I really appreciate your help.

    https://drive.google.com/open?id=1WOf3sh1zrjSLuRJ7UScfHf7TrZ_RWWP9
     
    Last edited: Jun 7, 2019
    #4
  5. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,434
    Likes Received:
    3,714
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    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.
     
    #5
    Tagger101 likes this.
  6. Tagger101

    Tagger101 Veteran Veteran

    Messages:
    30
    Likes Received:
    1
    Location:
    New York
    First Language:
    English
    @Wavelength I played around with it myself when I had some time last night and found the same thing, a slew of similar (but strangely unique) errors when adjusting the battle formation options. Coincidentally my project will only be using one party member, so that fix is perfect!

    The hotfix you suggested works like a charm. Thank you very much for looking into this with me! I'll keep playing around with it but as I said, my knowledge is far more limited than yours. Hopefully this will help others too, I'll be keeping an eye on this thread.
     
    Last edited: Jun 7, 2019
    #6
    Wavelength likes this.
  7. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,434
    Likes Received:
    3,714
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    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.
     
    #7
    Tagger101 likes this.

Share This Page