[RELz] Oblivion Magic Extender v1.beta3

Post » Sun May 29, 2011 12:05 am

Name: Oblivion Magic Extender
Version: v1.beta3
Date: 2010-07
Category: Magic - Gameplay
Author: JRoush
Source: http://www.tesnexus.com/downloads/file.php?id=31981
Previous Version Thread: http://www.gamesas.com/index.php?/topic/1103676-relz-oblivion-magic-extender-v1beta2/
Contact: jroush.tesmods@gmail.com

Requirements:
=============
NOTE: using OBME with the wrong verison of Oblivion or the CS will, *at best*, cause it to crash.
  • Oblivion v1.2.0416
  • TESCS v1.2.404 (only if you are planning to make mods using OBME)
  • OBSE v0018 or higher
  • AddActorValues, a small auxiliary plugin that is bundled with OBME


Description:
============
OBME extends the Oblivion magic system to make it more general and open to mod makers. In a nutshell, it is a pair of plugin libraries for OBSE that hack the game/CS code to change it's behavior. Note that this is the same principle behind OBSE itself - it's quite safe, and will not alter Oblivion.exe or TESConstructionSet.exe in any way. In this version, the key features are:

  • More control in editing Magic Effects in the CS, and the ability to create new magic effects, both in the CS and in-game from scripts
  • Support for 'dynamic' effect codes that are (almost) automatically managed by OBME.
  • Expanded ModifyActorValue handler to allow custom AV ranges, and to specify exactly what part/modifier is affected.
  • Expanded SummonActor effect handler to allow custom summoning limits
  • Expanded ScriptEffect handler to allow useable magnitudes, and scripts specified for an entire EffectSetting rather than each individual effect item.
  • Expanded Dispel effect handler to allow partial dispelling of effects, and to selectively target effects based on their effect code, effect handler, hostility, and the type of magic item that applied them.
  • "Reclaiming" of some of the lost magicka when an effect is removed by recasting its spell, or when a summoning limit is broken.
  • Expansion of 'extra' data for EffectItems - *any* effect item (not just script effects) may now have a custom name, school, VFXcode, hostility, *icon*, base cost, resistance AV, and a number of other flags.

For more info, please see the accompanying document 'OBME Features.pdf'. This file has background information and technical details. For examples of how to actually use OBME, see the accompanying "OBME_*_example" mods.

IMPORTANT NOTES:
======================
  • OBME has been assigned an official opcode base for its new script functions. Any scripts using 'CreateMgef' and 'ResolveMgefCode' from v1.beta2 will *need to be recompiled* in order to work correctly. This should be the last time this is necessary when upgrading.
  • The formats for the ScriptEffect and ModActorValue handlers have changed slightly. Please double check any mods that add or alter effects with these handlers to make sure they are up tp date.
  • The following v0018 OBSE script functions will not work with dynamic effect codes: GetMagicEffectCounters, GetNthEffectItemScriptVisualEffect, and GetActiveEffectCodes. This will change with the release of obse v0019.
  • OBME v1.beta3 does not include script functions for manipulating the Effect item override fields for School, VFXCode, and the individual flag fields like "Effects removed". These functions will be added in a future release.
  • Because this is a beta version, I have left the debugging output on. This means that long sessions in the game or CS will generate rather large log files.


Additional Details:
=============
Spoiler
:
Questions & Bug Reports:
========================
If you have a question, *look in the included 'Features' pdf*. It has a table of contents; you don't have to read the whole thing to find what you're looking for. If your question isn't answered there, I would be more than glad to answer it on the forum thread.
If you encounter problem, something that is confusing or doesn't seem to work as expected, *please* *please* *please* do the following:

1. Read the readme carefully. Often I've addressed the problem already, or at least included a warning.
2. Reproduce the problem. If it's a crash, restart the game or CS and 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 OBME" are just a waste of my time.
4. Send me a private message on TESNexus or the Forum. Include the details, and attach the log files "OBME.log" and "OBME_CS.log", which can be found in your "Oblivion\" folder.

Installation & Uninstallation:
====================
Please see the included 'Readme' file.

