Jump to content

Script to reduce weapon degradation


Gordyne

Recommended Posts

How can I make this script work to reduce weapon degradation when using SMG?

I hooked it up on a quest and made a perk set the quest stage, and tested it with a 9mm SMG, but it still degrades.

 

scn ReduceWeaponDegradation

 

ref ObjRef

 

Begin GameMode

 

set ObjRef to Player.GetEquippedObject 5 // 5 is the weapon

if ObjRef.IsInList SMG // I made a new form list and added all smgs to it    con_SetGameSetting fDamageToWeaponValue 0else    con_SetGameSetting fDamageToWeaponValue 0.4Endif

End

 

The values 0 and 0.4 are unbalanced but it's just to see if it's working.

Edited by Gordyne
Link to comment
Share on other sites

I did a bit more testing and added ShowMessage Success(custom message):

 

scn ReduceWeaponDegradation

 

ref ObjRef

 

Begin GameMode

 

ShowMessage Success

 

set ObjRef to Player.GetEquippedObject 5 // 5 is the weapon

if ObjRef.IsInList SMG // I made a new form list and added all smgs to it    con_SetGameSetting fDamageToWeaponValue 0else    con_SetGameSetting fDamageToWeaponValue 0.4Endif

End

 

When I take the perk I get the message but only once, which means the script only runs once?

 

EDIT: Managed to get it working. I was using a FOSE function(GetEquippedObject) that isn't available for NVSE.

There is no need to set a ref, just change the condition to:

if Player.GetEquipped.IsInList SMG == 1

Edited by Gordyne
Link to comment
Share on other sites

  • Recently Browsing   0 members

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