[RELz] AddActorValues

Post » Fri Nov 12, 2010 9:12 pm

Name: AddActorValues
Version: v1.beta3
Date: 2010-08
Category: Gameplay Effects and Changes
Author: JRoush (jroush.tesmods@gmail.com)
Download: http://www.tesnexus.com/downloads/file.php?id=33248

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 beta2 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.
Another NOTE: This v1.beta3 has been released. This version includes a significant new feature. However, due mostly to laziness, I have opted not to create a new thread for the new release.

Description:
============
AddActorValues allows 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.

Earlier versions of AddActorValues had some functionality to change how builtin AVs are used - this has been split off into a separate plugin called http://www.tesnexus.com/downloads/file.php?id=34841.

-- Details --
----------------
Spoiler

How it Works:
=============
Please see the included Readme for details and instructions.

Included Demo Mods:
===================
Included is a demo mod, AddActorValues_Example.esp that contains a pair of simple scripted spells and a new actor value token. Read the script comments for details.

Installation & Uninstallation:
==============================
Again, please consult the Readme.

Feedback:
=========
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 the details, and attach the log files "AddActorValues.log" and "AddActorValues_CS.log", which can be found in your "Oblivion\" folder.

Compatibility with other mods:
==============================
At the moment, I know of no mods incompatible with AddActorValues.

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 invenoty 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
Flash
 
Posts: 3541
Joined: Fri Oct 13, 2006 3:24 pm

Post » Fri Nov 12, 2010 1:08 pm

This is awesome, but you already know that. Lots of fun.
User avatar
Annika Marziniak
 
Posts: 3416
Joined: Wed Apr 18, 2007 6:22 am

Post » Fri Nov 12, 2010 8:26 pm

Nooooooooooooooooooooooo, now X-Skills is obsolete. :(

[edit]
Oh wait, no it's not. Not yet atleast. Tell me, do you have any (short-term) plans on also expanding the amount of skills? If so then I might aswell stop working on X-Skills. If not then work on X-Skills will continue and you will have made a large portion a heck of a lot easier to code. I was just about to dig into expanding the AVs which would serve as a base for adding actual new skills. Although I was still at theoretical step 0. :P

Oh and good work ofcourse. ;)
[/edit]

-kyoma
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm

Post » Fri Nov 12, 2010 1:23 pm

...I totally forgot that skills were AVs. Well that's fun.

On the other hand, nothing of Jroush's is going to make those skills appear in the menu; X-Skills does that, right?
User avatar
Alisia Lisha
 
Posts: 3480
Joined: Tue Dec 05, 2006 8:52 pm

Post » Fri Nov 12, 2010 8:37 pm

do you have any (short-term) plans on also expanding the amount of skills?

You mean, adding code so that certain actions will increase an AV as you do them? No, that's not something I had in mind.

I've not familiar with X-Skills, but if it's script based this might indeed make your job a bit easier. If it's an obse plugin, I might have to try exposing these functions directly through the dll.
User avatar
Blaine
 
Posts: 3456
Joined: Wed May 16, 2007 4:24 pm

Post » Sat Nov 13, 2010 5:08 am

...I totally forgot that skills were AVs. Well that's fun.

On the other hand, nothing of Jroush's is going to make those skills appear in the menu; X-Skills does that, right?
Yea I kinda thought of that after I posted. I looked into adding new skills in a similar fashion as how OBME works but, to me, it appears as if the list of skills is hardcoded in too many places. :( Atleast, with my limited knowledge. There is still a possibility that adding actual new skills can be done, hence me wondering if that is planned for the future.

JRoush: Well X-Skills would use scripting and XML stuff to add new skills into the UI. Then using a centralized core system to handle setting all the appropriate values. Being able to define new actorValues for these 'xskills' would make intercommunication a whole lot easier. And basically means I can drop that portion of X-Skills. :)

[edit]To summarize, X-Skills is a mod that adds virtual, scripted skills to the UI with the use of hacky methodes/work-arounds. :P[/edit]

-kyoma
User avatar
Taylor Thompson
 
Posts: 3350
Joined: Fri Nov 16, 2007 5:19 am

Post » Fri Nov 12, 2010 5:39 pm

Well X-Skills would use scripting and XML stuff to add new skills into the UI.

Sounds like something I'll really enjoy. It looks like the tesnexus page is hidden, though - do you have an eta for a beta release?
User avatar
NAtIVe GOddess
 
Posts: 3348
Joined: Tue Aug 15, 2006 6:46 am

Post » Fri Nov 12, 2010 11:05 pm

Sounds like something I'll really enjoy. It looks like the tesnexus page is hidden, though - do you have an eta for a beta release?
Now that my new PC is about ready to rumble I hope two weeks at most. :) But just to be sure, you aren't planning on making a Skill-Extended plugin too, right? Not that it would be a bad thing, just bad for me. :P
User avatar
Skivs
 
Posts: 3550
Joined: Sat Dec 01, 2007 10:06 pm

