Author Topic: Player Camera rotation not working  (Read 1786 times)

polynut

  • Newbie
  • *
  • Posts: 43
Player Camera rotation not working
« on: January 18, 2021, 06:18:19 PM »
Hi guy's the disable guy again trying to get something to work with VA

I did it once with a game call Call of Prypiat and it was working fine but i cannot make it work in a similar game title Metro exodus.

I made a mouse move command to rotate the player camera but the game simply ignore it when i call the command.

If i move the mouse in game from left to right it is working but not with the VA mouse move command, so here a picture and if anyone have any clue please share your thought on it

https://imgur.com/w21Kc0x

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Player Camera rotation not working
« Reply #1 on: January 18, 2021, 06:24:10 PM »
Have you tried relative units? Use the "Adjust the Mouse Cursor Location" section (E.G. set "Move left" to 100 units) and check the "Move using relative data (useful for 3D games)" option, to see if that has any effect ingame.

Some game input systems don't use the absolute cursor position, and only respond to relative movement.

polynut

  • Newbie
  • *
  • Posts: 43
Re: Player Camera rotation not working
« Reply #2 on: January 18, 2021, 09:50:08 PM »
Have you tried relative units? Use the "Adjust the Mouse Cursor Location" section (E.G. set "Move left" to 100 units) and check the "Move using relative data (useful for 3D games)" option, to see if that has any effect ingame.

Some game input systems don't use the absolute cursor position, and only respond to relative movement.

Hi Pfeil hope everything is fine for you and i now know why it was not working, i was trying to combine this with a remote Gyro to assist in turning further since the remote gyro is strap on my head with a flashlight head band and as a normal human i cannot rotate my head to make a full 360 degree turn to look around me in the game. So i was looking for a way to accentuate the gyro rotation with voice command but it seem that enabling the gyro remote cancel the voice command.

It is working fine when i shut off the gyro remote so maybe there is a way i can make that mouse move command to continue constantly at a certain speed rate and stop it with another voice command like View left then stop view but i have no clue how and if it is feasible in VA?

Here i am just experimenting if i can do something with the remote + i have since VA see it when i click on joystick option, maybe pov switch but i am very new to these kind of controls, here a pic

https://imgur.com/2wGB7gk

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Player Camera rotation not working
« Reply #3 on: January 18, 2021, 09:58:56 PM »
This profile may be worth trying

polynut

  • Newbie
  • *
  • Posts: 43
Re: Player Camera rotation not working
« Reply #4 on: January 18, 2021, 10:06:35 PM »
This profile may be worth trying

Thank Pfeil but i am going to be honest here and i have no idea how and where to put all those scripts and i am not sure what they are doing exactly?

Sorry to be such a noob when it come to more advance stuff but i am willing to learn since i want to be able to play more games with my disability.

Also i don't know if you saw my edit on previous post maybe this could be worth a try to

Here i am just experimenting if i can do something with the remote + i have since VA see it when i click on joystick option, maybe pov switch but i am very new to these kind of controls, here a pic

https://imgur.com/2wGB7gk

polynut

  • Newbie
  • *
  • Posts: 43
Re: Player Camera rotation not working
« Reply #5 on: January 18, 2021, 11:18:29 PM »
OK after a little fiddling i was able to make your profile to work in game.

Also is there some kind of functions that could smooth the turning since it goes on incremental steps?

Also i don't know how to say the commands include in the line, like do i have to say go sprint fast and go sprint slow, not sure about that?

EDIT: OK i am all excited like a kid on Christmas eve since the profile is working even with the gyro remote on and i think it would only be a matter of a few tweaks to the code to refine it to work like i would want, let me explain ;

The gyro remote is working perfectly if i can position my head precisely because a slight move and the view switch abruptly to the sky or floor but for turning around me with go left and go right work fine. So maybe there is a way to constrain the script to not go pass a certain height since the gyro remote work fine to look up or down but i am lacking decent codding skills.

Again sorry for my noobinish!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Player Camera rotation not working
« Reply #6 on: January 19, 2021, 07:56:38 AM »
i have no idea how and where to put all those scripts
There's a .vap file attached to that post (shown at the bottom), which you can import either into an existing profile, or as a standalone profile (in case of the latter you'd need to include that profile into any profile you want to use it in, either into each profile individually, or as a global profile).


