Changes to weapon attributes are not stored in savegames?

Post » Fri Apr 15, 2011 11:40 am

Hi everybody,

I am completely confused after spending hours anolyzing the following problem:

I am trying to change weapon attributes at runtime using the following OBSE commands

setAttackDamagesetObjectHealthsetWeaponReachsetWeaponSpeedsetObjectChargesetEquippedCurrentCharge


This seems to work fine, because I can immediately see all the changes applied to the weapon.
When I save after applying the changes and reload the savegame, the changes are still present. That's fine.

But... whenever I quit Oblivion completely, restart, and then reload the savegame, all changes are lost! The weapon always snaps back to the default values from its base form.

Does anybody know why that happens?


Here's what I tried to find the answer:

At first, I placed the weapon directly inside a cell in CS, i.e. I created a non-dynamic reference with a unique EditorID ("MyWeapon"). In my script, I then used to to change values, like that:
setAttackDamage 50 WeaponEditorID


Then I tried to do it dynamically by adding the weapon to the player ingame with code like
ref weaponRef
...
player.addItem MyWeaponFormID 1player.equipItem MyWeaponFormID weaponRef = player.GetEquippedObject 16setAttackDamage 50 weaponRef


At last, in order to see if there is some problem with my scripts, I tried to bypass them by directly selecting the weapon in the console and then using the simple console command:
setAttackDamage 50


But the effect is always the same, no matter which method I choose:
- All the changing of attributes works absolutely perfect!
- Reloading a savegame without quitting the game works perfect!
- However, quitting the game and then restarting/reloading does NOT work!

Please help... this nasty problem completely overthrows my mod, because without being able to save the changes, it's absolutely useless :(

Thanks for any hints!!!
User avatar
Josee Leach
 
Posts: 3371
Joined: Tue Dec 26, 2006 10:50 pm

Post » Fri Apr 15, 2011 1:52 am

Hi Jamie

Not really a solution what i thought of, but would get you by and definitely better then nothing, you could set a quest to run each time the game launches or when you reload the game the quest can run, and then have that to set all the weapon settings. "Start Game Enabled"

Hey did you check out those other mods that have a similar setup for enchantment? I say you have but do they react with the same behavior or not? And if they do this might be the only solution maybe
User avatar
Stephy Beck
 
Posts: 3492
Joined: Mon Apr 16, 2007 12:33 pm

Post » Fri Apr 15, 2011 11:42 am

At first, I placed the weapon directly inside a cell in CS, i.e. I created a non-dynamic reference with a unique EditorID ("MyWeapon"). In my script, I then used to to change values, like that:
setAttackDamage 50 WeaponEditorID ; setAttackDamage 50 MyWeapon youmean ?
Which script ? Quest or object ?

Then I tried to do it dynamically by adding the weapon to the player ingame with code like
ref weaponRef
...
Try:
set weaponRef to player.placeAtMe MyWeaponObjectID 1setAttackDamage 50 weaponRef
Objects in inventories do not have references. Add a
printc "WeaponRef : %i" weaponRef
in your code and let me know what it prints out
Ask in the OBSE thread - you will get an answer
GetGame Restarted is for these things
User avatar
jessica sonny
 
Posts: 3531
Joined: Thu Nov 02, 2006 6:27 pm

Post » Fri Apr 15, 2011 1:34 pm

Hi Jamie

Not really a solution what i thought of, but would get you by and definitely better then nothing, you could set a quest to run each time the game launches or when you reload the game the quest can run, and then have that to set all the weapon settings. "Start Game Enabled"

Hey did you check out those other mods that have a similar setup for enchantment? I say you have but do they react with the same behavior or not? And if they do this might be the only solution maybe

Hi Tigerpaws,

yes, I am currently implementing exactly that: re-applying all changes on game restart from within a quest script. As this solution is not very beautiful and means a lot of coding (with the risk of creating additional sources of errors), I didn't want to start with it as long as I wasn't sure that there might be other reason for the problem. But after I have received feedback confirming that this behaviour is probably a known flaw (or "feature" ;)) of the game engine (see http://www.thenexusforums.com/index.php?/topic/227832-changes-to-weapon-attributes-are-not-stored-in-savegames/page__pid__2013034#entry2013034), I can now at least be sure that the "repeat-it-on-every-game-restart" method is the only solution. So I'll just have to do it.

It's definitely also a good idea to check what other mods do, but I haven't found the time yet to go into details. In addition, the game engine probably behaves differently for different kinds of "objects": I've heard that enchantments may work, but weapons won't.

So I'll just stop :brokencomputer: -ing now and go back to work! I want to get that "Blade of the Haunted Customizer" published, finally! ;)
User avatar
Strawberry
 
Posts: 3446
Joined: Thu Jul 05, 2007 11:08 am

Post » Fri Apr 15, 2011 4:51 am

Snip
Do ask in the obse thread though - and let me know the answers to my prev post. If you decide to rewrite them all - use GetGameRestarted !
User avatar
darnell waddington
 
Posts: 3448
Joined: Wed Oct 17, 2007 10:43 pm


Return to IV - Oblivion