Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / I need help taking the next step in my RTS game.

Author
Message
Silent Thunder
18
Years of Service
User Offline
Joined: 6th Feb 2006
Location: The Ship
Posted: 20th Jun 2007 08:36
Here is my game's code thus far:


I'm stuck on trying to get a selection/movement system going, I've tried all the snippets I could find around here, but none of them seemed to work. Can anyone help me?

Thanks!
-Silent Thunder



Click on the picture to order your copy today!
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 21st Jun 2007 19:02 Edited at: 21st Jun 2007 19:03
hmmmm
here is an simple snippet showing how to select units on screen with an simple selection box.
but i strongly recomend phalex tutorial for an rts game .
Silent Thunder
18
Years of Service
User Offline
Joined: 6th Feb 2006
Location: The Ship
Posted: 22nd Jun 2007 02:49
Thanks, ill try that.

Does anyone else have any other ideas?



Click on the picture to order your copy today!
Silent Thunder
18
Years of Service
User Offline
Joined: 6th Feb 2006
Location: The Ship
Posted: 6th Jul 2007 07:08
Ok, now I have a basic selection and movement system made, but I have another problem.... I chose to have the object move when I press the right mouse button:



But as soon as I stop holding down that button, the object stops moving. I have tried using loops, but those didn't work, how can I accomplish this?



Click on the picture to order your copy today!
HeavyAmp
17
Years of Service
User Offline
Joined: 25th Oct 2006
Location: Castle in the Sky!
Posted: 6th Jul 2007 17:26
You need to give your objects waypoints(A position where they can move to)

if mouseclick()=2 then set objects waypoint at mousex(), MouseY()
Move object towards waypoint.

Once they are there at the waypoint set the objects positon to be its waypoint it stops the object jittering around on there waypoint.

In theory, there is no difference between theory and practice. But, in practice, there is.

Login to post a reply

Server time is: 2024-09-27 00:19:01
Your offset time is: 2024-09-27 00:19:01