Amaranth's Super Simple Mouse System for Ace

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,493
Reaction score
14,823
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,493
Reaction score
14,823
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,493
Reaction score
14,823
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
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
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,493
Reaction score
14,823
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,493
Reaction score
14,823
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
6,206
Reaction score
7,476
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,493
Reaction score
14,823
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
6,206
Reaction score
7,476
First Language
Indonesian
Primarily Uses
RMVXA
Hi, I'm working on custom scene. But I got a little problem here.

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

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,493
Reaction score
14,823
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
6,206
Reaction score
7,476
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,355
Reaction score
2,552
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
477
Reaction score
682
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,493
Reaction score
14,823
First Language
English
Primarily Uses
RMMV
It moves fine for me. What other scripts are you running?
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm back from an 11 year hiatus. Lol
I sometime envy the people that haven't played Skyrim yet. I feel like I could trade the whole world to be able to make my first pilgrimage to High Hrothgar all over again
Come join us while we play Pocket Mirror by Astral Shift! :LZSjoy: Starting at 2PM ET today!
Tried changing profile icon but...It just felt weird, you know? Who would even want to talk to me if I didn't have this fat yellow rodent thing....Or whatever it is as a mascot....No one, that's who! I am nothing without it. NOTHING!!..
I am having such a good hair day but because it's thunderstorms all day I don't go out and as such nobody will see my hair >.< It's not often my hair cooperates!

Forum statistics

Threads
112,344
Messages
1,067,577
Members
145,981
Latest member
GanMvV
Top