Magic Reflect causes crash

● ARCHIVED · READ-ONLY
Started by Kes 9 posts View original ↗
  1. I am using Yanfly's Battle Engine and Yami's Battle Symphony.  Yami provided a compatability fix which is this one

    Spoiler
    class Scene_Battle < Scene_Base def invoke_counter_attack(target, item) @log_window.display_counter(target, item) last_subject = @subject @counter_subject = target @subject = target #--- @subject.backup_actions #--- @subject.make_actions @subject.current_action.set_attack #--- actions_list = SYMPHONY::DEFAULT_ACTIONS::COUNTER_ACTION perform_actions_list(actions_list, [last_subject]) #--- @subject.clear_actions @subject = last_subject #--- @counter_subject.restore_actions #--- @counter_subject = nil refresh_status perform_collapse_check(@subject) perform_collapse_check(target) end def invoke_magic_reflection(target, item) @subject.magic_reflection = true @log_window.display_reflection(target, item) last_subject = @subject @reflect_subject = target @subject = target #--- @subject.backup_actions #--- @subject.make_actions if item.is_a?(RPG::Skill); @subject.current_action.set_skill(item.id) else; @subject.current_action.set_item(item.id); end #--- actions_list = SYMPHONY::DEFAULT_ACTIONS::REFLECT_ACTION perform_actions_list(actions_list, [last_subject]) #--- @subject.clear_actions @subject = last_subject #--- @reflect_subject.restore_actions #--- @reflect_subject = nil refresh_status perform_collapse_check(@subject) perform_collapse_check(target) @subject.magic_reflection = false endend
    The Magic Reflect comes from an equipped accessory.  which has the feature MRF 30%.  

    Mostly this works okay, but just occasionally it throws up this error

    line 38: NoMethodError occurred.

    undefined method 'set skill' for nil: NilClass

    It is starting to do the magic reflect at the time because I can hear the SE just before the crash happens.

    Can anyone suggest the cause for this?

    Thanks
  2. It's something to do with the 'make_actions' I guess.

    Was your character inflicted any states that prevent it to move?
  3. I've ran into the same problem with counterattack as well with Yanflys scripts, but got around it by adding a check to see if the class was nil before performing any actions. Works fine now. Maybe you can do the same, tell it that if for any reason the class is nil, do action x?
  4. Sorry for the delay in replying, but RL job meant I've not been able to deal with this until now.

    Here is the printout from the console

    Crashreading_zps053c87e7.png

    @TheoAllen

    I thought it might be while the person with the accessory was stunned, but there were many instances while I was playtesting to get the crash when she was stunned and the MRF worked correctly.

    @bgillisp

    Unfortunately I haven't a clue about how to do what you suggest.  I would need to be told exactly which lines in which script need to be amended.

    EDIT

    Forgot to put the links.

    Here is Yanfly's Ace Battle Engine  https://github.com/Archeia/YEARepo/blob/master/Battle/Ace_Battle_Engine.rb

    Here is Yami's Battle Symphony  https://github.com/suppayami/rmvxa-collection/blob/master/battle-symphony/battle-symphony-116e.rb
  5. Does anyone have any ideas on this, in the light of the print out of info?

    Thanks
  6. The only thing I can think of is it appears that @subject.current_action is somehow nil when it gets to that line. Why, not sure though (and I don't use Battle Symphony so not much help on that part). Does it only occur if the person who the reflect is on has already taken their turn?
  7. Does it only occur if the person who the reflect is on has already taken their turn?
    The person who has it is usually faster than the enemies, so will always have had her turn when they attack her.

    If it makes any difference, I have not assigned any custom Battle symphony animations to enemies, they are using default actions (which are pretty simple and straightforward) so I know that it's not the result of a badly constructed tag.  And anyway, most times there is no problem, this crash only happens sometimes.
  8. Can anyone help with this? Magic reflect is an important component in the skill range.

    Thanks