Game Development Community

Item manipulation with the mouse

by Itay Hauptman · in Torque Game Engine · 02/27/2006 (4:27 am) · 3 replies

Hi everyone,

I'm new to Torque, so I will probably have a lot of questions... hope that's okay :)

I'm trying to create a game in which the player can interact with objects in the environrent by clicking them.
(and perhaps also dragging them to move or rotate)

What is the best way to do this?

Also, how can I "lock" the viewpoint, so the player will not move around with the keyboard
once he arrives in a ceratin place?

Thank you!

#1
02/27/2006 (8:09 am)
There are a few "Object Selection" resources out there. If had a little more coffee in me, I would link you some. I've hacked together an interface that works like World of Warcraft. I just haven't decided yet if my approach is sound.

You'll also want to take a look at the WorldEditor. It'll do way more than you want and fry your brain to look at, but demonstrates most of the things you'll be interested in.

The ActionMap (labeled 'MoveMap') governs keypresses. You can set and clear bindings at will. default.bind.cs defines most keys. You could probably make a function call to bind/unbind a set of keys. A push/pop mechanism might be nice here if there is one.
#2
03/02/2006 (5:44 am)
Thank you for your reply!

Does object selection and maniuplation require re-compiling the engine? Or can this be done with scripts alone?

Also, how do make an arrow cursor qppear on the screen (and manipulate it with the mouse, of course)?

I will look into the ActionMap. does it also controle the mouse? (Il want to limit the player's ability to move the viewpoint with the mouse).
#3
03/02/2006 (6:28 am)
Will require recompilation...

resource

Yup action map would be a nice place to stop the yaw/pitch from the mouse.