Amaranth's Super Simple Mouse System for Ace

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,140
Reaction score
12,413
First Language
English
Primarily Uses
RMMV
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?
 

brandos

Veteran
Veteran
Joined
May 25, 2013
Messages
147
Reaction score
31
First Language
German
Primarily Uses
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,140
Reaction score
12,413
First Language
English
Primarily Uses
RMMV
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
 
Last edited by a moderator:

brandos

Veteran
Veteran
Joined
May 25, 2013
Messages
147
Reaction score
31
First Language
German
Primarily Uses
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)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,140
Reaction score
12,413
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

brandos

Veteran
Veteran
Joined
May 25, 2013
Messages
147
Reaction score
31
First Language
German
Primarily Uses


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

The second script is TheoAllen - Insane Anti Lag
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,140
Reaction score
12,413
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

brandos

Veteran
Veteran
Joined
May 25, 2013
Messages
147
Reaction score
31
First Language
German
Primarily Uses
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
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,140
Reaction score
12,413
First Language
English
Primarily Uses
RMMV
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.
 

brandos

Veteran
Veteran
Joined
May 25, 2013
Messages
147
Reaction score
31
First Language
German
Primarily Uses
It works! Thank you very much.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,074
Reaction score
5,695
First Language
Indonesian
Primarily Uses
RMVXA
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,140
Reaction score
12,413
First Language
English
Primarily Uses
RMMV
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 :D
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,074
Reaction score
5,695
First Language
Indonesian
Primarily Uses
RMVXA
Hi, I'm working on custom scene. But I got a little problem here.

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
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,140
Reaction score
12,413
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,074
Reaction score
5,695
First Language
Indonesian
Primarily Uses
RMVXA
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
 

Shana

Villager
Member
Joined
Jan 21, 2015
Messages
20
Reaction score
0
First Language
German
Primarily Uses
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.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,334
Reaction score
2,483
First Language
French
Primarily Uses
RMVXA
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.
 

Shana

Villager
Member
Joined
Jan 21, 2015
Messages
20
Reaction score
0
First Language
German
Primarily Uses
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!
 

GolfHacker

Veteran
Veteran
Joined
Feb 15, 2015
Messages
485
Reaction score
686
First Language
English
Primarily Uses
RMVXA
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...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,140
Reaction score
12,413
First Language
English
Primarily Uses
RMMV
It moves fine for me. What other scripts are you running?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Profile Posts

There's another Humble Bundle available now for RPG developer assets, this time focused somewhat more towards pixel art style games.
Ive got a long lost half uncle. Thats real cool.
I forget what is bumping rule in this forum. Is anyone know? Thank you.
BCj
Ew, why does my blogpost on the rpgmaker.net site look like a garbled mess? Are html codes disabled or something?
I feel that I should cut down on my order queue so I can get some more time for my projects, its been quite a longggg while since I worked on them LOL

Forum statistics

Threads
97,900
Messages
947,725
Members
129,136
Latest member
ivanpuvko
Top