Compatibility with other mods:
==============================
OBME doesn't add any actual content to the game, so there is no chance of conflicts with any traditional mods. In addition, OBME-enabled mods are designed to be useable by everyone, even players without OBME (although they will obviously be unable to use any added magic effects). Because this is a beta-version, however, it is STRONGLY RECOMMENDED that you not distribute mods based on OBME until further notice.
OBME is known to be incompatible with Custom Spell Icons (CSI), because both attempt to patch the same game code. Using both OBME and CSI will result in CTD.

Compatibility with other Editing programs (TES4Edit, WryeBash, etc):
====================================================================
OBME alters the format of the *.esp and *.esm files by adding new chunk types to the EffectSetting record (MGEF) and various magic item records (SPEL,ENCH,INGR,ALCH,SGST). At the moment, this means that mod files *with new OBME features* are not compatible with TES4Edit. It can load files that don't contain new magic effects or effect item override fields just fine. No other 3rd party mod editors have been tested - if you're curious, please try it yourself and let me know.

=== v1.beta3 2010/07 ===
- Implemented assigned opcode base for new script functions: 0x2600
- Identified the uses of two of the 'misc' magic effect flags: 'Persist On Death', and 'Explodes with Force'
- Expanded size and functionality of effect item 'overrides' object. EfixParam and EfitParam are no longer forced to same value.
- Replaced 'Effect Item' dialog in the CS with an improved version.
- Altered format of the ScriptEffect handler - eliminated 'UseEfitScipt' flag & made EfitParam a 'user parameter' that is generally ignored by OBME. If non-zero, efixParam is used as script formID; otherwise mgefParamA is used.
- Implemented EffectItem overrides to hostility, effect name, school, base cost, icon, vfx code, resistance AV, persist-on-death, and handler-specific params (including the 'recovers' flags for some handlers).
- Altered save format for magic items: additional override parameters for EffectItems now saved in EFII and EFIX chunks
- OBME is now compatible with AddActorValues. ResistanceAVs and the avs modified by the ModActorValue handler may now be mod-added token items.
- Altered format of ModifyActorValue effect handler. The param fields are now a range of actor values. An additional field determines which part (base/max/offset/damage) of the actor value to modify. An additional flag reproduces the special treatement for Ability effects.
- Altered save format for ActiveEffects to store more specific conversion info. The (remote) possibility that new magic effects could corrupt save files should now be gone completely.
- Added script functions GetMagicEffectHandler,SetMagicEffectHandler to manipulate handlers on magic effects
- Added script functions GetMagicEffectHostility,SetMagicEffectHostility to manipulate new 3-state hostility of magic effects
- Added new script functions to manipulate 'override' fields of effect items: (Get/Set/Clear)NthEIEffectName,(Get/Set/Clear)NthEIIconPath, (Get/Set/Clear)NthEIHostility,(Get/Set/Clear)NthEIBaseCost,(Get/Set/Clear)NthEIResistAV. Not yet added: similar functions for VFXCode,School,Handler-specifc params like script/AV, and individual flags.
- Where appropriate, vanilla magic effects may now have the 'Beneficial' hostility state

Credits
=======
- Bethesda Softworks, whose game has svcked up far, far too much of my free time
- The OBSE team for their incredible modding resource.
- scruggsywuggsy the ferret, for answering even my dumbest questions promptly and with admirable patience.
- everyone on the TESNexus and Bethesda forums who took an active interest in the first beta - your enthusiasm make the project much easier to handle.
- statttis, for doing the extensive legwork necessary to implement effectitem icon overrides. All I had to do was copy+paste from his source.

Tools Used
==========
- Oblivion Script Extender (OBSE): http://obse.silverlock.org
- TES4Edit: http://www.tesnexus.com/downloads/file.php?id=11536
- TES Construction Set: http://www.tesnexus.com/downloads/file.php?id=11367
- Microsoft Visual Studio 2008: find a download yourself ;)
- IDA Pro v4.9: http://www.datarescue.com/idabase/ida.htm

User avatar
Rob Davidson
 
Posts: 3422
Joined: Thu Aug 02, 2007 2:52 am

Post » Sun May 29, 2011 1:58 am

