It seems that running your mod, I can manually edit the player characters animation speed multiplier by using player.setav 2d2.
Personally, I am setting it to "player.setav 2d2 135" and that provides a nice brisk walking pace without mucking anything up.
Would it be possible for your scripts to run this command when the player toggles walking? Then set it back to vanilla values when the player untoggles walking? This would accomplish the speed multiplier you were hoping to implement.
Here is my rough implementation. (still testing) I think the problem is when this mod progamaticaly forces walking mode, the game sets speed to 100 always.
goal: mod enable -> control walk speed by this mod mod disable -> control walk speed by other mod like "Increased Walking Speed"
function SaveGameSettings() @@ -66,6 +71,7 @@ function SaveGameSettings() MCM.SetModSettingFloat("EffortlessMovementControl", "fRunStopTimerDelaySeconds:General", fRunStopTimerDelaySeconds) MCM.SetModSettingFloat("EffortlessMovementControl", "fRunStartTimerDelaySeconds:General", fRunStartTimerDelaySeconds) MCM.SetModSettingFloat("EffortlessMovementControl", "fWeaponDrawCheckTimerDelaySeconds:General", fWeaponDrawCheckTimerDelaySeconds) + MCM.SetModSettingFloat("EffortlessMovementControl", "iWalkSpeedAdd:General", iConfigWalkSpeedAdd) MCM.RefreshMenu() ; Stored new settings, update in MCM menu EndFunction
@@ -119,7 +125,16 @@ function SetWeaponDrawCheckTimerDelaySeconds(float delay) StartTimer(fWeaponDrawCheckTimerDelaySeconds, weaponDrawCheckTimerId) EndIf EndFunction - + +function SetWalkSpeedAdd(int add) + if add >= 0 && add <= 50 + iConfigWalkSpeedAdd = add + else + ; mode upgrade may cause this + ;Debug.Notification("EMCQ::SetWalkSpeedAdd - value out of range: " + add) + endif +EndFunction + Event OnMenuOpenCloseEvent(string menuName, bool opening) If menuName == "WorkshopMenu" workshopMenuOpen = opening @@ -136,6 +151,34 @@ Event Actor.OnPlayerLoadGame(Actor akSender) LoadGameSettings() EndEvent
+float Function ModAV(ActorValue avItem, float fModVal = 0.0) + float curVal = player.GetValue(avItem) + if fModVal > 0.0 + player.SetValue(avItem, curVal + fModVal) + else + player.SetValue(avItem, curVal + fModVal) + endif + return player.GetValue(avItem) +EndFunction + +function EnableRunning(bool enable) + If !enable + forceWalkLayer.EnableRunning(false) + if !player.IsRunning() && !player.IsSprinting() + if fActiveWalkSpeedAdd == 0 + fActiveWalkSpeedAdd = iConfigWalkSpeedAdd + endif + ModAV(SpeedMult, fActiveWalkSpeedAdd) + endif + Else + if fActiveWalkSpeedAdd != 0 + ModAV(SpeedMult, -fActiveWalkSpeedAdd) + fActiveWalkSpeedAdd = 0 + endif + forceWalkLayer.EnableRunning(true) + Endif +EndFunction + Event OnControlDown(string control) If control == "Sprint" If forceWalkLayer != None @@ -143,17 +186,17 @@ Event OnControlDown(string control) If forceWalkLayer.IsRunningEnabled() If player != None && !player.IsRunning() && !player.IsSprinting() ; We can run and try to toggle it off while standing - forceWalkLayer.EnableRunning(false) + EnableRunning(false) EndIf Else ; We cannot run and try to toggle it on - forceWalkLayer.EnableRunning(true) + EnableRunning(true) EndIf ElseIf !temporarilyDisabled If TemporaryDisable() return EndIf - forceWalkLayer.EnableRunning(true) + EnableRunning(true) ; We disallow running once the player no longer runs after pressing sprint. ; Originally used OnControlUp, but it was tiring to hold the button down on controller. ; Then used a timer that constantly checks the run state, but the ShouldStartWalking check is not always immediately true when you start running @@ -176,13 +219,16 @@ function ToggleEffortlessMovementControl() EndFunction
function StartMod() + ; original SpeedMult may be vary but this mod indirectly needs assumtion it is 100 + ; forceWalkLayer.EnableRunning(false) always set SpeedMult to 100 + player.SetValue(SpeedMult, origSpeedMult) CancelTimer(runStopTimerId) temporarilyDisabled = false workshopMenuOpen = false isInCombat = false player = Game.GetPlayer() forceWalkLayer = InputEnableLayer.Create() - forceWalkLayer.EnableRunning(false) + EnableRunning(false) UnregisterForAllRemoteEvents() RegisterForRemoteEvent(player, "OnPlayerLoadGame") RegisterForRemoteEvent(player, "OnCombatStateChanged") @@ -197,6 +243,7 @@ function StartMod() EndFunction
function StopMod() + player.SetValue(SpeedMult, origSpeedMult) CancelTimer(runStopTimerId) CancelTimer(weaponDrawCheckTimerId) UnregisterForControl("Sprint") @@ -224,7 +271,7 @@ bool function TemporaryDisable() If shouldBeDisabled ; We disable the mod for a while, so allow running and cancel the walk timer CancelTimer(runStopTimerId) - forceWalkLayer.EnableRunning(true) + EnableRunning(true) return true Else If iAutoWalkCheckType != 0 @@ -272,7 +319,7 @@ Event OnTimer(int timerId) If player != None If ShouldStartWalking() ; Player is not moving or is moving slowly so we force walk again - forceWalkLayer.EnableRunning(false) + EnableRunning(false) return ; Quit here to avoid retriggering the timer EndIf EndIf
Love using this mod, but was wondering if there could be a way that when disabling walking it uses AP, like the Running Drains AP mod, then when walking it doesn't drain any AP? If that could be a thing, I would love to see it! Otherwise, great mod! Endorsed!
Hello, I have the oddest bug I have run into with a mod. It isn't game breaking, the mod functions perfectly and I absolutely love it. The only thing that I guess could be considered an issue is that most of the time when I load the game, the mod inactivates on my modlist, and I have to reactivate it. I found a fix by making the Pluginlist thats stored in Appdata to read only. It really only become tedious when I want to add or update my modlist. Again, I found a way around but I wonder what could be causing it to inactivate.
Interesting concept but I use the mod Running Drains Action Points, in survival. When I use your mod now it also drain ap when I walk. I love difficulty but not at this level :D
Is there a compatible mod for walking just a tiny bit faster? I saw in the description speed adjustments is on the potential features list but atm the default walk speed is just killing me lmao, great mod though, thanks!
How exactly are you using the mod? It might be that it is required to keep the mod disabled or turned off in MCM settings until you are outside of the initial vault tutorials.
There was previously a case where another mod interfered with the ESL flagged ESP. It could be that I should just make it an ESP if ESL is broken by other mods easily - likely because of some thing that the mod does. Likely it is the 000801 quest entry added by the ESL. You can try play with these stopquest <ModIndex>000801 resetquest <ModIndex>000801 You can probably try to use console commands to try find the correct quest and disable/enable it.
I will try it and will update how it goes Edit: nope still doesnt work, i use the native option, and it is like the first press on shift is removed, only walking and sprinting is available, the entire running is removed
Hmm, that sounds quite odd. I cannot test at the moment, but I wonder if you somehow might have the normal run/walk mode of the game in use. So try set caps lock on/off as that should modify the default run/walk state. :thinking:
i tried it, i also tried anything i can think of but it just doesnt work smh, it was clearly fine in my previous playthrough and it became a necessity for me, now it feels odd to play without it, maybe can u make it ESP version? Edit: it finally worked, i had to throw it to the very last of the load order.
106 comments
It seems that running your mod, I can manually edit the player characters animation speed multiplier by using player.setav 2d2.
Personally, I am setting it to "player.setav 2d2 135" and that provides a nice brisk walking pace without mucking anything up.
Would it be possible for your scripts to run this command when the player toggles walking? Then set it back to vanilla values when the player untoggles walking? This would accomplish the speed multiplier you were hoping to implement.
Here is my rough implementation. (still testing)
I think the problem is when this mod progamaticaly forces walking mode, the game sets speed to 100 always.
goal:
mod enable -> control walk speed by this mod
mod disable -> control walk speed by other mod like "Increased Walking Speed"
diff --git "a/EffortlessMovementControlQuestScript.psc" "b/EffortlessMovementControlQuestScript.psc"
index 69db872..aa7999e 100644
--- "a/EffortlessMovementControlQuestScript.psc"
+++ "b/EffortlessMovementControlQuestScript.psc"
@@ -1,5 +1,5 @@
Scriptname Rochet2:EffortlessMovementControlQuestScript extends Quest
-
+ActorValue property SpeedMult auto
; Constants
int runStopTimerId = 50 Const
int weaponDrawCheckTimerId = 51 Const
@@ -16,6 +16,10 @@ float fRunStopTimerDelaySeconds = 0.01
float fRunStartTimerDelaySeconds = 1.0
float fWeaponDrawCheckTimerDelaySeconds = 1.0
+int iConfigWalkSpeedAdd = 0
+float fActiveWalkSpeedAdd = 0.0
+int origSpeedMult = 100 Const
+
; Local variables
InputEnableLayer forceWalkLayer = None
float playerPosXOld = 0.0
@@ -49,6 +53,7 @@ function LoadGameSettings()
SetRunStopTimerDelaySeconds(MCM.GetModSettingFloat("EffortlessMovementControl", "fRunStopTimerDelaySeconds:General"))
SetRunStartTimerDelaySeconds(MCM.GetModSettingFloat("EffortlessMovementControl", "fRunStartTimerDelaySeconds:General"))
SetWeaponDrawCheckTimerDelaySeconds(MCM.GetModSettingFloat("EffortlessMovementControl", "fWeaponDrawCheckTimerDelaySeconds:General"))
+ SetWalkSpeedAdd(MCM.GetModSettingInt("EffortlessMovementControl", "iWalkSpeedAdd:General"))
EndFunction
function SaveGameSettings()
@@ -66,6 +71,7 @@ function SaveGameSettings()
MCM.SetModSettingFloat("EffortlessMovementControl", "fRunStopTimerDelaySeconds:General", fRunStopTimerDelaySeconds)
MCM.SetModSettingFloat("EffortlessMovementControl", "fRunStartTimerDelaySeconds:General", fRunStartTimerDelaySeconds)
MCM.SetModSettingFloat("EffortlessMovementControl", "fWeaponDrawCheckTimerDelaySeconds:General", fWeaponDrawCheckTimerDelaySeconds)
+ MCM.SetModSettingFloat("EffortlessMovementControl", "iWalkSpeedAdd:General", iConfigWalkSpeedAdd)
MCM.RefreshMenu() ; Stored new settings, update in MCM menu
EndFunction
@@ -119,7 +125,16 @@ function SetWeaponDrawCheckTimerDelaySeconds(float delay)
StartTimer(fWeaponDrawCheckTimerDelaySeconds, weaponDrawCheckTimerId)
EndIf
EndFunction
-
+
+function SetWalkSpeedAdd(int add)
+ if add >= 0 && add <= 50
+ iConfigWalkSpeedAdd = add
+ else
+ ; mode upgrade may cause this
+ ;Debug.Notification("EMCQ::SetWalkSpeedAdd - value out of range: " + add)
+ endif
+EndFunction
+
Event OnMenuOpenCloseEvent(string menuName, bool opening)
If menuName == "WorkshopMenu"
workshopMenuOpen = opening
@@ -136,6 +151,34 @@ Event Actor.OnPlayerLoadGame(Actor akSender)
LoadGameSettings()
EndEvent
+float Function ModAV(ActorValue avItem, float fModVal = 0.0)
+ float curVal = player.GetValue(avItem)
+ if fModVal > 0.0
+ player.SetValue(avItem, curVal + fModVal)
+ else
+ player.SetValue(avItem, curVal + fModVal)
+ endif
+ return player.GetValue(avItem)
+EndFunction
+
+function EnableRunning(bool enable)
+ If !enable
+ forceWalkLayer.EnableRunning(false)
+ if !player.IsRunning() && !player.IsSprinting()
+ if fActiveWalkSpeedAdd == 0
+ fActiveWalkSpeedAdd = iConfigWalkSpeedAdd
+ endif
+ ModAV(SpeedMult, fActiveWalkSpeedAdd)
+ endif
+ Else
+ if fActiveWalkSpeedAdd != 0
+ ModAV(SpeedMult, -fActiveWalkSpeedAdd)
+ fActiveWalkSpeedAdd = 0
+ endif
+ forceWalkLayer.EnableRunning(true)
+ Endif
+EndFunction
+
Event OnControlDown(string control)
If control == "Sprint"
If forceWalkLayer != None
@@ -143,17 +186,17 @@ Event OnControlDown(string control)
If forceWalkLayer.IsRunningEnabled()
If player != None && !player.IsRunning() && !player.IsSprinting()
; We can run and try to toggle it off while standing
- forceWalkLayer.EnableRunning(false)
+ EnableRunning(false)
EndIf
Else
; We cannot run and try to toggle it on
- forceWalkLayer.EnableRunning(true)
+ EnableRunning(true)
EndIf
ElseIf !temporarilyDisabled
If TemporaryDisable()
return
EndIf
- forceWalkLayer.EnableRunning(true)
+ EnableRunning(true)
; We disallow running once the player no longer runs after pressing sprint.
; Originally used OnControlUp, but it was tiring to hold the button down on controller.
; Then used a timer that constantly checks the run state, but the ShouldStartWalking check is not always immediately true when you start running
@@ -176,13 +219,16 @@ function ToggleEffortlessMovementControl()
EndFunction
function StartMod()
+ ; original SpeedMult may be vary but this mod indirectly needs assumtion it is 100
+ ; forceWalkLayer.EnableRunning(false) always set SpeedMult to 100
+ player.SetValue(SpeedMult, origSpeedMult)
CancelTimer(runStopTimerId)
temporarilyDisabled = false
workshopMenuOpen = false
isInCombat = false
player = Game.GetPlayer()
forceWalkLayer = InputEnableLayer.Create()
- forceWalkLayer.EnableRunning(false)
+ EnableRunning(false)
UnregisterForAllRemoteEvents()
RegisterForRemoteEvent(player, "OnPlayerLoadGame")
RegisterForRemoteEvent(player, "OnCombatStateChanged")
@@ -197,6 +243,7 @@ function StartMod()
EndFunction
function StopMod()
+ player.SetValue(SpeedMult, origSpeedMult)
CancelTimer(runStopTimerId)
CancelTimer(weaponDrawCheckTimerId)
UnregisterForControl("Sprint")
@@ -224,7 +271,7 @@ bool function TemporaryDisable()
If shouldBeDisabled
; We disable the mod for a while, so allow running and cancel the walk timer
CancelTimer(runStopTimerId)
- forceWalkLayer.EnableRunning(true)
+ EnableRunning(true)
return true
Else
If iAutoWalkCheckType != 0
@@ -272,7 +319,7 @@ Event OnTimer(int timerId)
If player != None
If ShouldStartWalking()
; Player is not moving or is moving slowly so we force walk again
- forceWalkLayer.EnableRunning(false)
+ EnableRunning(false)
return ; Quit here to avoid retriggering the timer
EndIf
EndIf
Otherwise, great mod! Endorsed!
kudos
There was previously a case where another mod interfered with the ESL flagged ESP. It could be that I should just make it an ESP if ESL is broken by other mods easily - likely because of some thing that the mod does. Likely it is the 000801 quest entry added by the ESL. You can try play with these
stopquest <ModIndex>000801
resetquest <ModIndex>000801
You can probably try to use console commands to try find the correct quest and disable/enable it.
Edit: nope still doesnt work, i use the native option, and it is like the first press on shift is removed, only walking and sprinting is available, the entire running is removed
Edit: it finally worked, i had to throw it to the very last of the load order.