Victor Sant materia + Shaz mouse

Hello everyone, I'm using Victor Sant Materia script and Shaz Super Simple Mouse script, when the mouse goes over the weapon/armor spots to select a slot to put in the materia; I get a 


(shaz) line 1034 error. wrong number of arguments (1 for 2). So I understand from reading a similar post that this means that the materia script is not sending two values. I assume this to be X and Y position information. Is there a way to fix this?


*EDIT - My line 1034 is  - rect = item_rect(i)
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.



RGSS Scripts is for completed scripts that you made.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.



RGSS Scripts is for completed scripts that you made.

Thanks. Clicked the wrong one.
Line 1034 in my mouse script is an end statement.  This means you've edited the script in some way.  The line you're quoting (if it's the one I've found) is 7 lines higher than 1034 in my script, which means somewhere, you've lost 7 lines.  If those were just blank lines, it's not a problem, but it might be worth taking a fresh copy of the script and replacing the one in your game, just in case.


What's happened here is that Victor has overwritten the item_rect method for his Window_MateriaEquip class and made it use two values instead of just one.  So it's the mouse script calling the materia script that's the problem, not the other way around.


If you add the following in a new script slot below the mouse script, it MIGHT solve the problem (I'm not familiar with Victor's script and I'm not going to test it - this is just the change I would try if I ran into the problem myself):

Code:
class Window_MateriaEquip < Window_Selectable
  #--------------------------------------------------------------------------
  # * Mouse Movement Processing
  #--------------------------------------------------------------------------
  def process_mouse_handling
    return unless $mouse.enabled? && cursor_movable?
    # Add a delay to prevent too-fast scrolling
    @delay = @delay ? @delay + 1 : 0
    return if @delay % 3 > 0
   
    mx, my = *Mouse.position
    vx = self.viewport ? self.x - self.viewport.ox + self.viewport.rect.x : self.x
    vy = self.viewport ? self.y - self.viewport.oy + self.viewport.rect.y : self.y
    if mx.between?(vx, vx + self.width) &&
      my.between?(vy, vy + self.height)
      mx -= vx
      mx -= padding
      my -= vy
      my -= padding
      my += oy
      for i in 0 ... item_max
        rect = item_rect(i, @equip)
        if mx.between?(rect.x, rect.x + rect.width) &&
          my.between?(rect.y, rect.y + rect.height)
          last_index = @index
          select(i)
          if @index != last_index
            Sound.play_cursor
          end
          break
        end
      end
    end
  end
end

That's exactly the same as the script you have, but I've passed in the second parameter.  You can't just change your script, as the mod should only apply to Victor's window, and not all Window_Selectable classes.
Thank you @Shaz. It stops the error. My extra lines - I looked and found 6 blank lines after line 92 plus


I have 6 lines of icons specified. Everything else should be the same. I don't play with scripts unless I'm trying to magically find a fix to a problem, or making a change that you're suppose to make. I don't recall ever touching your script except the icons.


While your addon works and I'm happy with that, it doesn't allow me to select the materia slots. It stays on the first one and the mouse position doesn't change the position of the materia slot. Good enough for me as the error was the critical part.


Unless you have other ideas to help with that minor issue then I'll close the thread in a few days.
The mouse script includes some special handling for a few scenes/windows that don't quite follow the regular layout/format/processing.  Sounds like you'll need to do something similar for the materia script.  Unfortunately this is going to take quite a bit of time and testing to get working properly, and it's not something I can help you out with any further.  Hopefully you'll be able to get someone who's familiar with both scripts or is willing to give it a go.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/victor-sant-materia-shaz-mouse.70191/