Classic Point Click Interface

Hey all -

I’m in the process of designing out a classic point and click interface (mousewheel will transition through Walk, Look, Use, and Talk) and I’m thinking I’m going to have to write a few different scripts to tie things together…I need some pointers in terms of where to look for some of this stuff.

I already have the mouse click to move working with an animated model (the player) complete with locomotion (although it’s pretty rough around the edges).

I know I’ll have to write a quick script to disable the OS mouse cursor and have my own set of GUI elements that transition from state to state. I guess the big topics for me are:

  1. I need to create a global script that has GUI elements changing along with state changes
  2. I need to figure out how to cancel player moving if they are using the “Look”, “Use”, “Talk” mouse-click states.
  3. I need to create a separate script that has variables for “Look”, “Use”, and “Talk” that I would attach to colliders/objects/characters/etc…, so players get the proper feedback when clicking on objects throughout the world. This would be how I handle “hotspots” like an old point and click adventure.
  4. Figure out how to actually display the information of “Look”, “Use”, and “Talk”. I’m guessing I’ll probably just have to have the variable point to a GUI element that might be referencing text data somewhere?

I’ve been looking around to find some info that would help me out on this stuff. I’ve found some stuff based off of mouseover but not the wheel movement. Would it be better for me to look at a GUI system from the asset store (like EZGUI or NGUI) to sort of streamline this work? Anyone have some reference/resources they could point me towards to get me in the right direction?

Thanks a bunch.

Coincidentally I’m working on such a system for a client. Even better I own the rights to the code. Even better it will be on the asset store in the next month or two.

The backend is built (i.e. defining interactions in XML/etc), but I haven’t made a pretty interface yet. You can see some videos of the backend here:

http://dl.dropbox.com/u/60620789/AdventureKitDemo-PartOne.m4v

http://dl.dropbox.com/u/60620789/AdventureKitDemo-PartTwo.m4v

PS: Warning… long videos.

EDIT: It also supports a lot more than that, for example there RPG demo extends it to have an item system where you can combine gems with armour and weapons to make better weapons. All automatically saved and loaded with no coding.

The Asset Store version will come with some pretty NGUI interfaces for inventory. As well as a full mock up of a “sierra style” adventure game and a “iPhone style” adventure game.

JohnnyA - This inventory system looks very promising! Looking forward to seeing more! I’ll be keeping my eye on the asset store. :slight_smile:

When you say a full mock up of a “sierra style” adventure game, does that also include the point and click interface or is it primarily based on the inventory system?

Quick update: I have downloaded PlayMaker to get a little forward momentum, but I’m having a hard time finding info to leverage the mousewheel on GUI transitions for a point and click interface. Anyone have any references that they could point me to? Thanks.

I wouldn’t rely on the existence of a mouse wheel. Most home computers sold—over 75% or so—are laptops, not desktops, and this has been the case for some years now. You should assume a trackpad, not a mouse, as standard. What’s more, the mouse itself is not very ergonomic and is the primary cause of RSIs.

If you absolutely must use three buttons—only the left and right mouse buttons are guaranteed to be there on a mouse designed for Windows—then the mouse scroll-wheel button is usually mapped to the “mouse 2” label, but some multi-button mice have unusual button mappings, so don’t rely on this always working. The scroll-wheel itself is driver-dependent: it’s not an “axis” in the Unity sense, as it just generates a continuous series of “up” or “down” messages, depending on its direction. This is usually mapped to the 3rd axis in Unity, but you do need to add the axis in the Input Manager settings.

Basically, you need to have the “Mouse ScrollWheel” axis set up in your project’s Input Manager settings. (See attached screenshot for an example. It seems to be included by default in the Unity 3.5.x releases, but this wasn’t the case in older versions.)

You can then access the scroll wheel events using Input.GetAxis(“Mouse ScrollWheel”).

If you have any plans to release your project on other platforms, remember that tablet / smartphone touchscreen devices don’t even have a mouse cursor, so you should consider checking for the platform type you’re running on and adapting the UI accordingly.

Examples:

Mouse / trackpad device – let the ‘left click’ action perform either a “Move here” or “Perform Primary Action” command according to context. (E.g. tapping on a location would move the player’s character; tapping on a collectable item performs a ‘pick up’; tapping on a door opens it, and so on.) The ‘right-click’ command—all trackpads and mice support this; not all mice have a middle button or scroll wheel!—brings up a context-sensitive menu offering all valid commands to the player.

Multi-touch-capable device – tap once to bring up a context-sensitive menu of valid actions applicable to whatever you’ve tapped on. A second tap on the menu selects the command; a tap away from the menu cancels it.

In all honesty, I’d avoid using building any GUI elements that rely heavily on a mouse being available. Both OS X “(Mountain) Lion” and Windows 8 are much more trackpad-centric now, simply because trackpads are what most computer users today have as their default pointing device.

The mouse is going to be a niche peripheral, not a standard input device, within a very short time. It has terrible ergonomics, so it’s about damned time, too. (And, yes, this is why Windows 8 is getting so much flak from the geek community: most of them are heavy mouse users with old-school desktop computers. They’re a niche market, so what they think about Windows 8 really doesn’t matter.)

1027412--38130--$UnityScreenSnapz001.png

Hi sorry I didn’t see your question. It will include the complete interface (action bar, inventory, changing cursors, descriptions, etc). I’m working on the editor now which should help creation of items. I will also be including a dialogue system although I doubt that will make the first release.

stimarco - Lots of excellent info here! Thank you! I’ll start investigating.

Cool! Thanks, JohnnyA!! I’ll definitely keep my eyes peeled. :slight_smile: