Mouse System

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Jet, Jul 8, 2012.

  1. Jet

    Jet Flying in a sky near you Veteran

    Messages:
    172
    Likes Received:
    102
    Location:
    California
    First Language:
    English
    Mouse System
    by Jet

    Introduction

    Yes that's right, another iteration of my mouse. This time around I coded my own pathfinding (which does not freeze up like the previous one) and i completely recoded almost everything. It's highly optimized and works much better than any previous version. It has removed the scrolling with mouse wheel, but added a developers block.

    This is adding a fully functioning mouse into your game. This can allow the character to move and interact with just a click and navigate menus with ease.

    Features

    - Quick, flexible pathfinding, via A*
    - Many configuration options
    - Even more compatible with custom systems with a recoded base
    - Just a click to do mostly anything
    - And more...

    Screenshots

    Pretend the mouse is hovering over an event and TEXT APPEARS, WHOAPretend to see me click and the player MOVES TO WHERE I CLICKED, WOW

    Pretend the mouse is over some items in the inventory screen and the item right under it IS THE ACTIVE ONE, AMAZING
    Script
    http://pastebin.com/raw.php?i=RDtzRMCN
     
     

    Credit

    Jet

    Note

    I have a license, it's in my signature.
     
    Last edited by a moderator: Jun 27, 2015
    #1
  2. crimcrim

    crimcrim :d Veteran

    Messages:
    904
    Likes Received:
    214
    First Language:
    English
    Finally. Only took you 6 months.

    geez
     
    Last edited by a moderator: Jul 8, 2012
    #2
  3. EvilEagles

    EvilEagles Stargazer Veteran

    Messages:
    1,679
    Likes Received:
    714
    First Language:
    Vietnamese
    Primarily Uses:
    Other
    And by using your scripts, under the clauses of the license you're using, we're supposed to leave our games unencrypted.
     
    #3
    MyLordRobinson and Dr.Yami like this.
  4. Chaos17

    Chaos17 Dreamer Veteran

    Messages:
    1,253
    Likes Received:
    420
    Location:
    France
    First Language:
    French
    That's really nice!

    Finally a mouse script which work with your SBS.

    Here's my bug report:

    1) when I am on my title screen, i can't select the commands.

    Is it because there're in pictures ?

    Here's the title screen script I am using: http://www.atelier-r...ACE_Menu09.html

    2) when I choose to select to use an event which use a mouvement route, the accuracy of your script isn't 100%

    Set up of my event (on player touch): http://uppix.net/2/d...f7ef95b623b.gif

    Result when I am not using your mouse script > http://uppix.net/e/b...522b499968a.gif

    Result when I am using your script > http://uppix.net/5/1...d3fab88b679.gif

    3) I can't throw in a different direction an object (event)

    I am using this script > http://www.atelier-r.../ACE_SYS05.html

    Your script will always make my character throw the item in front of him even if I select the other side.

    I think it's because the character isn't changing side by itself when I make a click with your mouse script.

    I am not asking you to make compatibility patches, it's your choice do it or not. ;)

    I am just reporting actions that you can possible have with the scenery.

    I just have an suggestion, when you click on a event, example a chest. it will be nice that the character move to it.

    To avoid bug maybe you can allow like an 5 quare area of detection range and if the character is blocked because of the passability it won't search react to the clicking.

    Sorry for my bad english.
     
    Last edited by a moderator: Jul 8, 2012
    #4
  5. RyanA

    RyanA Happy Cat Veteran

    Messages:
    2,423
    Likes Received:
    230
    Location:
    Not so merry ol' England
    First Language:
    English
    Someone must do a point and click game with this awesome script! Thank you very much, dear maker :3
     
    #5
    Levi likes this.
  6. Levi

    Levi Veteran Veteran

    Messages:
    798
    Likes Received:
    143
    First Language:
    English
    Loving this!! I just set up a Map System with this.

    A problem:

    1) If I turn the Mouse System off mid game, it can't be turned back on.

    Some questions:

    1) I'm super script-stupid... how can I change the Font for the Hover Text?

    2) What script call or comment can I use to change "ALLOW_MOUSE_MOVEMENT" mid-game?
     
    #6
  7. Jet

    Jet Flying in a sky near you Veteran

    Messages:
    172
    Likes Received:
    102
    Location:
    California
    First Language:
    English
    1.) Fixed.

    1(2).) Feature Added.

    2(3).) Feature Added.

    The new version has been linked in the original post. Thanks for the report and ideas.
     
    #7
  8. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,067
    Location:
    Toronto
    First Language:
    English
    For the comments, maybe you can use string interpolation and allow users to decide what to type.

    For example, maybe the default MOUSE CLICK is too much work to type, but I don't know how to change the regex.

    Instead I can just go to some config and type in the phrase I want to use for the MOUSE CLICK comment.

    I like the choice of implementation though; just add mouse functionality to window_selectable rather than some other implementations that create custom window/scenes for everything just for the mouse.

    Might go off and do some TBS script I had started working on but then got bored.

    btw,

    1: I have a chest with MOUSE CLICK. It doesn't work when "ALLOW_MOUSE_MOVEMENT = false" though (works when it's true)

    Can you separate the actual mouse movement from event triggering? (assuming that's how it was done)
     
    Last edited by a moderator: Jul 15, 2012
    #8
  9. Chaos17

    Chaos17 Dreamer Veteran

    Messages:
    1,253
    Likes Received:
    420
    Location:
    France
    First Language:
    French
    I still have the same problem with the mouvement route, I tried all new option.

    I guess the problem is that my character jump when I when on the event.

    It doesn't wait for my character to stand on the event then make it jump.
     
    Last edited by a moderator: Jul 15, 2012
    #9
  10. Jet

    Jet Flying in a sky near you Veteran

    Messages:
    172
    Likes Received:
    102
    Location:
    California
    First Language:
    English
    Fixed a couple of bugs:

    1.) Event hovering text windows would not become invisible when a new scene is called. This has been corrected.

    2.) The developer block would temporarily be visible outside of the map in scenes. This has also been corrected.

    New version in first post.

    @Chaos: I haven't pin-pointed the issue, but i don't see how the mouse would be responsible, it doesn't mess with any direct movement.
     
    #10
  11. Maus Merryjest

    Maus Merryjest Veteran Veteran

    Messages:
    240
    Likes Received:
    40
    Location:
    Colorado
    First Language:
    English
    The new version gives me this:

    line 657:NoMethodError ocurred. undefined method 'visible=' for fale:FalseClass

    It happens when moving with the mouse, and it also appears when calling up the menu.
     
    Last edited by a moderator: Jul 16, 2012
    #11
  12. Jet

    Jet Flying in a sky near you Veteran

    Messages:
    172
    Likes Received:
    102
    Location:
    California
    First Language:
    English
    Fixed. Update original post with new link.
     
    #12
  13. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,067
    Location:
    Toronto
    First Language:
    English
    Here's an attempt to separate event checks from mouse movement, although it looks like certain events are supposed to force you to move.



    Code:
    class Scene_Map
      alias jet3745_update update
      def update(*args, &block)
        jet3745_update
        check_event_trigger
        check_mouse_movement if $game_system.mouse_movement
        check_mouse_icon_change
      end
    
      # moved here
      def check_event_trigger
        $game_temp.mouse_character ||= $game_player
        if Mouse.click?(1)
          dont_move = false
          x, y = *Mouse.true_grid
          ($game_map.events_xy(x, y) + $game_map.vehicles).each {|event|
            if event.is_a?(Game_Vehicle)
              if (event.x - mouse_char.x).abs + (event.y - mouse_char.y).abs == 1
                if [event.x, event.y] == Mouse.true_grid
                  mouse_char.get_on_vehicle_mouse(event)
                  dont_move = true
                end
              end
            elsif !!!mouse_char.vehicle
              if event.mouse_activated?
                event.start
                dont_move = true
              elsif (event.x - mouse_char.x).abs + (event.y - mouse_char.y).abs == 1
                if event.is_a?(Game_Vehicle)
                  mouse_char.get_on_vehicle_mouse(event)
                  dont_move = true
                else
                  if !event.mouse_empty? && [0, 1, 2].include?(event.trigger)
                    mouse_char.turn_toward_character(event)
                    event.start
                    dont_move = true
                  end
                end
              else
                {UP: [0, -1], DOWN: [0, 1], LEFT: [-1, 0], RIGHT: [1, 0]}.each {|d, a|
                  if event.check_for_comment(/MOUSE[ ]*MOVE[ ]*#{d.to_s}/i)
                    x += a[0]; y += a[1]
                  end
                }
              end
            end
          }
          mouse_char.mouse_path(x, y) unless dont_move
        end
      end
    
      def check_mouse_movement
        $game_temp.mouse_character ||= $game_player
        if Mouse.click?(1)
          # separated into its own method
          mouse_char.mouse_path(x, y)
        end
      end
    end
    
     
    Last edited by a moderator: Jul 16, 2012
    #13
  14. masterchafa

    masterchafa Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    Spanish
    Hi Jet. I just loved your script, and now i admire you. But i came with this idea... Is there any chance for this script to have an option that would allow the player to dinamically face the same direction as the cursor (at least the 4 basic facings), as if the chara were looking for something?

    ... Aand something else: It seems that the cursor and the real mouse aren´t exactly in the same place. To be more acurate, the actual click is about one and a half tiles to the right of the cursor, and maybe a half tile up. Can you fix it?

    Thank you :)
     
    Last edited by a moderator: Jul 18, 2012
    #14
  15. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,640
    Likes Received:
    2,966
    Location:
    Philippines
    First Language:
    Tagalog
    just wanna say that it seems to bug with YanFly's custom system menu (when I use YF's system to disable then re-enable the mouse, the mouse cursor never reappears but it still works)
     
    #15
  16. Chaos17

    Chaos17 Dreamer Veteran

    Messages:
    1,253
    Likes Received:
    420
    Location:
    France
    First Language:
    French
    Bug report

    [​IMG]

    My script list

    [​IMG]
     
    Last edited by a moderator: Jul 29, 2012
    #16
  17. Genii Benedict

    Genii Benedict Supervillain, Extraordinaire Veteran

    Messages:
    333
    Likes Received:
    114
    Location:
    Ajax, Ontario, Canada
    First Language:
    English
    I just installed the script, and I think I'm seeing this as well as another issue. First, here's a screenshot of the mouse script beside my character, when I start...

    [​IMG]

    The highlight seems fine on the first screenshot, and even when you aim, you're good.

    [​IMG]

    In the screenshot above, I'm aiming for the door center. It's correct, and there's an event there to open the door.

    [​IMG]

    Now, once you move, you get this whenever you aim. You're 50% to the right or left of the actual spot where you can aim.... Also, when I mouse click on the event where the door action is, you don't go to it. I'm guessing there's a way to make it so, but it looks like either I've done something wrong (I haven't edited the event) or else, the walk parsing code doesn't want to go there. Even if I click the doors right from my starting position (so that you KNOW it's dead on, without the issue I'm having above) it won't walk to it. It will walk right up to it, and then stop. And you can 'manually' walk through them.

    Let me say this - THIS SCRIPT IS SOME KIND OF AMAZING MAGIC. I am in awe of how amazing it looks, and applaud the work you've done so far.

    GB

    EDIT: Ah. I think I've also determined where the issue I'm having specifically may be originating. The door event works if you choose "Below" or "Above", but not at the same level. Unfortunately, this causes a different issue in the fact that now, the player walks through (under or over, technically) the door graphic before the animation opens and closes the door. So, unfortunately, that kills the functionality for me somewhat...

    As an aside, everything else works - and I've just tested Vlue's mouse, and it works fine with my door events as is. Unfortunately, his doesn't offer as much robust power (sorry Vlue!) as Jet's does, as it doesn't (presently?) have auto-walk, nor does it seem to have the pathing code as strongly as Jet's. Now, if there was some way to match Vlue's event functionality with Jet's pathing and customization...

    EDIT EDIT: A-HA! I can confirm that the issue whereby the 'target box' is 50% out of phase with your position is caused by a conflict with "Yanfly's Engine Ace - Ace Core Engine v1.09", and likely due to the increase in screen resolution when the screen is panning. I removed this script and everything works fine, shy of the issues with my doors, as above. I'm still hoping and wishing for some resolution to each, if that's anywhere close to possible.
     
    Last edited by a moderator: Aug 21, 2012
    #17
  18. MacGabhann

    MacGabhann Villager Member

    Messages:
    8
    Likes Received:
    0
    First Language:
    English
    ive just tryed out this script on my game and let me just say it works great so far no problems that I can see right now. I looked at the license and if im reading it right it would mean that if I keep the script in my game I would not be able to sell the game which I was wanting to try even if just to see how well it would do though ive also been thinking of just making it free. just curiuse as to what my options might be regarding the licence if im reading it correctly. and let me just say that this is one awsome script.
     
    #18
  19. Genii Benedict

    Genii Benedict Supervillain, Extraordinaire Veteran

    Messages:
    333
    Likes Received:
    114
    Location:
    Ajax, Ontario, Canada
    First Language:
    English
    Contact Jet directly via PM. I'm hoping to explore using this script for a future commercial venture, and that's the way I'll be going. (Unless, of course, Jet pops back in and says how to approach him in a different way.)

    GB
     
    #19
  20. Internetakias

    Internetakias RPG Maker VX Ace Noob :P Member

    Messages:
    67
    Likes Received:
    8
    Location:
    P-1 Grand Prix
    First Language:
    Greek
    I know it's already been said before but could you tweak the MOUSE CLICK tag so it works even if ALLOW MOUSE MOVEMENT is set to false? Thanks. :)
     
    #20

Share This Page