Due to the increased size requirements for custom Actor Values, I was unable to implement a 'limit' option on the ModifyActorValue handler to prevent certain effects from lowering the AV below a threshold. Apologies to tejon, Varyn, and anyone else who was hoping to see this. A 'limited' version of ModifyActorValue can be added, but it will have to wait until after a stable v1.0 is released.
User avatar
WTW
 
Posts: 3313
Joined: Wed May 30, 2007 7:48 pm

Post » Sun May 29, 2011 3:10 am

ehem....how can i load CS with obse loader exe (i never used it)?
User avatar
Alina loves Alexandra
 
Posts: 3456
Joined: Mon Jan 01, 2007 7:55 pm

Post » Sun May 29, 2011 1:04 am

ehem....how can i load CS with obse loader exe (i never used it)?

From the obse readme:
Open a command prompt window, navigate to your oblivion install folder, and type "obse_loader -editor"

It's probably easier to make a shortcut to obse_loader.exe, and then add " -editor" to the end of the shortcut target.
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am

Post » Sat May 28, 2011 11:55 am

Dammit man! You're ripping the fabric of space-time even more with each release - Do be careful!

Keep up the bad work though...
User avatar
kyle pinchen
 
Posts: 3475
Joined: Thu May 17, 2007 9:01 pm

Post » Sat May 28, 2011 11:40 pm

- Identified the uses of two of the 'misc' magic effect flags: 'Persist On Death', and 'Explodes with Force'

:o :celebration:

- OBME is now compatible with AddActorValues. ResistanceAVs and the avs modified by the ModActorValue handler may now be mod-added token items.
- Altered format of ModifyActorValue effect handler. The param fields are now a range of actor values. An additional field determines which part (base/max/offset/damage) of the actor value to modify. An additional flag reproduces the special treatement for Ability effects.

...okay, I'll forgive you having no room for the "minimum one" checkbox this time around. ;) That one has a script fix with no major problems, anyway.

The "Reclaiming Effects" feature appears to be universal based on fMagicReclaimFactor; is there a possibility of per-effect exemption?

How does e.g. a name override interact with the spellmaker? If I create a spell which uses a modified FIDG and call the effect "Inferno," and give it to the player, does the player gain unmodified Fire Damage for use at the altar? ...or Inferno? With some of the other available overrides I could see very odd behavior arising if this isn't directly handled.

Does the new ModifyActorValue handler do anything about the Feather issue described in the previous thread?

We were discussing "stealthy" spells; could these be assigned the 3 value in the Hostile/Neutral/Beneficial set? They would function as Neutral in general, except that they would create poisons and be targeted by dispels as if Hostile. I'm imagining that if you do it that way (call them neutral but add special case code under alchemy and dispel) you wouldn't have to muck about in the AI to get the desired NPC reaction (i.e. none)... of course that could be just my imagination. ;)

Would it be possible to add a feature which causes copies of the same effect (not just the same magic item) to stack by cost on the target? E.g., let's say I make spells On Fire 1 and On Fire 2, both of which are magnitude 3 for 10 seconds. These spells have a base cost of 31. If I cast them both on a target, I basically get magnitude 6 for 10 seconds at a cost of 62 Magicka, when that effect as a spell by itself should cost 74. Cost-based stacking would instead yield a magnitude of ~5.21 for the overlap period. (Don't know if you can do fractional magnitudes internally... seems like you should be able to, since resists can be fractional.)
User avatar
Céline Rémy
 
Posts: 3443
Joined: Sat Apr 07, 2007 12:45 am

Post » Sat May 28, 2011 8:56 pm

The "Reclaiming Effects" feature appears to be universal based on fMagicReclaimFactor; is there a possibility of per-effect exemption?
It's not something I had thought of. For my own curiosity, can you give an example effect that shouldn't be reclaimed?

How does e.g. a name override interact with the spellmaker?
Here's the breakdown: For alchemy and sigil stone enchanting, effect items are copied to the final result, and their magnitude/duration/etc is then set. So overrides on ingredient, potion, & sigil stone effects will carry over. For spellmaking and enchanting, the underlying effect setting is used. So yes, give the player a custom 'Fire Damage' spell with a weird name, and they'll still have access to regular Fire Damage. A flag that prevents an effect item from 'teaching' the player that effect is planned for a future version.

