blenderNetworkpatreonblender-logosdheartuserthtimesbookphotopencilmap-markerchevron-rightbancommentcommentstwitterfacebookrsschainnavicongoogle-plusenvelopelinkedinmail-replycalendar-otumblrredditstumbleuponshare-altbloggerflattrflag

RTS Style Mouse Movement

RTS Style Mouse Movement

Postby 3LeggedDog » December 3rd, 2010, 10:35 pm

NOTE: The file posted below was made with Blender 2.49b - use any other version at your own risk.
I was messing around with Blender's data blocks yesterday and happened upon a pretty simple way of setting up what is commonly refered to as a god's eye view. Play many games, do you? Well, I do, but not so much the Real Time Strategy type, but that may change. This is how it is supposed to work; you have a view, from above, of the playing field. You can zoom in by scrolling the mouse wheel, and move the view forward or back, or side to side, by moving the mouse pointer all the way to the the edge of the screen. Here is the blend file.
MouseRTSmovement4.blend

First of all you need a mouse pointer. The script for that is just 2 small lines, connected to an Empty and through an Always sensor. The zooming function is also easy - just connect two sensors to the camera, and instead of using the default Always sensor, reset both to Mouse, and then Wheel Up and one to Wheel Down. (This will move the camera in the Z direction.) Making the camera move from side to side, and forward and backward was a little trickier; I ended up making four seperate panels with a clear material, that are placed at the four far edges of the camera view. All of the panels are parented to the camera, and all of the panels has its own sensor - which is a Mouse Over sensor. The sensors are NOT connected to the respective panel Controllers or Actuators - they are connected to the CAMERA Controllers and Actuators. This is made possible only if the objects are parented. (After parenting each panel to the camera individually you must select all of them together so all of the data blocks appear at the same time, thus making it possible to connect the Sensors from one object to the Controllers and Actuators of any other parented object and or camera.)
Anyway, just press P, and then move the mouse pointer to the edge of the screen, and use the mouse wheel to zoom in and out. Also, the camera was angled slightly, to give a forward-looking view. Personally, I'm just amazed the contraption actually works! :Dance:
(It works very well once it is made into an .exe - the mouse pointer has a tendency to just keep on going outside the 3D window when the program is run inside of Blender - which is why I use v.2.49b, so I can check if the program is actually going to work. v.2.5 and above cannot make an .exe. :shock: )
You do not have the required permissions to view the files attached to this post.
User avatar
3LeggedDog
Contributor
Contributor
 
Posts: 145
Joined: June 13th, 2010, 1:49 pm

Re: RTS Style Mouse Movement

Postby IrascibleOne » December 3rd, 2010, 11:10 pm

That is sweet! :clap: Most people are so intent on doing first person shooters I never really thought about God-Mode view.

It works in 2.55 as well, if anyone cares to know.
Image
User avatar
IrascibleOne
Site Admin
Site Admin
 
Posts: 1539
Joined: July 31st, 2008, 7:14 pm

Re: RTS Style Mouse Movement

Postby 3LeggedDog » December 4th, 2010, 12:16 am

Lol; I'm not the only one who stays up half the night! Thanks IrascibleOne! :D
(Good to know it works in the newer versions. :Dance: )
User avatar
3LeggedDog
Contributor
Contributor
 
Posts: 145
Joined: June 13th, 2010, 1:49 pm

Re: RTS Style Mouse Movement

Postby SPARTAN-001 » December 4th, 2010, 7:01 am

Works really well! It feels almost exactly the same as if it was an RTS game, too.
//SPARTAN
Image
Practice makes perfect and nothing is perfect, so why practice? -brektzar
User avatar
SPARTAN-001
Legend
Legend
 
Posts: 1106
Joined: November 5th, 2008, 4:23 pm

Re: RTS Style Mouse Movement

Postby 3LeggedDog » December 4th, 2010, 10:22 am

Thanks Sparta-001! :D (Told u I'd post it! Glad u like it!) Now, if we could just, ahem, get some of the coders on this site to show us how to make a little tank kill another little tank, we'll have the beginnings of a game! :whistle: :roll: :shock: :lol:
User avatar
3LeggedDog
Contributor
Contributor
 
Posts: 145
Joined: June 13th, 2010, 1:49 pm
Return to Works in Progress

Who is online

Users browsing this forum: No registered users and 2 guests

cron