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.

Dark Physics & Dark A.I. & Dark Dynamix / Controlling a box with a mouse

Author
Message
Black Mesa
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location:
Posted: 10th Aug 2006 06:34
Im trying to control a dynamic box with a mouse so that you can drag it about using the mouse. I had it working using set linear velocity -mousemovex() and -mousemovey(). The problem is that when you rotate the camera the x and y axis of the mouse no longer line up with the x and y values in the game so moving the mouse up will move the box to the side for example. I've tried a couple things but none of them seem to work and setting it to mousex() and mousey() just makes the box fling off in a crazy direction.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 10th Aug 2006 07:14 Edited at: 10th Aug 2006 07:24
Might be something you are after.



I'm not getting you down am I, Ho Look! another fancy Door?
Black Mesa
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location:
Posted: 10th Aug 2006 19:40
Thats really helpful, I just need to change it so that moving the
mouse up and down moves the block towards and away not up and down. Care to explain how it works, I feel bad using code I didnt write and dont quite understand.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 11th Aug 2006 06:12 Edited at: 11th Aug 2006 06:20
Well the code comes from the help files for 'pick object' all I did was add the gousub to code.

As for how it work your guess is as good as mine, I just kept on trying thing untill I found a command that did what I was looking for.

someone else may know what to do.

edit

this how you can do it using the mouse wheel

pick screen mousex(),mousey(),pickdistance#+(mousez()/128)

had a brain wave got to do it with mouse wheel, will be trying other way ,I might find it.



I'm not getting you down am I, Ho Look! another fancy Door?
Black Mesa
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location:
Posted: 12th Aug 2006 02:49 Edited at: 12th Aug 2006 07:07
-Edit- Never mind I anwsered my own question.

Login to post a reply

Server time is: 2024-03-28 17:01:49
Your offset time is: 2024-03-28 17:01:49