Does the new ModifyActorValue handler do anything about the Feather issue described in the previous thread?
Turns out Feather was never broken. It was the ModAV handler that was causing the problem, and when I overwrote it the problem was solved. For the record, Feather really does effectively add to your maximum encumbrance.

We were discussing "stealthy" spells; They would function as Neutral in general, except that they would create poisons and be targeted by dispels as if Hostile.
I was actually thinking of something tied to the sneak/detection mechanics - a chance that nearby actors wouldn't notice a spell being cast at them. Can you explain what you mean by 'function as Neutral in general'?

Would it be possible to add a feature which causes copies of the same effect to stack by cost on the target?
Short answer - no. Long answer - yes, but it would raise all kinds of hell.
Consider what happens when 'On Fire 1' is removed. Does 'On Fire 2' keep it's current (reduced magnitude), or does it grow to it's intended magnitude? Basically, this scheme violates the principle that each active effect is independent of the others, which is not a line to be crossed lightly.
That's not to say I don't see the great idea behind it. Perhaps my single greatest problem with Oblivion is how easy it is to stack the 'Magnitude is %' effects like Chameleon or Reflect Damage and break the game. Unfortunately, this isn't so much an issue of Magic as it is an issue with percentages, so OBME probably isn't the place to fix it.
User avatar
Sun of Sammy
 
Posts: 3442
Joined: Mon Oct 22, 2007 3:38 pm

Post » Sat May 28, 2011 2:41 pm

While shadeMe's CSE is my most appreciated plugin (what can I say, I'm a modder/scripter at heart), OBME v1.0 is currently my most anticipated plugin. Each release is exponentially more exciting than the last. GetMagicEffectHandler and SetMagicEffectHandler make my jaw drop with all the possibilities.
User avatar
sarah
 
Posts: 3430
Joined: Wed Jul 05, 2006 1:53 pm

Post » Sat May 28, 2011 2:01 pm

It's not something I had thought of. For my own curiosity, can you give an example effect that shouldn't be reclaimed?

Was mostly a point of curiosity. I can imagine systems in which you'd like to enable reclamation on beneficial spells but not on hostile ones, or vice versa.

So yes, give the player a custom 'Fire Damage' spell with a weird name, and they'll still have access to regular Fire Damage. A flag that prevents an effect item from 'teaching' the player that effect is planned for a future version.

Works for me!

For the record, Feather really does effectively add to your maximum encumbrance.

Odd... this seems to contradict observed behavior. I'll have to re-test with the new handler. Anyway, with the ability to affect any "part" of the attribute, I should be able to make it work the way it should one way or another.

I was actually thinking of something tied to the sneak/detection mechanics - a chance that nearby actors wouldn't notice a spell being cast at them. Can you explain what you mean by 'function as Neutral in general'?

Basically I'm looking for a way to make effects that are not perceived as hostile by NPCs, but function as hostile within the magic system (i.e. they make poisons, and your new hostile-dispel affects them). For this to be tied to the stealth system might actually be superior in concept if done right, but I figured that would be harder since NPCs don't generally detect casting or projectiles, only getting hit.

This deserves more discussion, but I don't want to hold up 1.0 with it. Right now I can get 90% of what I want by making two copies of an effect: one hostile and used for ingredients, the other neutral and used for spells. The only place this falls short is in how it reacts to discerning dispels, which are a new feature anyway and won't stop me releasing a beta of my overhaul.

Short answer - no. Long answer - yes, but it would raise all kinds of hell.
Consider what happens when 'On Fire 1' is removed. Does 'On Fire 2' keep it's current (reduced magnitude), or does it grow to it's intended magnitude? Basically, this scheme violates the principle that each active effect is independent of the others, which is not a line to be crossed lightly.

My model is that On Fire 2 grows to its proper magnitude after On Fire 1 wears off: durations are still independent. I've got a convoluted outline of how to make this work in scripts, but oh man I hope I don't have to. ;) For no-magnitude effects this would work exactly like your reclamation mechanic, just not limited to identical spells. For spells no duration, of course, it's not an issue.