Post » Sat Nov 13, 2010 12:04 am

you aren't planning on making a Skill-Extended plugin too, right?

No, I'm not. This plugin was just a by-product of my work on OBME; a few functions to expose the C++ code that I'd written some time ago.
User avatar
Anne marie
 
Posts: 3454
Joined: Tue Jul 11, 2006 1:05 pm

Post » Sat Nov 13, 2010 12:14 am

Have you talked with the OBSE team about including this (or a variant) in the main release? The reason I ask is, I'd prefer to use your commands for modifying the original AVs. They take floats!
User avatar
Lisha Boo
 
Posts: 3378
Joined: Fri Aug 18, 2006 2:56 pm

Post » Fri Nov 12, 2010 6:53 pm

Have you talked with the OBSE team about including this (or a variant) in the main release? The reason I ask is, I'd prefer to use your commands for modifying the original AVs. They take floats!

You can use my commands to modify the original AVs.

I suppose it would be nice to have the extended control over AV's without dependence on a plugin though, so I'll ask.

However first - I've found a rather serious bug (an oversight actually) that I need to fix. For the time being, I've hidden the DL page. It will come back with a second bets, hopefully by tomorrow.
User avatar
Victoria Vasileva
 
Posts: 3340
Joined: Sat Jul 29, 2006 5:42 pm

Post » Sat Nov 13, 2010 4:28 am

You can use my commands to modify the original AVs.

Yes, but...

I suppose it would be nice to have the extended control over AV's without dependence on a plugin though, so I'll ask.

Yes. :)

Seriously, I've been bugging them for a floating point ModAV for years. This is that, plus more. It's specifically because all of this works on normal AVs, that I think it's a good candidate for inclusion with the OBSE core.
User avatar
Sasha Brown
 
Posts: 3426
Joined: Sat Jan 20, 2007 4:46 pm

Post » Sat Nov 13, 2010 7:26 am

Is it possible to assign an AVcode to an AAV (added-actor-value) through script? If not, would that be possible (and desireble)? Also, I noticed the new functions cannot be used with the default actorValues, is this intentionally? And more importantly, can this be changed?
User avatar
emily grieve
 
Posts: 3408
Joined: Thu Jun 22, 2006 11:55 pm

Post » Sat Nov 13, 2010 7:31 am

Say... do (or could) these commands function from the console? Which is to say, in a batch script?

Edit: I suppose my original thought here might not hold up if there's a load-order ID encoded in the new AV numbers. Still might be useful, dunno...
User avatar
k a t e
 
Posts: 3378
Joined: Fri Jan 19, 2007 9:00 am

Post » Sat Nov 13, 2010 12:01 am

Is it possible to assign an AVcode to an AAV (added-actor-value) through script? If not, would that be possible (and desireble)? Also, I noticed the new functions cannot be used with the default actorValues, is this intentionally? And more importantly, can this be changed?

The new functions can be used on the default actor values. At least, the versions that end if 'C' can; they can be used on *any* actor value.
I'm not sure I follow you on changing the avCode - an actor value is literally nothing but an avCode, it would be like changing a formID elsewhere. Can you perhaps explain what you had in mind?

do these commands function from the console?

They do function from the console. I haven't tried a batch script, but it seems likely.
User avatar
Julia Schwalbe
 
Posts: 3557
Joined: Wed Apr 11, 2007 3:02 pm

Post » Sat Nov 13, 2010 5:15 am

OK, a fixed v1.beta2 has been uploaded. The problem was that Oblivion does not automatically resolve the avCodes (that seemed a little too ridiculous to be true anyway), but rather truncated the codes above 256. Add in some errors in my testing code, and I got a lot of false positives.

The new version works the same way up front. Behind the scenes, it moves all modifiers for 'new' (not built-in) AVs into the obse cosave.
User avatar
Brandon Wilson
 
Posts: 3487
Joined: Sat Oct 13, 2007 1:31 am

Post » Sat Nov 13, 2010 1:50 am

Thanks for the quick update :thumbsup:
User avatar
ILy- Forver
 
Posts: 3459
Joined: Sun Feb 04, 2007 3:18 am

Post » Fri Nov 12, 2010 5:28 pm

Looks interesting. Not sure if I'll make use of this, but there's quite a chance. :)
User avatar
Hilm Music
 
Posts: 3357
Joined: Wed Jun 06, 2007 9:36 pm

Post » Sat Nov 13, 2010 8:45 am

If you want to donate the basic AV commands (Get/Set/ModAVPartC) I'll integrate them.


News: The Oblivion Script Extender team has agreed to incorporate the basic AV commands into obse itself.
User avatar
casey macmillan
 
Posts: 3474
Joined: Fri Feb 09, 2007 7:37 pm

Post » Sat Nov 13, 2010 1:20 am

Awesome. :)
User avatar
Christine
 
Posts: 3442
Joined: Thu Dec 14, 2006 12:52 am

Post » Fri Nov 12, 2010 11:56 pm

