[RELz] AddActorValues v1.beta4

Post » Wed Mar 30, 2011 1:24 am

Name: AddActorValues
Version: v1.beta4
Date: 2010-09
Category: Gameplay Effects and Changes
Author: JRoush (jroush.tesmods@gmail.com)
Source: http://www.tesnexus.com/downloads/file.php?id=33248
Previous Version: http://www.gamesas.com/index.php?/topic/1106110-relz-addactorvalues

Requirements:
=============
NOTE: using AddActorValues with the wrong verison of Oblivion will, *at best*, cause it to crash.
- Oblivion v1.2.0416
- TESCS v1.2.404 (only if you are planning to make mods using AAV)
- OBSE v0019 beta3 or higher

NOTE: This is a *beta* version of this mod. Releasing mods that depend on this plugin is not recommended until a release version is uploaded.

Description:
============
AddActorValues allow modders to create and use *new* actor values, which are treated *exactly* like the built-in ones. New actor values won't do anything by themselves, of course, but they are very convenient ways for mods to attach information to any actor, which is then saved with the savegame. For details, see the included `Features' pdf.

Note that this is a *resource* - a mod is required to actually use the new features. Included is a demo mod, AddActorValues_Example.esp, which illustrates how to use the basic features.

New Actor Values can be used in:
- All Scripts, using the various Get/Set/Mod functions that end in 'C' or 'F'
- GetActorValue & GetBaseActorValue Conditions for Quests, Packages, etc.

New Actor Values cannot be used for:
- Magic Resistances or the target of a ModAV effect, *unless you install OBME*
- Class Major Attributes, Major Skills, or Training Skills
- Race Bonus Skills
- Book Skill Taught

Details:
-----------
Spoiler

Installation & Uninstallation:
===============
See the full readme.

Questions & Bug Reports:
========================
If you encounter a problem, something that is confusing or doesn't seem to work as expected, *please* do the following:

1. Read this readme, and the AV-related pages on the TESCS wiki carefully. Often 'bugs' are actually documented limitations of the game.
2. Reproduce the problem. If it's a crash, restart the game try to make it crash again.
3. Narrow down the cause. Try to figure out the circumstances that lead to the problem. Specific bug reports are easy to fix, while bug reports like "the game crashed after I installed this mod" are just a waste of my time.
4. Send me an email at jroush.tesmods@gmail.com. Include (1) the details, (2) the version of obse you are using, (3) a copy of your mod or savegame, and (4) the log files "AddActorValues.log" and "AddActorValues_CS.log", which can be found in your "Oblivion\" folder.

Compatibility with other mods:
==============================
AddActorValues is compatible with all conventional mods, and with all known obse plugins. If you encounter an incompatiblity, please report it right away.

