Game Development Community

Emulating the WoW Interface

by James Spellman · in Torque Game Engine · 02/18/2006 (9:36 pm) · 11 replies

Hey all! I'm experimenting with the 1.4 engine as a departure from my regular projects and seeing if I can emulate the World of Warcraft interface.

What this means is that I need to be able to do the following:

1. Mouse-over usable objects highlights them and cursor changes.
2. Select things with the left mouse-down/up.
3. Use things with the right mouse-down/up.
4. Drag with either left or right mouse-down handles yaw/pitch.
5. Cursor should be visible for all but item 4.

I've worked most of this stuff out in GameTSCtrl except #4. If I do the equivelant of CursorOff on mouse-down, the normal yaw/pitch bind takes over but I can't capture mouse-up. I'm guessing this is because the mouse-down occurred before the context switch.

Any suggestions on a more Script approach or how to handle the yaw/pitch without using the normal bind? How about capturing just the mouse-up?

#1
08/20/2006 (11:26 am)
A few months back, I solved my little problem.

When I turned the cursor off to enable the yaw/pitch code to work, I couldn't get the Mouse Up event to happen. This was because (if memory serves) that the engine was not looking for a Mouse Up action because the Mouse Down happened while the cursor was Active.

Oversimplified, Events when the cursor is Active go the the Canvas and those when the cursor is off go to the regular ActionMap.

My solution was to create a Forced ActionMap event that would make the engine look for the event when the cursor was off.

This worked but led to some interesting side effects.
#2
08/20/2006 (11:45 am)
Since then, I've been working on a less invasive solution and am fairly happy with the results.

I've decided to move more of the code into GameTSCtrl and not go back and forth to the script as often. This created a slightly different challenge as I couldn't get the same yaw/pitch events in the Canvas that you get in the base ActionMap. But with a minor hack, I was able to make it work.

Anyway, the hard work is behind me. I assume there is interest out there for this topic, dispite the lack of posts. I just have a little bit of polishing to do before I share my efforts with the world...
#3
08/20/2006 (11:51 am)
I'd assume they're be some interest. But my interface is all gamepad driven.
#4
08/20/2006 (11:57 am)
I would be interested in this :)
#5
08/20/2006 (1:24 pm)
I've worked through the exact same issues you discuss James, probably just about the same time also (Feb 2006) :)

My solution, if I recall, involved catching the root mouse down/up events in the engine - before it has decided which GUI obejct 'owns' the mouse - and calling a script function from there. This script function then decides whether to show/hide cursor, rotate camera, etc.
#6
08/20/2006 (4:43 pm)
I'm very interested, but unfortunately I am still struggling with the basics of Torque :(
#7
08/20/2006 (5:31 pm)
@Sam - I admit that's an option I hadn't thought of. :)

I think I'm satisfied with my version. Now I'm going to try and stick it back in the stock TLK and see what kind of damage it does.
#8
08/21/2006 (1:03 pm)
Share with the masses James! ;)
#9
08/21/2006 (9:10 pm)
James, this would be awsome 5.0 resources if you could turn the whole gui step bystep from beginner to learner to master it. in a great tutorial.
#10
08/22/2006 (12:25 am)
I agree with Robert. An extensive tutorial would be cool. But so will a resource ;)
#11
09/06/2006 (10:18 am)
My resource is now available here.