Battle error crash

Discussion in 'RGSSx Script Support' started by Kes, May 28, 2019.

  1. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,356
    Likes Received:
    10,404
    First Language:
    English
    Primarily Uses:
    RMVXA
    The title is a bit vague because I am uncertain as to whether this is a compatability issue, or a standalone issue.

    I am using Yami's Battle Symphony script, together with Yami's PCTB. I am over an hour into a new play test, and have fought a fair number of battles already. However, the game crashed with this error message.

    error message.png

    The console was not very useful, all it had was this:
    console printout.png

    Ignore the first line - I had recently changed maps and there's always a whole load of them. But as you can see, the crash happened on the first action. I used a skill to quickly kill off a minion, so it was a one shot KO. This is not the first time I'd done that. But then the crash.

    Anyone got any thoughts on this?

    Thanks.
     
    #1
  2. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,456
    Likes Received:
    2,844
    Location:
    Philippines
    First Language:
    Tagalog
    What's on line 3295 of your Yami's script? Include the whole method preferably
     
    #2
    Kes likes this.
  3. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,212
    Likes Received:
    4,663
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Do you mean, these lines?
    Screenshot_1051.jpg
    Because it's in a different line. I assume because the config, so it shifted downward and pointed to 3295.

    In a not really related note, I found a similar bug in my battle system just recently and it was similar. I found out that the enemy killed and it didn't get registered as "killed" bcz it gets killed 'too fast'. Without going into detail, the system was trying to make the dead battler take action. While I found a direct solution to my problem, I used to have a workaround to prevent it from crashing before pinpointing the actual problem.

    Between these lines
    Screenshot_1052.jpg
    Add
    Code:
    return unless item
    It should do the job preventing the script from crashing. But may not actually solve the actual problem. So you might expect some weird behavior or something. An actual bug hunting is still preferable.
     
    #3
    Kes and Engr. Adiktuzmiko like this.
  4. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,356
    Likes Received:
    10,404
    First Language:
    English
    Primarily Uses:
    RMVXA
    @Engr. Adiktuzmiko

    Here is the section from my version of Battle Symphony

    Code:
    #--------------------------------------------------------------------------
      # overwrite method: use_item
      #--------------------------------------------------------------------------
      def use_item
        @scene_item = item = @subject.current_action.item
        targets = @subject.current_action.make_targets.compact
        #---
        attack = @subject.current_action.attack?
        weapon = @subject.weapons[0]
        w_action = attack && weapon
        #---
        targets = targets * 2 if attack && @subject.dual_attack?
        #--- Setup Actions ---
        actions_list = item.setup_actions_list
        actions_list = weapon.setup_actions_list if w_action && weapon.valid_actions?(:setup)
        perform_actions_list(actions_list, targets)
        #--- Item Costs ---
        @subject.use_item(item)
        refresh_status
        #--- YEA - Cast Animation
        process_casting_animation if $imported["YEA-CastAnimations"]
        #--- YEA - Lunatic Object
        if $imported["YEA-LunaticObjects"]
          lunatic_object_effect(:before, item, @subject, @subject)
        end
        #--- Whole Actions ---
        actions_list = item.whole_actions_list
        actions_list = weapon.whole_actions_list if w_action && weapon.valid_actions?(:whole)
        perform_actions_list(actions_list, targets)
        #--- Target Actions ---
        actions_list = item.target_actions_list
        actions_list = weapon.target_actions_list if w_action && weapon.valid_actions?(:target)
        targets.each { |target|
          next if target.dead?
          perform_actions_list(actions_list, [target])
        }
    with line 3295 being
    actions_list = item.setup_actions_list

    @TheoAllen I have followed your suggestion and inserted that line between what was, for me, lines 3286 and 3287. Testing whether it works or not will be tricky because I will probably have to fight a lot of battles before I get the precise conditions to repeat, but I'll give it a go. You say that "an actual bug hunting is still preferable." How might that be done?

    Thanks to both of you.
     
    #4
  5. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,212
    Likes Received:
    4,663
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    That can only be done by the Yami themselves or someone that is knowledgeable about the script. But as I said, my solution should work to prevent the crash, it MIGHT have some weird behavior that is going to happen when it's supposed to crash though.

    Basically, my solution is like (in the analogy) if you wrote a wrong damage formula, instead of crashing, it just deals null damage. Something like that.
     
    #5
  6. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,356
    Likes Received:
    10,404
    First Language:
    English
    Primarily Uses:
    RMVXA
    @TheoAllen From what I can see Yami is no longer doing support for that script, so I'll go with your workaround for the time being. I did a couple of fast battles to test it out, and nothing unusual happened, so maybe, just maybe, things will be okay.

    Once again, thank you for your help. Much appreciated.
     
    #6

Share This Page