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.

AppGameKit Classic Chat / FPS/3PS Mouselook in AGK

Author
Message
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 7th Jan 2017 20:06
I'm trying to achieve Mouselook in AppGameKit without depending on left click or right click to initiate the mouselook. You know how in regular FPS and 3PS games you can control the heroes aim/orientation just by moving the mouse?

Now how I do this currently is to log the pointers X and Y positions the moment I click the right mouse button, while the right mouse button is down I track the changes in the pointers X and Y position and apply those changes as angles to the camera. I'm trying to drop the dependency on the right mouse button but the problem I run into is when the pointer is at the extreme left, right, top or bottom of the screen you can no longer track mouse movement in that direction because there's no change in pointer position.

Now Dark Basic Pro had some neat little functions - mousemovey() and mousemovex() - that track changes in mouse movement irrespective of the position of the pointer. So for example, even when the pointer is at the extreme left of the screen and you still drag the mouse left, mousemovex() will still register movement. That's why in your FPS you can move your mouse to the left, pick it up, move it to the right, drop it back down on the table, move it to the left again and if you continue this action your character will continue spinning around. I don't think you can achieve this in AppGameKit, I may be wrong though.

Has anyone found a way around this with AppGameKit? A code snippet would be helpful. I did a quick search of the forums but couldn't find anything tangible.
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 7th Jan 2017 21:14
Maybe this can help?



[/url]
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 7th Jan 2017 22:47
you should only set the mouse in the middle if it get neat the border.
in game you should toggle between mouse look and mouse pointer, so the mouse can use free.
you can use mouse x speed for the y axis to turn your whole player,
w/s key forward/back, a/d key sideways left/right.
mouse y speed for look one object / the head up down limited by angle.

GetRawMouseX ()
GetRawMouseY ()
SetRawMousePosition ( x, y )
SetRawMouseVisible ( visible )

if you using physics see 3DPhysics/CharacterController
https://www.appgamekit.com/documentation/commands.html
AGK (Steam) V2.0.22 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12)

Login to post a reply

Server time is: 2024-09-29 21:24:19
Your offset time is: 2024-09-29 21:24:19