Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Simple Mouse System

Simple Mouse System
Version 1.5
by Woratana
Release Date: 14/04/2008


Introduction
I scripted SMS because I'm working on other script that will be good if it has mouse function. And I'd like to share this to others after I got permission from Dervvulfman (this script require his script)

I don't have any knowledge about win32api, so I went to find XP mouse script and tried if they work on VX.
Finally, I found Dervvulfman's Mouse Input Module. It works great in VX without any edit.

This script required Mouse Input Module and Near Fantastica's Path Finding
It will allow player to click on menu, choose choice, move on map and talk to NPC by mouse.

It's also included feature to use image for cursor.


Features
- Support to use mouse in many scenes / windows
e.g. Battle Scene, Shop, Name Input Screen
- Click on map to move player using Path Finding
- Click on NPC when player is close to that NPC to talk.


Demo

Download Simple Mouse System Demo
Download vx_mouse.rar for demo.
or you can get the script in text file from there.

Thanks RRR for hosting this.  ^_^


Script
I think it's easier to download demo,
since I've edited some lines in Near Fantastica's Path Finding script. ;)

Screenshot
http://i32.tinypic.com/2dwc1v5.jpg[/img]


Instruction
This script is Plug 'N Play script,
so just put Dervvulfman's Mouse Input Module, Near Fantastica's Path Finding,
and Simple Mouse System in your game, and enjoy! :)


Plan for next version
- Cursor change when put on other event
- Better event trigger check by click mouse


Compatibility
No report for compatibility issue so far.. ;)


Author's Notes
Free for use in both commercial and non-commercial if credit included.


Credit
DerVVulfman
Near Fantastica
Freak Boy
lambchop
Shun
Cybersam
Astro_mech
Mr.Mo
Fuso
Modern Algebra
Zeriab
Patrick Lester

for the scripts that help me finished this,
Mouse Input Module,
Super Simple Mouse System,
Path Finding.
 
Hey Wortana Would it be hard to make it so when you click on a person/event it walks uptothem and automatically clicks on it?

I.E.  if I click on a person in a map my character will walk upto him then try to activate dialog automatically.

I.E. If I click on a treasure chest it will walk upto it and automatically open the chest.

Secondly would it be possible for the walking script to goto the point you clicked and if you continue to hold down the button it will then goto the point the mouse  is at when that move is done and on and on.?
 
Wortana Would it be hard to make it so when you click on a person/event it walks uptothem and automatically clicks on it?
Walk to event is not hard, I'm thinking about the automatic talk part.  :smile:

EDIT: I got solution for this now. :)

Secondly would it be possible for the walking script to goto the point you clicked and if you continue to hold down the button it will then goto the point the mouse  is at when that move is done and on and on.?
Well, you can just click on the destination, and player will find the way to there itself. That's why I put path finding in it.

I scared it will lag if it has to calculate path finding all the time while mouse is holding down.
 
I like this script a lot, however, I seem to be experiencing minor problems with it sometimes when I go through transitions to other areas. Sometimes when I go through a transition and start to move again, it sends me back through the transition from the wrong map position.

I can't really explain it better than that and it doesn't happen every time...but it happens enough to be noticeable. I was actually hoping to find a way to only enable to mouse for combat and menus and disable it from pathing entirely.
 
@Jrr Kein
As Yeyinde said, please give more information about that. :)

@Yeyinde
Thanks~

@Namkid
Is mouse API you means is the one I'm using >_>?

@Skaithe
Well, I haven't try it with transition yet.

I think I may put the option to choose where to use mouse in next version :)
 

Hero

Member

Would it be possible to make it so that you can trigger an event by clicking it without having the player move all the way to it? This is something I kind of wanted in the XP script but no one ever tried to attempt it.
 
@Hero
lol, Dejavu...
I already put that in the next version :)

[NEXT VERSION :: NOTE]
- Using Modern Algebra's Path finding that is faster, and has better algorithm.
- Added setup part, you can add the scene that you don't want to use mouse, configure many things in script.
- You can now click on event, NPC, and player will automatically walk to that event and interact.
- You can put some tags in event's comment, e.g. '[mauto]' to run this event automatically after you click on it.

http://i26.tinypic.com/1ils3k.jpg[/img]
 
Okay. When I'm test playing with simple mouse script. I got an error message that tells me about the mouse module/classes. Is it me or I need to modified the script a little  :tongue:
 

Akin

Member

Awesome script man works greats. I was just wondering if it's possible to mod this script somehow to make it select battlers by simply mousing over their sprites rather than having to always have the menu showing?

http://i48.photobucket.com/albums/f203/damjee/example.jpg[/img]

What I mean is rather than having to mouse over the yellow area to select your targeted could you mouse over the green area instead.
 
@Jrrkein
You may put 2 version of mouse script in it, so stack is error.

It usually happens when there's alias on method that already defined.

@Akin
I've no plan for that yet. :)
 
Jrr Kein":31f6xu1b said:
So how can I fixed the stack error?

Sounds like delete the script and just recopy the script from here and paste it back into your script editor and you should be fine.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top