The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Kyriaki on July 11, 2011, 01:14:57 AM

Title: [VX] Show Enemy States, Ziifee's State Animation, and Wij's R.I.B.S Problem
Post by: Kyriaki on July 11, 2011, 01:14:57 AM
I get this error every time I use all three scripts together:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi978.photobucket.com%2Falbums%2Fae262%2FSevenKalmia%2FStateProblem.png&hash=0906dd8a5e30d0460db4e9f59d7f9d07bf4609bb)
Wij's R.I.B.S works fine with Ziifee's State Animation, but when I add Show Enemy States this usually happens on the second set of player turns or so when selecting the enemy. I've included a Project with the mentioned scripts.
Title: Re: [VX] Show Enemy States, Ziifee's State Animation, and Wij's R.I.B.S Problem
Post by: modern algebra on July 11, 2011, 01:40:11 AM
Your demo is missing the graphics for RIBS, so I wasn't able to run it, but both RIBS and the State Icon Animation script overwrite the draw_actor_state method, so they aren't fully compatible but I suspect it is only a matter of minor graphical issues.

I assume the incompatibility must do with the Show Enemy States script passing an enemy that doesn't exist. It could probably be fixed by inserting the following line:


    return if @enemies[index].nil?


at line 33, right after:


  def draw_item (index, *args)
    mdlg_joy_drw_enmy_stt_drwitm_0gh3 (index, *args)


However, that doesn't explain why the error is occurring, or why an index is being passed that would return nil. That must be something in RIBS doing that, and it might cause further problems in the future. I would need a demo with all the graphics and stuff to test and be sure.
Title: Re: [VX] Show Enemy States, Ziifee's State Animation, and Wij's R.I.B.S Problem
Post by: Kyriaki on July 11, 2011, 02:12:22 AM
Oh, I'm sorry about that I completely forgot to copy over the graphics for R.I.B.S, I have fixed the attachment to have the proper files. Thank for looking into it, I will check out that fix and get back to you.
Title: Re: [VX] Show Enemy States, Ziifee's State Animation, and Wij's R.I.B.S Problem
Post by: modern algebra on July 11, 2011, 12:45:45 PM
OK, the better fix for it is to go into RIBS at line 1550 and change:


    for i in 0..$game_troop.members.size - 1
      draw_item(i, true, 1)
    end


to:


    for i in 0...@enemies.size
      draw_item(i, true, 1)
    end


Alternatively, you could delete (from line 1540 to 1555) this whole section:


#==============================================================================
# Window_TargetEnemy
#==============================================================================

class Window_TargetEnemy < Window_Command
  #--------------------------------------------------------------------------
  # Initialize (Mod)
  #--------------------------------------------------------------------------
  alias ow_ribs_window_targetenemy_initialize initialize unless $@
  def initialize
    ow_ribs_window_targetenemy_initialize
    for i in 0..$game_troop.members.size - 1
      draw_item(i, true, 1)
    end
  end
end


All that it does is change it so the enemy's names are center aligned. That, however, interferes with the Show Enemy States script since it gives it less room to draw states. It's probably OK since you are using ziifee's anyway, but it might look a little weird nonetheless.
Title: Re: [VX] Show Enemy States, Ziifee's State Animation, and Wij's R.I.B.S Problem
Post by: Kyriaki on July 14, 2011, 11:08:03 PM
The fix you mentioned in your first reply worked fine, but the first selection in the next more permanently so. I am not comfortable deleting parts of scripts and especially like how it looks, so I am more than happy to edit it instead. ^^ Thank you for your help.