And I think this is very much an issue with magnitudes in general; percentages compound the issue, but magnitude scaling is not linear. Furthermore, my overhaul increases the exponent slightly, which makes this exploit noticeable with even relatively weak spells; my identical On Fire spells would cost 19, combining to 38, versus a 6-magnitude spell at 51: 34% savings versus 19% in vanilla. And this is starting at 3; the better the smaller spells, vanilla or otherwise, the more over-efficient they become. Stacking beyond 2 spells gets even crazier.

Pseudo-related, and also probably best saved for post-1.0: there are a couple of good ways which occur to me for replacing the percentage-based resistances. Let me know when you're ready to discuss that. :)
User avatar
carley moss
 
Posts: 3331
Joined: Tue Jun 20, 2006 5:05 pm

Post » Sun May 29, 2011 1:31 am

From the obse readme:
Open a command prompt window, navigate to your oblivion install folder, and type "obse_loader -editor"
It's probably easier to make a shortcut to obse_loader.exe, and then add " -editor" to the end of the shortcut target.

i read obse readme before...
i know i seem to be totally dumb but none of these solutions work for me. every time i try to start with obse loader it starts the game itself or it says the shortcut leads to an invalid target (if i change the place of the text "-editor"). i probably misunderstood something so it should be my fault. :facepalm: :brokencomputer:
User avatar
Manuel rivera
 
Posts: 3395
Joined: Mon Sep 10, 2007 4:12 pm

Post » Sat May 28, 2011 6:47 pm

GetMagicEffectHandler and SetMagicEffectHandler make my jaw drop with all the possibilities.
Thanks, although I should point out that just because one can change the handler doesn't mean it's a good idea. Handlers are responsible for creating Active Effects; changing to a new handler while active effects from the previous handler still exist could lead to some truly bizarre behavior. At the moment, this is really only safe for effects with no duration.

Basically I'm looking for a way to make effects that are not perceived as hostile by NPCs
I've some ideas on how to go about this. Remember to bring it up, come the next thread.

I'll put 'stacks by magicka' on the list of features for a secondary ModAV handler - it's feasible and general and requested, and that's enough for me. If I may suggest, though, I think you should finish your scripted version. This will give use both a better idea of the practical implications.
User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Post » Sat May 28, 2011 2:18 pm

every time i try to start with obse loader it starts the game itself or it says the shortcut leads to an invalid target

If it's just the shortcut that's giving you problems, my only suggestion is to make sure that the -editor switch is outside any quotes:
"obse_loader.exe" -editor

If it won't work when you use the Command Prompt approach from the readme, then you probably dealing with an issue that's outside of my expertise.
User avatar
Kelsey Anna Farley
 
Posts: 3433
Joined: Fri Jun 30, 2006 10:33 pm

Post » Sun May 29, 2011 12:55 am

First off I love what you are doing here. Magic has always been my favorite part of Oblivion and the possibilities you have introduced are just wonderful.

Do you think that variable casting times would be a possibility (either by school or per spell)? My understanding of magic casting time is that it is constant and set for each school of magic. It occurred to me that if increasing in skill in a school of magic could decrease casting time for spells rather than just decreasing the cost to cast them. Of course there would need to be some tweaking if both cast time and cost decreased, but it could have some interesting effects. If it could be done on a per spell basis, early spells would still be useful to a master.

What do you think? Possible - yay or nay?
User avatar
Stefanny Cardona
 
Posts: 3352
Joined: Tue Dec 19, 2006 8:08 pm

Post » Sun May 29, 2011 12:04 am

Do you think that variable casting times would be a possibility

Seems hopeful. I agree that variable casting speeds would add some nice depth for mages; the hard part will be syncing up the animations and sounds to match.
User avatar
OJY
 
Posts: 3462
Joined: Wed May 30, 2007 3:11 pm

Post » Sat May 28, 2011 9:33 pm

Oh I would love that. Would allow for Faster Cast Rate items in ARES.
User avatar
Amber Ably
 
Posts: 3372
Joined: Wed Aug 29, 2007 4:39 pm

Post » Sat May 28, 2011 8:15 pm

Wow! That's something I didn't expect to see a "yes" for, specifically because of the animation issue. But if you find a way to adjust the speeds on those, I might have to hit you up for an Oblivion Melee Extender after this is finished... :P
User avatar
Rachyroo
 
