I'm trying to set up a simple script that uses the OBSE SetWeight function to decrease the weight of all the weapons and armor in the game. I'll probably start out by cutting it down to a third (multiply original weight by 0.3), but for right now I'm having trouble just getting a single one to work. I'm trying to test out using the function by changing the weight of Renault's Akaviri Katana in the tutorial dungeon.
I've set up a quest script to run and change the weight of the weapon, but I think I'm referencing the weapon incorrectly.
Here is my code:
scriptname NRWeightScript
float fQuestDelayTime
float nuWeight
begin GameMode
set fQuestDelayTime to 1
if ( player.IsInCombat == 0 )
message "Weights script executed."
set nuWeight to 2
CGAkaviriLongSwordRenault.SetWeight nuWeight
return
endif
end
The script does run (I get the "Weights script executed." output). But it doesn't actually change the weight. If I open up the console in the game, click on the sword, and type in "SetWeight 2" then it works fine. So OBSE seems to be loading properly. I'm just wondering if I need to be referencing the object some other way than using CGAkaviriLongSwordRenault? Is that the wrong approach?
Thanks. Eventually, I want to walk through all the weapons/armor in the game and decrease them, but....baby steps.
If you are wondering why I'm not editing these items directly, I'm trying to make a "More Realistic Weights" mod that is compatible with other mods which add weapons/armor to the game.