aareyn Posted July 4, 2016 Share Posted July 4, 2016 (edited) I am new to scripting i'll just say this but I am running into a bit of trouble and any help would be appreciated as its all really new too me and hard to grasp. Here is the code I need to add too. Event OnKeyDown(Int KeyCode) If KeyCode == 58 PlayerRef.ForceActorValue("SpeedMult", 90.0) ; When Caps is held speed changes to 90.0 EndIf EndEvent Event OnKeyUp(Int KeyCode, Float HoldTime) If KeyCode == 58 PlayerRef.ForceActorValue("SpeedMult", 200.0) ; When Key is let go it changes to stored value. EndIf EndEvent The issue is I need to add to the Event OnKeyup that when it begins I need it to -1 and +1 to my carry weight to workaround the animation issue when SpeedMult is changed. Also if someone would be kind enough to tell me how aliases work ^^ Edited July 4, 2016 by aareyn Link to comment Share on other sites More sharing options...
Elias555 Posted July 5, 2016 Share Posted July 5, 2016 Not sure if it's just this you're after or I have misunderstood. Event OnKeyDown(Int KeyCode) If KeyCode == 58 PlayerRef.ForceActorValue("SpeedMult", 90.0) ; When Caps is held speed changes to 90.0 Game.GetPlayer().DamageAV("CarryWeight", -0.001) EndIf EndEvent Event OnKeyUp(Int KeyCode, Float HoldTime) If KeyCode == 58 PlayerRef.ForceActorValue("SpeedMult", 200.0) ; When Key is let go it changes to stored value. Game.GetPlayer().DamageAV("CarryWeight", 0.001) EndIf EndEvent Link to comment Share on other sites More sharing options...
lofgren Posted July 5, 2016 Share Posted July 5, 2016 I don't think you can damage an actor value by a negative number. I believe you want ModAV instead. Link to comment Share on other sites More sharing options...
Elias555 Posted July 5, 2016 Share Posted July 5, 2016 I don't think you can damage an actor value by a negative number. I believe you want ModAV instead.Definitely can for CarryWeight. This is the script I'm using for a sprint and it works Scriptname AceSprintScript extends activemagiceffect Event OnEffectStart(Actor akTarget, Actor akCaster) Game.GetPlayer().DamageAV("Stamina", -50.0) Game.GetPlayer().DamageAV("CarryWeight", -0.001) EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) Game.GetPlayer().DamageAV("CarryWeight", 0.001) EndEvent Reversed the +/- just now and it still works. Link to comment Share on other sites More sharing options...
Fantafaust Posted July 5, 2016 Share Posted July 5, 2016 I believe what lofgren meant was, damageav converts negative values to positive and applies that as damage. So that negative's not adding carry weight, it's only subtracting. Link to comment Share on other sites More sharing options...
Elias555 Posted July 5, 2016 Share Posted July 5, 2016 I believe what lofgren meant was, damageav converts negative values to positive and applies that as damage. So that negative's not adding carry weight, it's only subtracting.Oh lol. Just tested it and that's correct.Updated: Event OnEffectStart(Actor akTarget, Actor akCaster) Game.GetPlayer().DamageAV("Stamina", -50.0) Game.GetPlayer().Modav("CarryWeight", 0.001) EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) Game.GetPlayer().Modav("CarryWeight", -0.001) EndEvent Thanks! Link to comment Share on other sites More sharing options...
Pananacakes Posted July 5, 2016 Share Posted July 5, 2016 What is modding the carryweight such a tiny bit for? Link to comment Share on other sites More sharing options...
lofgren Posted July 5, 2016 Share Posted July 5, 2016 Fixes a bug with SpeedMult Link to comment Share on other sites More sharing options...
Elias555 Posted July 5, 2016 Share Posted July 5, 2016 What is modding the carryweight such a tiny bit for?Allows the speedmult stat to update immediately. Link to comment Share on other sites More sharing options...
Recommended Posts