Thread Tools Display Modes
08-02-15, 02:36 PM   #1
Calsive
A Defias Bandit
Join Date: Aug 2015
Posts: 3
Help with mouse turning sensitivity addon

Hello.

I am trying to get back into playing World of Warcraft after a bit of a break. I've been playing a lot of FPS's and found myself lowering my sensitivity.

Long story short now that I am returning having lowered my sensitivity I noticed that the mouse look sensitivity is too high for me. (mouse turning)

The mouse look speed option in the interface menu is lowered completely.

I have the console command:

/console SET cameraYawMoveSpeed "#"

This works perfectly replacing # with about 30-40. My issue is that I cannot find a way to implement this setting permanently. I have placed SET cameraYawMoveSpeed "40" at the end of my config.wtf file in an attempt to apply the change by default but the file seems to be managed server side and instantly erases any changes saved to it even after changing the file to read-only. I have also attempted to add that line to a character's specific config file with no luck.

My solution was to create an addon that runs the code on startup; however, I understand that LUA cannot pull / (slash) commands directly. I attempted to find an API for cameraYawMoveSpeed but I was unable to find anything...

I had as follows:

Lower_Sensitivity (Folder)

>Lower_Sensitivity.lua
>>/run SET cameraYawMoveSpeed "40"

>Lower_Sensitivity.toc
>>## Interface: 60000
## Title: Lower_Sensitivity
Lower_Sensitivity.lua

I'm not very good at working with LUA but this sensitivity does bother me enough to dig this deep to try to find a fix.

TLDR: I want my mouse look speed slower than my mouse speed in game. No I can't just lower the speed of my mouse because then the regular cursor speed is too slow.
  Reply With Quote
08-02-15, 03:34 PM   #2
Calsive
A Defias Bandit
Join Date: Aug 2015
Posts: 3
Originally Posted by Leatrix View Post
You can enter something like this ...
Code:
local frame = CreateFrame("FRAME")
frame:RegisterEvent("PLAYER_LOGIN")
frame:SetScript("OnEvent", function()
	SetCVar("cameraYawMoveSpeed", "40")
end)
... into addon.bool.no, click "Create my Addon" at the bottom of the page and you have an addon that's ready for use.
That is a tool I have been looking for... Thank you. The addon does not however successfully change my sensitivity on login. Is this command perhaps something that cannot be run automatically? I think I read somewhere that some lines of code cannot be automated to prevent addons from controlling your game...
  Reply With Quote
08-02-15, 05:39 PM   #3
Calsive
A Defias Bandit
Join Date: Aug 2015
Posts: 3
Originally Posted by Leatrix View Post
I changed the event in my original reply and added a confirmation message. In my tests, it works fine. Please try it.

Edit: I also added a setting for the pitch movement speed. The game sets the pitch movement speed to half of the yaw movement speed when you change the 'Mouse Look Speed' setting in the game options panel ('Mouse' menu) so it's a good idea to set that in the code too.
Wow. That one worked for me. Thank you so much, Leatrix! My OCD will finally let me play the game!
  Reply With Quote
09-09-16, 05:28 AM   #4
Grimdark
A Defias Bandit
Join Date: Jul 2014
Posts: 3
I (and probably many others) have run into the same problem.

Adding
SET cameraYawMovespeed "35"
SET cameraPitchMovespeed "18"
to Config.wtf simply does not work.

I would have to manually type this every single time i log in, or even after /reloadui. This is of course a massive pain in the ass.
I tried to look for an addon to do this automatically, and found this thread. However, this "Leatrix" person's posts have dissapeared, and with it the fix that made the addon work.

I changed the event in my original reply and added a confirmation message.
Changed to what event? How do you add a confirmation message?
  Reply With Quote