Version v1.beta3 has been released.
User avatar
Caroline flitcroft
 
Posts: 3412
Joined: Sat Nov 25, 2006 7:05 am

Post » Sat Nov 13, 2010 8:05 am

From the readme regarding Diminished Percentage:
  diminished percentage = Exp( - decayrate * baseAV )                                 , if baseAV > 0                        = 1 + decayrate * growthrate * Log( 1 - baseAV / growthrate)  , if baseAV < 0

Either I'm reading this wrong or there's a typo somewhere. (Strong possibility of the former. I spent a little while trying to do the calculation with natural logarithms before I realized that's probably not what you meant. I wish it were natural logarithms. Base 10 can go to hell!) Anyway. For starters, am I correct in assuming that baseAV here is converted from percentage to decimal, i.e. divided by 100? So with your default values, "100% resistance" actually produces about 98.6% reduction? (With natural logarithms that would be more like 84%, which balances nicely against the default armor limit. DOWN WITH DECIMAL!!! UP WITH EULER!!!) *cough* Meanwhile the resistance formula Just Doesn't Work; 1 - baseAV / growthrate is negative for all values of baseAV > growthrate, and Log(any negative number) is invalid regardless of whether you're using that icky traditional radix or the One True Base. Unless we get imaginary weaknesses, of course.

TL;DR: please explain the formula, and I've got a potentially unhealthy fetish with e.
User avatar
Austin Suggs
 
Posts: 3358
Joined: Sun Oct 07, 2007 5:35 pm

Post » Sat Nov 13, 2010 4:28 am

TL;DR: please explain the formula, and I've got a potentially unhealthy fetish with e.

The formula does use natural log. I'm a physicist, and am used to using log and ln interchangeably (and avoiding base-10 logs altogether).
Also, yes, the baseAV is implicitly divided by 100 to convert it from a percentage into a fraction before plugging into the formula. You can scale the baseAV by any constant and simply use a different pair of setting values to get identical results. Since the exact values of these settings aren't really part of the plugin, I omitted factors of 100 for simplicity.
Finally, note the piece-wise nature of the function - the logarithmic part is only used for baseAV < 0, in which case 1 - baseAV / growthrate is always greater than one, so that the log term is strictly positive (and real).

However, I did make one important typo in the formula: the 'diminished percentage' is actually one minus what's given in the readme. Throwing in that, and explicitly showing the factors of 100:
  Diminished Percentage =   100 * (1 - Exp ( - decayrate * baseAV/100 ))                           for baseAV > 0                        = - 100 * decayrate * growthrate * Log( 1 - baseAV / (100 * growthrate))   for baseAV < 0

For reference, here is a table converting baseAV values into 'Diminished' values using the suggested settings:
baseAV   Dim. Perc.------   -----------200     -125.29-175     -117.82-150     -109.41-125      -99.79-100      -88.54 -75      -75.00 -50      -57.99 -25      -35.11   0        0.00  25       37.00  50       60.32  75       75.00 100       84.25 125       90.08 150       93.75 175       96.06 200       97.52

I've also uploaded a plot image to the TESNexus page that shows the DP curve vs. vanilla behavior. Note that lower av values (< 75) actually give a somewhat stronger effect than before - 5 points of Shield, for example, would actually block 10% of physical damage.
User avatar
Rob Smith
 
Posts: 3424
Joined: Wed Oct 03, 2007 5:30 pm

Post » Sat Nov 13, 2010 9:28 am

The formula does use natural log. I'm a physicist, and am used to using log and ln interchangeably (and avoiding base-10 logs altogether).

:celebration:

Finally, note the piece-wise nature of the function - the logarithmic part is only used for baseAV < 0, in which case 1 - baseAV / growthrate is always greater than one, so that the log term is strictly positive (and real).

:facepalm: Right. I was thinking of it as the formula for weakness, a positive number.

However, I did make one important typo in the formula: the 'diminished percentage' is actually one minus what's given in the readme.

Oddly enough, I did this conversion without even thinking to make note of it.

For reference, here is a table converting baseAV values into 'Diminished' values using the suggested settings:

This should probably be in the final readme!

Note that lower av values (< 75) actually give a somewhat stronger effect than before - 5 points of Shield, for example, would actually block 10% of physical damage.

A good thing! nGCD functions entirely on very similar curves. And now to implement my other fetish-constant by making decayrate = phi and growthrate = 1/phi. :D (Edit: Not terrible numbers, actually. Weakness doesn't need to be nerfed so hard with linear stacking.)

Aside: do values >100 work for the armor cap GMST?
User avatar
El Khatiri
 
Posts: 3568
Joined: Sat Sep 01, 2007 2:43 am

Post » Sat Nov 13, 2010 1:29 am

Aside: do values >100 work for the armor cap GMST?

Not sure, but you can use a value of zero to disable the cap entirely.
User avatar
Chris BEvan
 
Posts: 3359
Joined: Mon Jul 02, 2007 4:40 pm

Next

Return to IV - Oblivion