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 / position mouse still has previous data?

Author
Message
Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 21st Jan 2012 00:10 Edited at: 21st Jan 2012 00:11
Howdy guys, here's the problem:

I have a scripted event that moves the player and controls where he is looking. After The events is over and the player is back in control, the player is looking in the direction of wherever he was moving the mouse during the script.


What I'm using to look around:




What I've done:

I've made sure to set the position mouse screen width()/2,screen height()/2 Right before and even after the script ends.

I've recorded the angle that I want them looking after the script and rotated the object and camera to this angle before and after the script

I've replaced my old and new angle values to the new desired angle for when the mouse move script is called.

I don't know what to try next. Your help is greatly appreciated

The fastfood zombie killer
Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 21st Jan 2012 01:53
Odd solution found. There is probably a better way since I don't really understand why the other things I did didn't work.

I called my mouse repositioning/look script right after the event, and inside that script I put in a check to see if a variable testing whether or not a scripted event just happened is true at the end of the file.

When it is true, it did all of the changes before hand to move the mouse where it would normally move, but then I change my variables that hold x and y, then rotate the camera and object again.

I think the reason why this works is because the mousemove() function is called so it resets how far it moved before, but then I rotate everything back to where it should have been.

If anyone has similar problems go ahead and ask me if you need help

The fastfood zombie killer
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 21st Jan 2012 04:16
Wos I was always looking at the mouse move code thinking what better ways to use it to optimise movement but was concerned it will become jerky... do you get this doing the above?

(the challenge is still on muahahhaa)

Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 21st Jan 2012 04:22
Just as long as I calculate everything before I call sync I'll be fine.

And fyi, do you really call yourself competition? Hah, by the time we're done I'll have posted all over your face!!!

The fastfood zombie killer
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 21st Jan 2012 04:27
Hmm so it comes out smooth right? would the end users DPI settings for their mouse not affect this?

(anti sticking cream applied)

Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 21st Jan 2012 05:08
Yah, it worked out perfectly, I just have to adjust it slightly for the transition angle because I just put in a rough number. The problem was that when the player moved the mouse around during the script event, all those changes caught up and took effect once the script ended. What I did was let the change happen, then reversed what it did kinda.


(and no anti-sticking cream is going to make 5 3" screws unstick)

The fastfood zombie killer
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 21st Jan 2012 05:41
Nice... hope I can implement this sometime soon... might try locking a cameras scope angles and giving this a try... like for a cctv camera if you get me...

(metalic sheeting applied... IronMans helmet on mail order...)

Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 21st Jan 2012 07:01
It's going to look great once I get everything tuned just right.

(Are you trying to distract me from my project so you can steal all of the ingacremo glory?)

The fastfood zombie killer
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 21st Jan 2012 09:43
Tuning is a beauty...

(drat he smoked me out... plan b... would you like some cake?)

Hows the project coming along btw¿
I am taking a relaxed approach atm... just need to do a couple of finishing touches and complete the website for it... which is pretty much live anyway just need to get the mechanics done...

Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 22nd Jan 2012 05:07
It's coming along great, but I'm thinking we should refer the rest of this conversation over to ingacremo

Only sad things is that Im manually placing all the overlays in my levels by code. I would have figured 3dworld studio would have support for something like that

The fastfood zombie killer
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 22nd Jan 2012 07:27
See you in nagacremo thread

Login to post a reply

Server time is: 2026-07-09 23:12:29
Your offset time is: 2026-07-09 23:12:29