Jump to content

Help with hotkey scripting


Recommended Posts

I've been trying to take the toggle sides script from this mod, http://www.nexusmods.com/newvegas/mods/38482/?, and change the default keybind, c, to that of my liking.

 

This is the default script:

 

 

scn ROTSToggleSidesScript

; ------------------------------------------------------------------------------------------------------------------------------------------------------
; Adds a hotkey to change sides.
; Written by "woodbyte" for "Really OTS".
; ------------------------------------------------------------------------------------------------------------------------------------------------------

int iVersion

int invert_key_pressed

begin GameMode
if ReallyOTS.iVersion >= 5 ; only run if base plugin is initialized and the right version

if iVersion != 1
set iVersion to 1
endif

; toggle invert when 'c' key is pressed
; ------------------------------------------------------------------------------------------------------------------------------------------------------
if IsKeyPressed 46
if invert_key_pressed == 0
if ReallyOTS.bInverted
set ReallyOTS.bInverted to 0
else
set ReallyOTS.bInverted to 1
endif
set invert_key_pressed to 1
endif
else
set invert_key_pressed to 0
endif

endif

 

 

 

And this is what I tried changing it to, but nothing seemed to actually change:

 

 

scn ROTSToggleSidesScript

; ------------------------------------------------------------------------------------------------------------------------------------------------------
; Adds a hotkey to change sides.
; Written by "woodbyte" for "Really OTS".
; ------------------------------------------------------------------------------------------------------------------------------------------------------

int iVersion

int invert_key_pressed

begin GameMode
if ReallyOTS.iVersion >= 5 ; only run if base plugin is initialized and the right version

if iVersion != 1
set iVersion to 1
endif

; toggle invert when 'mouse5' key is pressed
; ------------------------------------------------------------------------------------------------------------------------------------------------------
if IsKeyPressed 46
if invert_key_pressed == 0
if ReallyOTS.bInverted
set ReallyOTS.bInverted to 0
else
set ReallyOTS.bInverted to 1
endif
set invert_key_pressed to 1
endif
else
set invert_key_pressed to 0
endif

endif

 

 

Bear in mind I am fairly atrocious at scripting so layman's terms where applicable would be appreciated. xD

Link to comment
Share on other sites

  • Recently Browsing   0 members

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