The command phrases consist of one or two (for diagonals) directions, and optionally a speed.
For example: "up", "up crawl", "up slow", "up fast", "up sprint", or "left up", "left up crawl", "left up slow", "left up fast", "left up sprint"
(you also have the option of speaking "go", at the start of any phrase, E.G. "go up").

(this profile can be used to show all the possible spoken phrases the contents of a "When I say" field would generate; again, the .vap file is at the bottom of the post)


While it wouldn't be very noticeable while moving the cursor across the screen normally, when moving a camera around you may be seeing the jumps in coordinates the command generates (E.G. at "fast" speed, the cursor position jumps by 9 pixels each time it moves, every ~50ms), or the delay between the jumps (E.G. at "crawl" speed, the cursor moves 1 pixel each ~125ms)

You can try reducing either or both the delay and the amount of pixels per jump, however you'll want to check whether 0ms delay with 1 pixel jumps is fast enough, as that is the smoothest it can go without changing the "Resource balance offset" option (which may also be a possibility, but it would use more system resources as the loop will come around more often)

Another thing you can try is to check the "Move using relative data (useful for 3D games)" option, though that may not make a difference in perceived smoothness.


The gyro remote is working perfectly if i can position my head precisely because a slight move and the view switch abruptly to the sky or floor but for turning around me with go left and go right work fine. So maybe there is a way to constrain the script to not go pass a certain height since the gyro remote work fine to look up or down but i am lacking decent codding skills.
It is possible to stop the cursor's absolute position from exceeding a certain value, however in most games this may not have the desired effect when controlling the camera, as that movement is relative (I.E. the absolute position of the cursor on screen does not necessarily equate to any given position of the ingame camera)

A limit could be implemented by modifying the "mouse movement loop" command, like this:
Code: [Select]
Set integer [minimumY] value to 400
Set integer [maximumY] value to 600
Start Loop While : [stopMoving] Equals False
    Begin Condition : ([incrementY] Is Greater Than 0 AND [{EXP: {MOUSESCREENY} > {INT:maximumY}}] Equals '1') OR ([incrementY] Is Less Than 0 AND [{EXP: {MOUSESCREENY} < {INT:minimumY}}] Equals '1')
        Begin Integer Compare : [incrementX] Equals 0
            Exit Command
        Else
            Set integer [incrementY] value to 0
        End Condition
    End Condition
    Move mouse right [{INT:incrementX}] pixel(s), down [{INT:incrementY}] pixel(s) (from cursor position)
    Pause a variable number of seconds [incrementDelay]
End Loop

This modified version is attached to this post for importing. The limit values were set arbitrarily; you'll want to adjust those for your screen.


As the command is set up, if you move diagonally, it will keep moving along the X axis when is reaches the Y axis limit. If you'd rather have it stop completely, modify the command to something like
Code: [Select]
Set integer [minimumY] value to 400
Set integer [maximumY] value to 600
Start Loop While : [stopMoving] Equals False
    Begin Condition : ([incrementY] Is Greater Than 0 AND [{EXP: {MOUSESCREENY} > {INT:maximumY}}] Equals '1') OR ([incrementY] Is Less Than 0 AND [{EXP: {MOUSESCREENY} < {INT:minimumY}}] Equals '1')
        Exit Command
    End Condition
    Move mouse right [{INT:incrementX}] pixel(s), down [{INT:incrementY}] pixel(s) (from cursor position)
    Pause a variable number of seconds [incrementDelay]
End Loop
« Last Edit: January 19, 2021, 09:18:18 AM by Pfeil »

polynut

  • Newbie
  • *
  • Posts: 43
Re: Player Camera rotation not working
« Reply #7 on: January 19, 2021, 09:42:30 PM »
Thank you very much for such a detail post and for tweaking the script Pfeil, you are such a wonderful person and since i am a talk person involved in disable people organization you are not only helping me but many other disable people around the world with since i distribute the knowledge i learn from you to them so they can all benefit from it.

I didn't have time tonight to test the script iteration but i will tomorrow and i will comment back once done.

There are some devices out there that can help disable people but 99% of them cannot afford them unfortunately so that's the reason i am trying my best at getting cheap solution so they can all enjoy playing games.

Like the remote + on a head strap flashlight cost only 13 $ and VA is so affordable making it possible for these people to enjoy games since it's the only thing that give them a little freedom.

polynut

  • Newbie
  • *
  • Posts: 43
Re: Player Camera rotation not working
« Reply #8 on: January 20, 2021, 09:39:08 PM »
I feel sorry Pfeil i made you work for nothing since to make this work was as simple as pushing the mouse sensitivity to maximum in game options and now only with the remote+ gyro i can turn 180 degree with just a slight turn of my head.

