Jump to content

Need help for a simple script edit.


DanielShougun

Recommended Posts

I realized that I most likely posted my previous post in the wrong place, so I'm trying here instead.

 

 

I need help with a little scripting.

 

Problem: I use both Abo's Backwards Running Updated (http://oblivion.nexu....com/mods/10901) and Beni's Pretty Woman - animation replacer (http://oblivion.nexu...com/mods/32572/). The issue is that I like the backwards run animation and would still like to see it occasionally.

 

Idea for a solution: I'd like to edit the script in Abo's Backwards Running Updated so it only kicks in when a weapon out/unsheathed.

 

While I can read a script and understand the logic in it enough to edit it to my liking, I have no skills in adding lines or in the actual scripting language. This is where I need help. I think it has something to do with a "IsWeaponOut" function, but I don't understand how to implement it.

 

If there are concerns about permission, Abo wrote, "You are allowed to modify my files and release bug fixes or improve on features so long as you credit me as the original creator."

 

The following is the actual script from the mod:

 

-----------------------------------------------------------------------------------------------------------------------------------------------

 

Scriptname aaNoRunBackwards

 

; Running is toggled off by either disabling (runState == 1) or holding (runState == 2)

; the run key. When running has been toggeled off it takes one frame to take effect.

; After togging running off, debounce is set to give one frame for it to take effect.

; This can also be done less reliably by increasing fQuestDelayTime to longer

; than one frame.

 

short initScript

short runKey

short backKey

short runState

short debounce

float fQuestDelayTime

float backRunTime

float timePassed

 

Begin GameMode

 

; Initialise settings for v2

if (initScript != 2)

set fQuestDelayTime to 0.01

set runKey to GetControl 10 ; Run Key Code

set backKey to GetControl 1 ; Back Key Code

set initScript to 2

endif

 

set timePassed to GetSecondsPassed

 

if IsKeyPressed2 backKey

if (backRunTime < 0.33)

; accumulate backwards running time

set backRunTime to backRunTime + timePassed

elseif debounce

; last frame we toggled run, give it a frame to take effect.

set debounce to 0

elseif player.IsRunning

; backwards running time limit reached, force walk

if IsKeyPressed2 runKey

; running because run key pressed so disable it.

ReleaseKey runKey

DisableKey runKey

set runState to 1

else

; running because run key not pressed, so hold it.

EnableKey runKey

HoldKey runKey

set runState to 2

endif

; set debounce to allow next fame for toggle to take effect.

set debounce to 1

endif

else

; decrement backwards running time to zero

if (backRunTime > 0.0)

set backRunTime to (backRunTime > timePassed) * (backRunTime - timePassed)

endif

; toggle running back if it was toggled

if runState == 1

EnableKey runKey

set runState to 0

elseif runState == 2

ReleaseKey runKey

set runState to 0

endif

endif

 

End

----------------------------------------------------------------------------------------------------------------------------------------------

 

It ought to be fairly simple, but I just don't understand how to write scripts. A hint or a simple line to add in would help tremendously.

 

Thank you for your time

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...