Game Development Community

RTS style interface [help me / get help

by Pauliver · in Torque X 3D · 12/02/2006 (5:37 pm) · 2 replies

I'm playing with TorqueX for a RTS style game. I'm currently working on implementing a gui menu and level scrolling based on position of the mouse in the window (standard RTS mouse on the edge of the screen scrolls in that direction). Im making some progress and will update this thread as i go. However if anyone else is working on a similar goal i would greatly appreciate if they could keep this up to date as well and hopefully we can make each others lives easier .

Thanks for your help

Paul

#1
12/03/2006 (1:33 pm)
Pauliver, I'm playing around with some camera control code and I'll see if I can take a stab at this. Essentially, I'm thinking of tracking the mouse position. When the mouse position reaches the screen bounds, the camera is moved to position of screen bounds minus X, where X is the stopping offset from the screen bounds. I'll check back once I've got something partially working.
#2
12/05/2006 (12:18 am)
Hey guys. Not sure if this is completely (or at all??) applicable, but if you have an object that is moving around via mouse (the cursor), might try getting a reference to your camera, mounting it to your cursor object, then making use of the "UseCameraWorldLimits" bool, as well as the CameraWorldLimits Vector2. Seems like this would do the trick for scrolling.. ?

Might also consider setting a MountForce on the mounted camera (get that neat floaty camera effect.) The camera "lag" could be the entire screen's x & y coords (so that the camera only starts following once the cursor is at the screen's edges).. ? Should you take this route, make sure to set UseMountForce on the camera that is mounting to your object (cursor).

Let me know if this doesn't help, or whether I'm missing something.

-Trevor

PS, I wrote a mouse-based game awhile back for TorqueX. It's not pretty, but it worked fine. Let me know if either of you have any issues involving mouse-based input; happy to pass along what I have.