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.

DarkBASIC Professional Discussion / Any way to reset 'MouseZ()" to 0?

Author
Message
HellsDevilDog
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location: Ohio
Posted: 18th Sep 2011 11:19
Probably a noob question, but I'd like to know if there's a way to reset mouseZ to 0, thanks for any help

Here's my current method of making MouseZ stay within a certain range of numbers, But I'd just like to know if there's a method to just set MouseZ() to 0.

Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 18th Sep 2011 12:15
You can't, it's needed to track the current depth of mousez. I would suggest using mousemovez, which returns the rate of change in mousez, otherwise returns 0. Example:

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Sep 2011 15:06
Well, although DBPro doesn't provide a way to reset it, you can arrange it yourself:


Basically, when you grab the mousez() value, you subtract a previously snapshotted value at the same time. When you reset, you simply set the snapshotted value to the same value as mousez().

Jeff Miller
21
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 18th Sep 2011 19:43
Hmm. I asked the same question 6 years ago. Same answer basically. If another six years goes by with no update to DBP that resets mouseZ(), I'm going to suspect that it will never come about.

http://forum.thegamecreators.com/?m=forum_view&t=65839&b=1
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 18th Sep 2011 19:56
Well you will already have a do loop, so the 3 line solution surely isn't much hassle.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Sep 2011 22:18
Quote: "If another six years goes by with no update to DBP that resets mouseZ()"


Er? Exactly when should DBPro reset it - and to what value? Automatic resetting to zero each sync, for example, sounds like a recipe for disaster. IanM's solution makes more sense to me.
Jeff Miller
21
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 18th Sep 2011 23:02 Edited at: 18th Sep 2011 23:25
DBP already resets Z automatically to whatever the last change has moved it to since the wheel was first moved, just like the x and y values are continually set to their current position based upon the last move of the mouse. I would regard it as useful to allow me to intentionally reset the Z value to a new start value, which would usually be zero, in the Position Mouse command. That command allows you to reset X and Y to new start values, but not Z. It only causes a reset of X and Y to the specified new start values when you execute the command. Z could be an optional 3rd argument.
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 19th Sep 2011 01:05 Edited at: 19th Sep 2011 01:06
Just use mousemovez(). You can't expect to have EVERYTHING handed to you on a plate, but DBPro gives you most stuff.

[b]

Login to post a reply

Server time is: 2026-07-11 07:05:44
Your offset time is: 2026-07-11 07:05:44