Game Development Community

Mouse Events Tutorial?

by Tray Weeds · in Torque Game Engine Advanced · 01/21/2009 (9:17 pm) · 4 replies

I've been looking for a decent TGEA tutorial on using mouse events. I've seen quite a few older ones that don't seem relevant anymore.

What I'm trying to do is create a RPG game where the player can click on (left mouse down) dts objects in the world and when they click on it I'd like to show it in the GuiObjectView so they can rotate it around and zoom in and then close the object viewer when they are done with the object.

I'm fairly new to TGEA and Torque Script but it seems to me something like this has probably already been tackled but there isn't anywhere to find some tutorials so I can play around and teach myself.

This is slightly different than the player selection in the T3D demo because those are static player objects. My game would need to be able to dynamically display these objects as players navigate to them so there may have to be some collisions between the cursor and the object, which I'm pretty fuzzy on.

Any help would be appreciated and I'd be willing to talk what I learn and post a decent tutorial page out there for others in my spot.

Thanks.

#1
01/21/2009 (10:14 pm)
I think the best help i could offer an "fairly new to TGEA " person would be use the SEARCH function here.
#2
01/23/2009 (8:22 pm)
The basics of the bind system are like this:

moveMap.bind(mouse0, "xaxis", yaw);

moveMap - An ActionMap (object).
mouse0 - The device to bind (mouseN, keyboard, joystick).
"xaxis" - For devices with axes, specify which axis to use.
yaw - The name of the script function to call when you get an input event.

Buttons are done the same way except instead of "xaxis" you'd have button0, button1 (no quotes) etc. (with the obvious difference that your value going into your script function is going to be a boolean instead of an axis value).

Hope this helps.
#3
02/01/2009 (7:45 pm)
As far as I know there aren't any. I've been working on the same problem and have posted about it.

http://www.garagegames.com/community/forums/viewthread/83531

I too am looking to make an RPG of sorts but want my control to be like WoW and EQ.
#4
02/01/2009 (8:41 pm)
try this to get you started.

www.garagegames.com/community/resources/view/2173

Near the end of the comments is some information on making it work with TGEA