[XP] Mouse Controller

Started by Blizzard, October 09, 2009, 09:18:19 am

Previous topic - Next topic

Blizzard

October 09, 2009, 09:18:19 am Last Edit: October 07, 2021, 10:30:07 am by Blizzard
Mouse Controller
Authors: Blizzard
Version: 2.3
Type: Custom Input System
Key Term: Misc System

Introduction

This script can work as a stand-alone for window option selections. To be able to use the mouse buttons, you need a custom Input module. The supported systems are "Custom Game Controls" from Tons of Add-ons, Blizz-ABS Custom Controls and RMX-OS Custom Controls. This script will automatically detect and apply the custom input modules' configuration which is optional.

This work is licensed under BSD License 2.0:
QuoteCopyright (c) Boris "Blizzard" Mikić
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1.  Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer.

2.  Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.

3.  Neither the name of the copyright holder nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

You may use this script for both non-commercial and commercial products without limitations as long as you fulfill the conditions presented by the above license. The "complete" way to give credit is to include the license somewhere in your product (e.g. in the credits screen), but a "simple" way is also acceptable. The "simple" way to give credit is as follows:
QuoteMouse Controller licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikić

Alternatively, if your font doesn't support diacritic characters, you may use this variant:
QuoteMouse Controller licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikic

In general other similar variants are allowed as long as it is clear who the creator is (e.g. "Mouse Controller created by Blizzard" is acceptable). But if possible, prefer to use one of the two variants listed above.

If you fail to give credit and/or claim that this work was created by you, this may result in legal action and/or payment of damages even though this work is free of charge to use normally.


Features

  • fully automated mouse control in game
  • can be enhanced with "Custom Game Controls" from Tons of Add-ons
  • can be enhanced with "Blizz-ABS Controls"
  • can be enhanced with "RMX-OS"
v2.0b
  • added option to hide Windows' cursor
  • added possibility to hide and show the ingame cursor during the game
  • added possibility to change the cursor icon
  • added several new options
  • optimized
v2.1b
  • added support for .cur and .ani cursor files instead of sprites
  • changed code to use system cursor rather than a sprite to greatly increase performance
v2.2b
  • removed hardware cursor support due to problems with display in fullscreen (which cannot be fixed)
  • added option to specify a custom game name if Game.ini is not present
v2.3
  • added new license
  • added usage and crediting instructions


Screenshots

N/A

Demo

Mouse Controller

Script

Just make a new script above main and paste this code into it.
Script Download

Instructions

Inside the script in the first comment.

Compatibility

90% compatible with SDK v1.x. 80% compatible with SDK v2.x. May cause incompatibility issues with other custom input Systems. Works with "Custom Game Controls" from Tons of Add-ons and Blizz-ABS's custom controls.
This script is not meant to be used as a standalone but rather in combination with special menus that are properly adapted to support a mouse controller system.

Credits and Thanks

  • Boris "Blizzard" Mikić

Author's Notes

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! N-Joy! =D
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

RoseSkye

October 09, 2009, 09:20:21 am #1 Last Edit: October 09, 2009, 09:21:30 am by RoseSkye
You suck as a scripter and you should feel bad.
Nah, it's actually a pretty nifty script. Level Up.. your sister.

Edit: I'm actually giggling thinking about when you copy and paste this and get the chance to read this. Oh man you'll be so angry I'll probably be banned again. TEEHEE!

Calintz

Wasn't this system requested and longed for by many many many people!?
Good job Blizzard. You know, you're a train that never stops rolling, aren't you??

Blizzard

The most important part is that it's compatible with all my custom Input modules. xD

@Rose: Unlike all the other mouse scripts out there, this one was coded cleanly and most probably won't mess up other scripts.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Magus

Quote from: Blizzard on October 09, 2009, 09:26:23 am
The most important part is that it's compatible with all my custom Input modules. xD

@Rose: Unlike all the other mouse scripts out there, this one was coded cleanly and most probably won't mess up other scripts.

How does he come up with these insane scripts XD I think I can use this in an awesome mini-game as well.
LEVEL ME DOWN. THE ANTI-BLIZZ GROUP IS AMONG YOU... Do it for the chick below...She watches..<br />

RoseSkye

Quote from: Blizzard on October 09, 2009, 09:26:23 am
The most important part is that it's compatible with all my custom Input modules. xD

@Rose: Unlike all the other mouse scripts out there, this one was coded cleanly and most probably won't mess up other scripts.


Its like you didn't see the fine print :/

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Calintz

My question to you Blizzard.
Was it arduous to make it 100% compatible with your other input modules??

Like, did you have to go through any other scripts to ensure compatibility, or did you write the script to be compatible from the beginning??

Blizzard

The latter. I intended this to be used in RMX-OS (and Blizz-ABS) which has a copy of my custom Input module included. I will make a special plugin later that allows the player to use the mouse in Blizz-ABS for attacks, etc.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Calintz

October 09, 2009, 09:46:18 am #9 Last Edit: October 09, 2009, 09:48:01 am by Calintz
Very nice ...
It honestly seems that you have no real limitations.

Your only limits are the limits of the engines you use.
You're the best. There's no doubt in my mind.

However, the description says windows selections.
Can the mouse be used over the gameplay map??

Blizzard

If you mean point-click-walk, no. This script is more of a tool to develop something else using it than an actually useful standalone script, but it can be used separately.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Calintz

What about point (determines the tile the cursor is in) and upon click, run event??
I mean, I know it doesn't contain this feature, but is this feature feasible??

Blizzard

Of course it is. A plugin like that would be less than 20 lines long (including aliasing, class/method definition and compatiblity check).
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Calintz

Neat ...
I've got nothing more to say.

I'm sure if game_guy gets his eyes on this topic ... he'll make that plugin. Even Aqua for that matter.
This could make for many interesting new things.

G_G

suggestion, can you make your regular cursor visible on/off? The reason is I tried the demo and my cursor was covering the sprite.

Blizzard

I don't really see the point. It's a mouse cursor, it's above all, always.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

No like the sprite that was in the game, the yellow cursor was displaying beneath my cursor. Shouldnt it display above instead?

Blizzard

October 09, 2009, 02:51:31 pm #17 Last Edit: October 09, 2009, 02:52:44 pm by Blizzard
You don't see Windows' cursor when you're in fullscreen. How else would you see the mouse cursor if it wasn't a game-internal sprite? Not counting very, very bad hacking and a couple of very nasty Win32API calls.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Aqua

<3

I would make plug-ins for this & Blizz-ABS... but...
NO TIME ;_____;

Maybe someday... :x

Alton Wyte

Sorry for necropost, but this doesn't seem to work during name entry, but it works everywhere else. No errors, it just ignores this script during it.