09-11-16, 12:45 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
The problem you guys are running into is that (some of) your settings are saved server-side, but aren't always loaded yet when an addon file runs. I don't know what Leatrix posted (and he/she has a long and annoying history of deleting useful posts for no apparent reason, unfortunately) but my first suggestion would be to use the VARIABLES_LOADED event instead of PLAYER_LOGIN. VARIABLES_LOADED fires each time some set of Blizzard settings (cvars, keybindings, etc) gets loaded.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-12-16, 05:37 PM   #6
Grimdark
A Defias Bandit
Join Date: Jul 2014
Posts: 3
Originally Posted by Phanx View Post
The problem you guys are running into is that (some of) your settings are saved server-side, but aren't always loaded yet when an addon file runs. I don't know what Leatrix posted (and he/she has a long and annoying history of deleting useful posts for no apparent reason, unfortunately) but my first suggestion would be to use the VARIABLES_LOADED event instead of PLAYER_LOGIN. VARIABLES_LOADED fires each time some set of Blizzard settings (cvars, keybindings, etc) gets loaded.
Thanks for the reply! I still can't get it to work. Here's what my addon currently looks like:

Code:
## Interface: 70000
## Title: m_yaw-fix
code.lua
Code:
-- This file is loaded from "m_yaw-fix.toc"

local frame = CreateFrame("FRAME")
frame:RegisterEvent("VARIABLES_LOADED")
frame:SetScript("OnEvent", function()
  SetCVar("cameraYawMoveSpeed", "35")
  SetCVar("cameraPitchMovespeed", "18")
end)
cvars still aren't activated ingame. I have to click a macro every time i log in.
Would appreciate any help!
  Reply With Quote
10-12-16, 06:00 PM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Use something like this to figure out when the cvars are being changed:

Code:
local cvars = {
    cameraYawMoveSpeed = "35",
    cameraPitchMovespeed = "18",
}

for k, v in pairs(cvars) do
    SetCVar(k, v)
end

local f = CreateFrame("Frame")
f:RegisterAllEvents()
f:SetScript("OnEvent", function(self, event)
    for k, v in pairs(cvars) do
        if GetCVar(k) ~= v then
            print(event, k, v)
            SetCVar(k, v)
        end
    end
end)
This should print a message to the chat frame any time any event fires, if one of the given CVars doesn't have the desired value. Once you figure out which event is changing it, change your code to listen for that event instead of (or in addition to) VARIABLES_LOADED.

(Definitely do not use RegisterAllEvents in any normal, non-testing code if you like your framerate.)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-14-16, 07:08 PM   #8
Grimdark
A Defias Bandit
Join Date: Jul 2014
Posts: 3
Originally Posted by Phanx View Post
Use something like this to figure out when the cvars are being changed:

Code:
local cvars = {
    cameraYawMoveSpeed = "35",
    cameraPitchMovespeed = "18",
}

for k, v in pairs(cvars) do
    SetCVar(k, v)
end

local f = CreateFrame("Frame")
f:RegisterAllEvents()
f:SetScript("OnEvent", function(self, event)
    for k, v in pairs(cvars) do
        if GetCVar(k) ~= v then
            print(event, k, v)
            SetCVar(k, v)
        end
    end
end)
This should print a message to the chat frame any time any event fires, if one of the given CVars doesn't have the desired value. Once you figure out which event is changing it, change your code to listen for that event instead of (or in addition to) VARIABLES_LOADED.

(Definitely do not use RegisterAllEvents in any normal, non-testing code if you like your framerate.)
I used exactly the code you posted, and it worked! The cvars are applied ingame. The only event i've ever seen printed is simply "ADDON_LOADED" once when i log in. (every time)
However, i tried changing the line f:RegisterAllEvents() to f:RegisterEvent("VARIABLES_LOADED") and it stopped working again.
[EDIT] i changed it to ADDON_LOADED and now it works. Thanks m89!

Last edited by Grimdark : 10-14-16 at 07:14 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Help with mouse turning sensitivity addon


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off