History:
========
=== v1.beta4 2010/09 ===
- Split off AV uncapping functionality into a seperate project, `AVUncapper'
- Removed automatic recalculation of AV 'Max' modifiers on player after loading. It didn't work well in vanilla,
and is utterly broken by the ability to make arbitrary changes from scripts.
- Added an extra patch to prevent bad AVCollection initialization - fixes CTD issue when using Oblivion Stutter Remover
- Added a global AV Token table - tokens are now managed explicitly by AAV, rather than just being random inventory objects.
- The 'F' form of the new script functions will now only accept valid tokens.
- Added a new menu item and dialog box for editing av tokens in the CS
- Implemented function script callbacks for the 'Calculated Base' part of an av
- AVs with associated tokens may now be displayed in the 'Misc Stats' tab
- New AVs may now be used in the GetActorValue and GetBaseActorValue Conditions for Quests, Idle Anims, Packages, etc.

Credits
=======
- Bethesda Softworks, whose game has svcked up far, far too much of my free time
- The OBSE team for their incredible modding resource, without which this plugin would be a joke.

User avatar
IsAiah AkA figgy
 
Posts: 3398
Joined: Tue Oct 09, 2007 7:43 am

Post » Wed Mar 30, 2011 8:47 am

If anyone is curious, the 'uncapping' functionality that was introduced in beta3 has been split off into http://www.tesnexus.com/downloads/file.php?id=34841.

The other major changes are that AV 'tokens' are now explicitly managed - they have their own pseudo form type & their own dialog in the CS.
User avatar
Danii Brown
 
Posts: 3337
Joined: Tue Aug 22, 2006 7:13 am

Post » Wed Mar 30, 2011 11:50 am

This is looking better with each new beta. :) Question though, when you say Token Icons and that they are, eventually, to be displayed in the menu, where and how exactly? A seperate page, in the misc stats like they are now or somewhere else?
User avatar
Euan
 
Posts: 3376
Joined: Mon May 14, 2007 3:34 pm

Post » Tue Mar 29, 2011 11:37 pm

Question though, when you say Token Icons and that they are, eventually, to be displayed in the menu, where and how exactly? A seperate page, in the misc stats like they are now or somewhere else?

For tokens associated with built-in skills and attributes, it could override the default icons. It also seems likely that some mods will add their new AVs to the menus, and this way they have an icon handy.
User avatar
Mark Churchman
 
Posts: 3363
Joined: Sun Aug 05, 2007 5:58 am

Post » Wed Mar 30, 2011 2:52 am

I just realized that since the AVs can appear in the misc stats menu that you must have found how to insert an xml template. And indeed, after looking at the source it is nice and easy. I've been looking for that for a while now and although I found the place/function I needed (0x00585410), but I lacked the knowledge to put it to use. Now I can finally make a InsertXMLTemplate function for MenuQue! :D

P.S. I assume I may use your code with proper credits?
User avatar
Kit Marsden
 
Posts: 3467
Joined: Thu Jul 19, 2007 2:19 pm

Post » Wed Mar 30, 2011 10:38 am

P.S. I assume I may use your code with proper credits?

Knock yourself out. Credit is appreciated, but it sounds like you pretty much had it decoded anyway.
User avatar
Nicola
 
Posts: 3365
Joined: Wed Jul 19, 2006 7:57 am

Post » Wed Mar 30, 2011 3:39 am

Good call on splitting off the uncap feature. Now I just need to find that thread...

In re: over-100 scaling for Armorer, http://www.tesnexus.com/downloads/file.php?id=26288. (It also has effects under 100, though.)
User avatar
Amiee Kent
 
Posts: 3447
Joined: Thu Jun 15, 2006 2:25 pm

Post » Wed Mar 30, 2011 4:20 am

Good call on splitting off the uncap feature. Now I just need to find that thread...

In re: over-100 scaling for Armorer, http://www.tesnexus.com/downloads/file.php?id=26288. (It also has effects under 100, though.)

Thanks, that's a great solution.

There's no thread for the Uncapper mod yet; I'll start one with the next beta.
User avatar
Kahli St Dennis
 
Posts: 3517
Joined: Tue Jun 13, 2006 1:57 am

Post » Wed Mar 30, 2011 10:03 am

Quick sanity check to make sure I'm understanding this correctly... using the uncapper, the following settings:

fMagicCasterSkillCostBase	0.236068fMagicCasterSkillMult		1.381966favuMaxCasterSkillCostSkill	100.0favuMagicCasterSkillCostOffset	25.0

...should produce multipliers of approximately:
  • 1.618 at skill 0
  • 1.0 at skill 25
  • 0.618 at skill 50
  • 0.382 at skill 75
  • 0.236 at skill 100
  • 0.146 at skill 125

User avatar
Kitana Lucas
 
Posts: 3421
Joined: Sat Aug 12, 2006 1:24 pm

Post » Wed Mar 30, 2011 9:53 am

Quick sanity check to make sure I'm understanding this correctly... using the uncapper, the following settings:


Not quite. With the settings you specified, the multiplier value should be:
  • 1.618 at skill 0
  • 1.273 at skill 25
  • 0.726 at skill 50
  • 0.414 at skill 75
  • 0.236 at skill 100
  • 0.236 at skill 125


First, favuMaxCasterSkillCostSkill caps the skill, so in your case all skills above 100 will return a multiplier of 0.236. If you want the multiplier to continue to decrease for skill > 100, you should increase the cap or remove it entirely by setting it to 0.

Second, the value of the multiplier is the same as the vanilla formula at three points: skill = 0, skill = 100, and skill = favuMagicCasterSkillCostSkillOffset. Behind the scenes, the decay & growth rates and an overall multiplier "A" are computed to make this so (check the features pdf). I suspect you didn't notice the bit about A, since there's nothing like it in any of the other AVU formulas.
User avatar
Jessica Stokes
 
Posts: 3315
Joined: Fri Jul 28, 2006 11:01 am

Post » Wed Mar 30, 2011 1:12 am

First, favuMaxCasterSkillCostSkill caps the skill, so in your case all skills above 100 will return a multiplier of 0.236. If you want the multiplier to continue to decrease for skill > 100, you should increase the cap or remove it entirely by setting it to 0.

Ah! Okay, for some reason I thought that took the place of "100" in the formula (the divisor).

Second, the value of the multiplier is the same as the vanilla formula at three points: skill = 0, skill = 100, and skill = favuMagicCasterSkillCostSkillOffset.

Right... I skimmed the docs, obviously too quickly, mostly paying attention to the graph. I just set q at the desired 1.0 point. Let's try that again. I'm significantly more awake this time. :)

The progression I listed above is my desired outcome: a golden mean (phi) ratio between each mastery rank. Unfortunately upon further reading, not knowing the decay/growth/A determination formulae, I'm not certain... should I just be setting q to zero?
User avatar
Lucky Boy
 
Posts: 3378
Joined: Wed Jun 06, 2007 6:26 pm

Post » Wed Mar 30, 2011 6:26 am

The progression I listed above is my desired outcome: a golden mean (phi) ratio between each mastery rank.

My suggestion would be to set favuMagicCasterSkillCostSkillOffset = 0, and leave the other two settings (fMagicCasterSkillMult, fMagicCasterSkillBase) the same. This will give you the desired progression. It also has the (undocumented) effect of eliminating the logarithmic part of the curve - the multiplier will be a constant value of 1.618 for all skill values < 0. This is mathematically necessary, but I doubt it will cause you any real trouble.

If you're interested in the gory details, this particular mechanic is handled by DiminishedReturnFit() in Hooks_.cpp in the source directory. It's almost entirely comments and basic arithmetic, so no real knowledge of C++ is required.
User avatar
Laura Mclean
 
Posts: 3471
Joined: Mon Oct 30, 2006 12:15 pm

Post » Wed Mar 30, 2011 6:18 am

favuMagicCasterSkillCostSkillOffset = 0

Done, and results verified. Thanks!

If you're interested in the gory details, this particular mechanic is handled by DiminishedReturnFit() in Hooks_.cpp in the source directory.

:facepalm: Right. Source code. Totally forgot that was there.
User avatar
Milagros Osorio
 
Posts: 3426
Joined: Fri Aug 25, 2006 4:33 pm

Post » Wed Mar 30, 2011 6:31 am

Why can't I find a relz thread for either the uncapper OBSE plugin OR the add on created by JCN?

I dislike asking questions on Nexus as they are often ignored by most modders.
User avatar
Danielle Brown
 
Posts: 3380
Joined: Wed Sep 27, 2006 6:03 am

Post » Wed Mar 30, 2011 4:29 am

Since you didn't make a thread for the AV Uncapper I'll put this here.

I really love the dimished returns mechanic, but I think there's one issue with it. Even with a diminished returns curve, you'd still want to be able to set the resistances or weaknesses of actors to a specific (unmodified by DR) value. For example, the Fire Atronach has an ability that gives 100 pts fire resistance, but using the current DV formula that probably wouldn't give immunity (100% fire resist) as it should (regardless of the DR curve). Abilities only modify the base AV value though. So I propose to modify the DV formula so that the flat (unmodified by DR) base AV value is added to the DR-modified AV value. The base AV value must still be counted for the purposes of computing the DR itself though.

DiminishedValue(x, base) = base + max(0, 100 * DiminishedReturn(x / 100) - base)where x = the current AV value, same before,and base = the base AV value.


So, borrowing the example from your docs. There is an actor with an ability of Resist Fire 65 pts, and 65 pts normally gives 50% fire resist. But since the ability modifies the base AV, the total fire resist will be: 65 + max(0, 100 * DiminishedReturn(65 / 100) - 65) = 65 + max(0, 50 - 65) = 65 + 0 = 65%. Using the old formula he would get only 50% fire resist, which is not what you want in this case.

Now he casts a spell that also gives 65 pts Resist Fire, for a total of 130 pts, which should give 75% fire resist (same as before): 65 + max(0, 100 * DiminishedReturn(130 / 100) - 65) = 65 + (75 - 65) = 75%.

Of course this applies to all AVs, not just resistances and weaknesses.

Actually now that I think about it, I'm not sure if my formula is correct if the AV is negative (for weaknesses), but I've made my point. :P
User avatar
Steeeph
 
Posts: 3443
Joined: Wed Apr 04, 2007 8:28 am

Post » Wed Mar 30, 2011 5:57 am

Is there any chance you could add an option to AVUncapper to put the weapon formulas on a proper curve? Separate control of the skill and attribute portions would be optimal. I'm actually interested in accelerating returns on this one, not diminished... want it to work like your magicka cost calculation, except curving up instead of down.
User avatar
joeK
 
Posts: 3370
Joined: Tue Jul 10, 2007 10:22 am

Post » Wed Mar 30, 2011 8:17 am

Just wanted to thank you for creating this awesome resource. I'm using it as a base for my AI/persuasion overhaul and it looks like it will probably cut my development time in half and my scripting into a third. Kudos. :thumbsup:

Props to Tejon for pointing it out to me. :foodndrink:
User avatar
JAY
 
Posts: 3433
Joined: Fri Sep 14, 2007 6:17 am

Post » Wed Mar 30, 2011 12:33 am

Cool stuff, congrats to the release. :goodjob:
(a bit late, I know ;))

Didn't test much, but for me the example-plugin test-spell doesn't work as advertised:
I doesn't fortify the static(?) skill but when restoring, the skill becomes negative (-85 first time, 100 less before every time afterwards).
Not sure if this is a problem of AAV or OBME, though.


Oh, by the way: what actually is the script I can add to an AV for?
And what happens if I don't specify one?
User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Post » Tue Mar 29, 2011 8:50 pm

I'm getting a lot of CTDs from R6025 Pure virtual function calls from Oblivion.exe when I test the persuasion mechanic in Balzu. The persuasion scripts make heavy use of AAV functions and the only time I have ever gotten these crashes is during these testing sessions. It's possible it's some other OBSE function (I use a lot) or some other weird interaction with Oblivion but I've never had these crashes in scripts that don't use AAV so my suspicion is that AAV has something to do with it. I don't see anything unusual in the OBSE or AAV logs but I don't really know what I'm looking for, either. My C++ code-fu is too weak to penetrate your code, otherwise I would look into it myself.

If you need more details/logs/etc., I can pm them to you.
User avatar
Dan Wright
 
Posts: 3308
Joined: Mon Jul 16, 2007 8:40 am

Post » Wed Mar 30, 2011 2:51 am

I'm getting a lot of CTDs from R6025 Pure virtual function calls from Oblivion.exe when I test the persuasion mechanic in Balzu. The persuasion scripts make heavy use of AAV functions and the only time I have ever gotten these crashes is during these testing sessions. It's possible it's some other OBSE function (I use a lot) or some other weird interaction with Oblivion but I've never had these crashes in scripts that don't use AAV so my suspicion is that AAV has something to do with it. I don't see anything unusual in the OBSE or AAV logs but I don't really know what I'm looking for, either. My C++ code-fu is too weak to penetrate your code, otherwise I would look into it myself.

If you need more details/logs/etc., I can pm them to you.

Sounds like a problem. If you can send the me logs - and the savegame - that would be great. Also, if there is anything you can do to narrow down the exact action/script command that causes the crash that would help immensely.

EDIT: hrm, I didn't realize that Balzu is not yet available for download. It's a real bear for me to track down bugs like this if I can't reproduce them. In fact, it's usually impossible. Is there any way for me to get my hands on a working copy? Or at least at the scripts in question?
User avatar
Tiffany Holmes
 
Posts: 3351
Joined: Sun Sep 10, 2006 2:28 am

Post » Tue Mar 29, 2011 11:19 pm

I pm'd you the link.
User avatar
Marina Leigh
 
Posts: 3339
Joined: Wed Jun 21, 2006 7:59 pm

Post » Wed Mar 30, 2011 8:39 am

Thanks to JRoush the problem has been identified and resolved. It had absolutely nothing to do with AAV and was entirely a PEBKAC issue. Ever have one of those days where you can write completely rubbish code and think there is nothing wrong with it? :banghead:

Note to self: don't script late at night when you are sleep-deprived.
User avatar
TIhIsmc L Griot
 
Posts: 3405
Joined: Fri Aug 03, 2007 6:59 pm


Return to IV - Oblivion