I never thought the gyro of the remote could be affected by this setting.Now just need to adjust it a little to make my head turn a little more precise since at maximum it's way too sensitive.

But i learn from your script and it will still be helpful to browse and read documents. Thank for all you are doing and your patience.

polynut

  • Newbie
  • *
  • Posts: 43
Re: Player Camera rotation not working
« Reply #9 on: January 20, 2021, 10:27:38 PM »
Almost there but would need to understand a few thing to make it fully workable.

Does 1 Mickeys units = 0.0377952756 pixel?

The goal is to correct the position of the gyro remote since i can turn to see in my back but that position is hard on the neck to maintain so i need to make a correction to bring the neck in the center of view.

So i did a center command to move to coordinate and i have determine the center of the screen that is x 980 and y 540 but this command don't work at all even if recognize.

So since this one was not working i went for a left and right correction via the mouse move Adjust Mouse Cursor Location and i put 50 Mickeys in both the left and right mouse move but it's still cumbersome to correct the position of the cursor so my neck could be more center.

I can almost play normally but i also need to make the front, back, left, right move command to react more like just a tap on the key to advance just a bit because as it is set right now if i say front to move ahead and stop to release it i move too much ahead and often fall to my death because stop command was not fast enough.

So is there a way to simulate just a little tap on the up arrow key so the player just move by slow increments?
« Last Edit: January 21, 2021, 01:36:43 AM by polynut »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Player Camera rotation not working
« Reply #10 on: January 21, 2021, 08:52:23 AM »
What a given amount of mouse movement equates to in a game depends on the input system of that game. If it applies acceleration or "negative acceleration", it can even depend on how often and/or how far you move the cursor in a given period of time (this can apply to non-relative movement as well).

Rather than attempting to move the exact distance to the center of the screen, which is unlikely to be reliable because of the variability in ingame input, you could try using the "Restrict Mouse Movement" action set to 100% to stop the cursor from moving, so you can center your head physically, without moving ingame, after which you'd use a second command to set the restriction to 0% so you can move the cursor again.

Do make sure you have a command you can reliably trigger that executes the "Make VoiceAttack Stop Processing All Commands" action, which will also lift the mouse movement restriction, so you're not left without mouse movement if for whatever reason the normal command doesn't execute.


For the arrow keys, you could create an additional set of commands where E.G. "nudge right" presses the right arrow key for a set amount of time, like
nudge right
Code: [Select]
Press Right key and hold for 0.03 seconds and release
so you can tweak the hold time to move roughly the distance you're looking for (keeping in mind that this too will depend on ingame systems)

polynut

  • Newbie
  • *
  • Posts: 43
Re: Player Camera rotation not working
« Reply #11 on: January 21, 2021, 09:08:35 PM »
What a given amount of mouse movement equates to in a game depends on the input system of that game. If it applies acceleration or "negative acceleration", it can even depend on how often and/or how far you move the cursor in a given period of time (this can apply to non-relative movement as well).

Rather than attempting to move the exact distance to the center of the screen, which is unlikely to be reliable because of the variability in ingame input, you could try using the "Restrict Mouse Movement" action set to 100% to stop the cursor from moving, so you can center your head physically, without moving ingame, after which you'd use a second command to set the restriction to 0% so you can move the cursor again.

Do make sure you have a command you can reliably trigger that executes the "Make VoiceAttack Stop Processing All Commands" action, which will also lift the mouse movement restriction, so you're not left without mouse movement if for whatever reason the normal command doesn't execute.


For the arrow keys, you could create an additional set of commands where E.G. "nudge right" presses the right arrow key for a set amount of time, like
nudge right
Code: [Select]
Press Right key and hold for 0.03 seconds and release
so you can tweak the hold time to move roughly the distance you're looking for (keeping in mind that this too will depend on ingame systems)

Thank again for your help but my joy has gone since the gyro is not affected by the mouse restriction and the command work if i test it on desktop but not in game with the remote gyro unfortunately. Curiously the command work in game menu but not in game.

For the move command the instructions work but i would like to make something similar to your script to make multiple phrases ex: move front crawl, fast, slow so i will try to emulate the phrase in your script and see if i can make it this way.

Thank again for your patience but the only partial solution is to correct the mouse left and right with the mouse move window.
« Last Edit: January 21, 2021, 10:39:14 PM by polynut »