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 / possible for 2 variables to = mousemove?

Author
Message
Uriel The Ignoble
23
Years of Service
User Offline
Joined: 13th Jun 2003
Location: In a tiny box in the attic
Posted: 19th Jun 2003 07:06
the camera on this thing has been a pain since day 1, and i still can't get it to do what i want, even though what i want isnt that complex.. im trying to get a basic 3rd person mouselook that isnt screwy.. i made an invisable object representing where the aiming reticle would be, in front of the character and pointed the camera at it, then i made am invisable object that the camera is positioned at.. becuase i need the camera to stay behind the player, not drifting off to the sides when you look around..
i could get it to work just fine if mousemovex and mousemovey would respond to 2 variables, but it wont..
if you go
MMX# = mousemovex()
MMY# = mousemovey()
MMX2# = mousemovex()
MMY2# = mousemovey()
print MMX#
print MMY#
print MMX2#
print MMY2#
when you run the program, it will print the MMY# and MMY# as the coordinates, but it will print MMX2# and MMY2# as 0
you also cant make the mousemove 2 do things at once..
i tried move object up 1, mousemovex()
move object down 2, mousemovex()
only one of them will actually move..
is there a way around this?

ive tried everything i can think of.. this is the only thing that will actually work, IF if could get the mouse to = 2 variables at once, or make it do 2 things at once..
The Darthster
23
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 19th Jun 2003 12:45
Why not just use one of the variables twice? They're both the same anyway.

Or, if you really must have two separate variables containing exactly the same thing, set mmx2# = mmx# and mmy2# = mmy#.

My guess is that mousemove() can only be used once per sync, there's a similar problem with screen fps().

Once I was but the learner,
now, I am the Master.
Uriel The Ignoble
23
Years of Service
User Offline
Joined: 13th Jun 2003
Location: In a tiny box in the attic
Posted: 19th Jun 2003 16:38
alright, thanks darthster ill give that a try..

Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 19th Jun 2003 21:42
when you read mousemove x() or y() then it zeros the value so that it can count the next difference in position from when it was last read, because it returns the difference between the current and last position, with that code you are reading the mouse so fast that it cannot read the difference in position between the first read and the next read (that must be happening something like 2 nanoseconds later), your average mouse doesn`t travel far in 2 nanoseconds

Mentor.

Bloodshot
23
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United Kingdom
Posted: 20th Jun 2003 05:03 Edited at: 23rd Jun 2003 19:45
Can't you use MouseX() and MouseY() instead?

Example:
Uriel The Ignoble
23
Years of Service
User Offline
Joined: 13th Jun 2003
Location: In a tiny box in the attic
Posted: 22nd Jun 2003 18:18
setting mousemove to equal 2 variables worked fine for me
mouse(x) and mouse(y) returns the mouse coordinates
i guess it could work if i used mouse(x) and mouse(y) added to the current angle of the camera..

is it just me or is it a huge pain to make a 3rd person chase camera?.. you cant point the camera at anything if you have chasecam, but chasecam wont let you look up or down! agh!..

Login to post a reply

Server time is: 2026-07-06 01:19:14
Your offset time is: 2026-07-06 01:19:14