Get and modify the enchantment effects on a specific item

Post » Wed Jun 20, 2012 4:21 am

How do you get the enchantment effects form an item and modify their magnitude?

I want to have a script that when a user equips a piece of jewellery it looks for the enchantments on it and adjusts the mangnitude based on the quality of the gem used to make it.

It seems the script is missing some really basic functions like GetEnchantments() on items and SetMagnitude() on spell effects.

Oh and i case you are going to reply with, HasMagicEffect() or HasMagicEffectWithKeyword() niether is an option because you need the formID or keyword to start with and they didn't think ahead in bethesda and actully add an enchantmentEffect keyword to the enchantments. they are all unique to the enchantment... basically defeating the purpose of using keywords... AND it also has no way of telling you what item the effect came from. technically the player casts it at himself when the item is equiped, but that happens BEFORE the OnEquip event is called.
User avatar
Kit Marsden
 
Posts: 3467
Joined: Thu Jul 19, 2007 2:19 pm

Post » Wed Jun 20, 2012 12:32 am

Not sure how to change the magnitudes, but for the gem quality, you can use the money value of the item as a base.
User avatar
Mrs shelly Sugarplum
 
Posts: 3440
Joined: Thu Jun 15, 2006 2:16 am

Post » Wed Jun 20, 2012 5:55 am

There is no way to modify the magnitude of any Magic Effect "dynamically" with Papyrus.
E.g. there is no function like this: itemRef.GetEnchantment (1).ModMagnitude (10).

The only way I found of doing something like this is with Perks.
you'll need a Perk for each modification.
This is feasable if you need to modify the Magnitude with large increments. E.g.: x5, x7.5, x10.
But it's not feasable if you need to modify the Magnitude with small increments. E.g.: Exhaustion every hour: x1, x2, x3, ... x24.
I used this method in one of my mods, but I found it too fiddly.

Also, another way to classify items when there have no appropriate Keyword that you need:
1. Create a FormList.
2. Drag items (or spells) you want into it.
3. Set the FormList to a Property in your Script.
4. To check if the item is part of the FormList, you use: HasForm ().

However, this is also fiddly. You can't "dynamically" (i.e. at run-time) add to that FormList.
You need to populate in the CK so that it is populated at compile-time.

I hope this gives you some ideas.
User avatar
Umpyre Records
 
Posts: 3436
Joined: Tue Nov 13, 2007 4:19 pm

Post » Tue Jun 19, 2012 5:48 pm

well you could copy all the existing effects and make more powerful versions of them, and swap them out...for example, have effects named

OriginalEffectName ; The vanilla version, goes on "average" items.
OriginalEffectName_LowQuality ; Goes on things like Ragged pants, etc
OriginalEffectName_HighQuality ; Goes on things like Dwarf/Elven
OriginalEffectName_ExquisiteQuality ; Goes on things like Orcish/Scale, etc
OriginalEffectName_SuperQuality ; Goes on things like Daedric/Glass/Dragon/, etc
User avatar
Alexx Peace
 
Posts: 3432
Joined: Thu Jul 20, 2006 5:55 pm

Post » Wed Jun 20, 2012 1:13 am

well you could copy all the existing effects and make more powerful versions of them, and swap them out...for example, have effects named

OriginalEffectName ; The vanilla version, goes on "average" items.
OriginalEffectName_LowQuality ; Goes on things like Ragged pants, etc
OriginalEffectName_HighQuality ; Goes on things like Dwarf/Elven
OriginalEffectName_ExquisiteQuality ; Goes on things like Orcish/Scale, etc
OriginalEffectName_SuperQuality ; Goes on things like Daedric/Glass/Dragon/, etc

Almost. Actually Effects have no magnitude.
It's the enchantment that needs to have a version for each quality/magnitude.
User avatar
Bambi
 
Posts: 3380
Joined: Tue Jan 30, 2007 1:20 pm

Post » Tue Jun 19, 2012 6:39 pm

mangnitude is really not most pressing concern, there are several different ways of working around that (like the alt version) of the enchantment. The main issue i would lke to solve is how to GET the enchantments from the objects. Thats the hardest part
User avatar
Carlitos Avila
 
Posts: 3438
Joined: Fri Sep 21, 2007 3:05 pm


Return to V - Skyrim