Amaranth's Super Simple Mouse System for Ace

which line is 504?


If it's this line:

Code:
 list.sort! {|a, b| b.y - a.y}
add this to a new line before it:
Code:
 return nil if list.nil? || list.empty?
Thanks for the fast reply. I did exactly as you said and added return nil if list.nil? || list.empty?  right above line 504. Sadly the error is still appearing.
so which line is 504? Can you show me the method you have now? Is it returning the SAME error? EXACTLY the same error?

Edit: nevermind - I see what the error is.

Can you erase that line I told you to add, and change this:

Code:
list = events_xy(x, y) + events_xy(x, y+0)
to this:
Code:
list = events_xy(x, y)list += events_xy(x, y+1) if y+1 < height
I really apreciate your help, thank you.

Sadly this also causes an error.

Script line 505: Argumenterror occured

Wrong number of arguments (2 for 0)
okay, give me a few minutes. I've just finished a script for someone else, so I can spend some time looking at this properly.

Step one ... let me reproduce your issue 🙂

Edit:

Okay, I put the script into a brand new project and ran it on a new map, and I'm not getting the error. Do you have other scripts that adjust maps or screen size or anything?

Can YOU try putting it into a brand new project and see if it works?

Does there have to be an event on the tile at the bottom in order for it to trigger?

Edit2:

I added an event to the bottom tile, made the map bigger than the default size and moved the event to the bottom, resized the window. None of them give me the error.

Can you do a full search (Control+Shift+F) for this:

Code:
def events_xy
and tell me how many lines come up? There should only be two:
Code:
Game_Map (349):   def events_xy(x, y)Game_Map (355):   def events_xy_nt(x, y)
If you have more, it's possible another script has modified that method and that's where the error is happening.
7kFbbWa.png


This is the result, if there are only two of them the error should disappear or?

The second script is TheoAllen - Insane Anti Lag
Try disabling the antilag script and see if it makes a difference.


If it does, post the method from that script here and I'll give you a slight rewrite.
Without the antilag script it works 🙂

this is the part which causes the error

#///////////////////////////////////////////////////////////////////////////////

  #-----------------------------------------------------------------------------

  # * Overwrite method : Event XY

  #-----------------------------------------------------------------------------

  def events_xy(x, y)

    @table.get(x,y)

  end

  #-----------------------------------------------------------------------------

  # * Overwrite method : Event XY nt

  #-----------------------------------------------------------------------------

  def events_xy_nt(x, y)

    @table.get(x,y).select do |event| 

      event.pos_nt?(x, y) 

    end

  end

#///////////////////////////////////////////////////////////////////////////////

  end
okay, change it to this:

Code:
def events_xy(x, y)  return [] if x < 0 || y < 0 || x >= width || y >= height  @table.get(x,y)end
Leave the second one as it is - the mouse script doesn't use it.
It works! Thank you very much.
My fix would be

def events_xy(x, y) @table.get(x,y) || []endYou can consider it as my antilag script fault because def events_xy SHOULD always return array.

I also updated my script. Sorry for the inconvenience both of you.
What happens if x or y is outside of the boundaries of the map? I'm guessing that's what the issue was, but I'm surprised the error highlighted the line in my script rather than your events_xy overwrite if that's the case.


Thanks for the fix. I get a bit fuzzy on those operations, but I am a fan of reducing two lines to one 😀
Hi, I'm working on custom scene. But I got a little problem here.

Spoiler
ZgiryqL.jpg
The cursor is not pointed to the command, yet when I clicked the mouse somewhere else, I still could trigger the command.

Is there any way to prevent this to happen? I'm trying to make multiple window commands active at same time. But they should only triggered if the cursor pointed at the command window.

Edit:
I believe it would me something like this

Code:
class Window_Selectable  def process_handling    return unless open? && active    return process_ok       if ok_enabled?        && trigger_input?    return process_cancel   if cancel_enabled?    && Input.trigger?(:    return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)    return process_pageup   if handle?(:pageup)   && Input.trigger?(:L)  end    def trigger_input?    # If mouse is in cursor rectangle and clicked  endend
Yeah, that would be it. I actually like being able to move my mouse around outside of the active window and still have it scroll up and down, so this is more of a user preference thing.


I haven't experimented with multiple windows active at once.
I found that myself 🙂

Code:
class Window_Selectable  def process_handling    return unless open? && active    return process_ok       if ok_enabled?        && trigger_input?    return process_cancel   if cancel_enabled?    && Input.trigger?(:    return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)    return process_pageup   if handle?(:pageup)   && Input.trigger?(:L)  end    def trigger_input?    cp = cursor_pos    return Mouse.trigger?(0) && Mouse.pos[0].between?(cp.x, cp.x + cp.width) &&      Mouse.pos[1].between?(cp.y, cp.y + cp.height + 20)   end    def cursor_pos    rect = cursor_rect.clone    rect.x = self.x + cursor_rect.x - self.ox    rect.y = self.y + cursor_rect.y - self.oy    rect  end  end
Geh... I feel so dumb for asking but... I've been looking through the last few pages and was either too stupid or too blind to find the thing you were talking about on the blog back in january mentioning the ability to activate an event from afar without the player moving. It'd be really nice if you either hinted me to that particular post or just told me how it's done as it's a core function I'll be needing for the menu I have in place.
Geh... I feel so dumb for asking but... I've been looking through the last few pages and was either too stupid or too blind to find the thing you were talking about on the blog back in january mentioning the ability to activate an event from afar without the player moving. It'd be really nice if you either hinted me to that particular post or just told me how it's done as it's a core function I'll be needing for the menu I have in place.
You mean, this part?

add <autoactivate> comment at top of event page

It's in the versions changelog. Maybe it should be added more clearly in the original post.
Now I feel even more stupid than before. Thank you for pointing it out, helped me a great deal since it worked. Sheesh. I'm blind sometimes ._. Thanks a lot!
Is there a way to adjust the mouse speed? It doesn't seem tied to the operating system. When I playtest my map, it comes up in windowed mode, and when I mouse into the window, the mouse speed slows down considerably. I would have expected the cursor to move with the same speed it does outside the window...
It moves fine for me. What other scripts are you running?

Original thread: https://forums.rpgmakerweb.com/threads/amaranths-super-simple-mouse-system-for-ace.17829/