Jump to content

Changing Stats on 1 Weapon


Varicide

Recommended Posts

Hi. I'm trying to make a script that can change the stats/properties of one weapon. But instead, it changes all weapons of the class. Is there some way to only change one weapon at once? Thanks!

 

scn testscript

short button
ref rWeapon
float fDmg
begin OnEquip
set rWeapon to GetHotkeyItem 1
;set fDmg to GetCritDam rWeapon
set fDmg to GetCritDam rWeapon
showmessage f4modtestmsg fDmg
end
begin menumode
set button to getbuttonpressed
if(button == 0)
;SetWeaponIsAutomatic 1 rWeapon ; makes all weapons of that type automatic
rWeapon.SetWeaponIsAutomatic 1 ; does nothing!
endif
end
Link to comment
Share on other sites

GetHotkeyItem returns a base form, so you can't call SetWeaponIsAutomatic on it using reference syntax. You have to provide the base form as an argument.

 

However, even if your refvar did contain a reference, calling SetWeaponIsAutomatic on it would still set the value of the base item of the reference, changing all weapons of the same type.

Link to comment
Share on other sites

  • 2 weeks later...

Not really, no. There's a way to give player-specific bonuses by using hidden perks, but nothing that only applies to a single, physical weapon.

 

There's a way it might be possible to accomplish what you want with NVSE, but it's a method I've never tried before, so I can't vouch for it's effectiveness. NVSE has a function called TempCloneForm that clones a given object into a new base form. It's temporary though, the cloned form will only last for the duration of a game session. I'm also guessing that it doesn't take into consideration weapons that need to be placed into certain form lists for stuff like perk bonuses to apply. These hurdles can be overcome with careful scripting, but you're going to need to keep track of a lot of stuff. And like I said, I've never tried doing it, so it may not even work at all.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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