Posts: 3415
Joined: Tue Jun 20, 2006 11:23 pm

Post » Sat May 28, 2011 6:06 pm

Variable cast time would be pretty awesome. You could have really powerful spells that take a long time to cast. It would actually make fighting as a mage a lot more fun.
User avatar
Chris Ellis
 
Posts: 3447
Joined: Thu Jul 26, 2007 10:00 am

Post » Sat May 28, 2011 11:31 am

I just discovered this plugin, very cool :)

If you're going to look into casting effects maybe you could make actor value Casting Penalty (AV 0x2C) useful by having it reduce spell casting chance. So the chance that a spell is successfully cast is equal to 100% - Casting Penalty, otherwise it fails just as if the actor is silenced.

What does the "scale w/ magnitude" flag in summon/bound effect handlers do exactly?
User avatar
celebrity
 
Posts: 3522
Joined: Mon Jul 02, 2007 12:53 pm

Post » Sat May 28, 2011 3:10 pm

What does the "scale w/ magnitude" flag in summon/bound effect handlers do exactly?

Nothing, at the moment. If & when I decode the summoning mechanics, it should be possible to scale the level of the summoned actor - so higher magnitude spells give you stronger summons. Until then, I really ought to hide the checkbox in the CS to avoid confusion.
User avatar
Sara Lee
 
Posts: 3448
Joined: Mon Sep 25, 2006 1:40 pm

Post » Sat May 28, 2011 8:35 pm

If you're going to look into casting effects maybe you could make actor value Casting Penalty (AV 0x2C) useful by having it reduce spell casting chance. So the chance that a spell is successfully cast is equal to 100% - Casting Penalty, otherwise it fails just as if the actor is silenced.

Interestingly, the game ignores the Casting Penalty stat for NPCs. It calculates it, but then ignores it and uses 100% anyway. I actually was once going to make a plug-in that changed that, but haven't gotten around to it.
User avatar
xx_Jess_xx
 
Posts: 3371
Joined: Thu Nov 30, 2006 12:01 pm

Post » Sun May 29, 2011 1:18 am

If you're going to look into casting effects maybe you could make actor value Casting Penalty (AV 0x2C) useful by having it reduce spell casting chance. So the chance that a spell is successfully cast is equal to 100% - Casting Penalty, otherwise it fails just as if the actor is silenced.

For something like this, but with less one-dimensional mechanics, you should check out Fizzle -- follow the first link in my sig.

DW: Heh, that'll change a few of my default settings. I was only keeping the vanilla effectiveness mechanic in my game at all (based on fatigue rather than armor) because Fizzle doesn't affect NPCs (could, but the AI would have no idea what to do). Guess I can axe that. :)
User avatar
Blackdrak
 
Posts: 3451
Joined: Thu May 17, 2007 11:40 pm

Post » Sat May 28, 2011 9:44 pm

Is there an advantage to having spells succeed/fail rather than be reduced in strength?
User avatar
claire ley
 
Posts: 3454
Joined: Fri Aug 04, 2006 7:48 pm

Post » Sun May 29, 2011 3:14 am

Is there an advantage to having spells succeed/fail rather than be reduced in strength?
Not really an advantage, more of a gameplay alternative.
User avatar
Josh Dagreat
 
Posts: 3438
Joined: Fri Oct 19, 2007 3:07 am

Post » Sat May 28, 2011 11:38 am

My understanding of magic casting time is that it is constant and set for each school of magic.
Is that correct ? I don't ever recall noticing a difference in casting time b'ween schools.
User avatar
Sabrina Steige
 
Posts: 3396
Joined: Mon Aug 20, 2007 9:51 pm

Post » Sat May 28, 2011 7:59 pm

Is that correct ? I don't ever recall noticing a difference in casting time b'ween schools.


I swear I just read that somewhere reliable, but I can't, for the life of me, find where anymore. I don't think there's a noticeable difference though. I know I was surprised to read about it.
User avatar
Jessica Phoenix
 
Posts: 3420
Joined: Sat Jun 24, 2006 8:49 am

Next

Return to IV - Oblivion