I just had a really nifty idea

Post » Sat Apr 02, 2011 12:18 am

So, as has been pointed out in the past, fortify health spells... well, svck. They're pointless in that, even with the MCP fix, you still end up with a spell that gives you health and then takes it right back away, leaving you right back where you started.

The author of the Stat-Based HP mod rewrite attempted to address the problem himself, but ran into a wall when anything he tried to do to the effect ended up making constant effect fortify health effects able to heal the player infinitely as a result.

And then I got to thinking... maybe we're just approaching the problem from the wrong direction. Instead of trying to change the effect itself to svck less, why don't we just script the pre-made spells and enchantments to svck less? The downside of this is that it wouldn't work for custom spells or enchantments, but this is at least consistent with a lot of other effects I've edited in BTB's Game Impropvements, anyway.

Someone pointed out to me awhile back that drain health can actually act as something of a delayed restore health effect, since it gives you health back when the effect ends. Thus, all I really need to do is script all premade fortify health spells and enchantments to add a drain health effect ( + immediate restore health of an equal amount ) that will counteract the fortify health drain when the effect ends. Seems simple enough, but with scripting, nothing ever is.

I'm at work right now, so I can't test this out proper, but here's a little something I just whipped up:

begin _fortify_health	short vital	short blood	short daedric	if ( player->getspelleffects "vitality" == 1 )		if ( vital == 0 )			player->cast "vitality2"			set vital to 1		endif	elseif ( vital == 1 )		if ( player->getspelleffects "vitality" == 0 )			set vital to 0		endif	endif	if ( player->getspelleffects "blood gift" == 1 )		if ( blood == 0 )			player->cast "blood gift2"			set blood to 1		endif	elseif ( blood == 1 )		if ( player->getspelleffects "blood gift" == 0 )			set blood to 0		endif	endif	if ( player->getspelleffects "daedric health" == 1 )		if ( daedric == 0 )			player->cast "daedric health2"			set daedric to 1		endif	elseif ( daedric == 1 )		if ( player->getspelleffects "daedric health" == 0 )			set daedric to 0		endif	endifend


Thoughts?
User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm

Post » Sat Apr 02, 2011 1:32 am

This is a really good example of thinking outside the box.
Excellent workaround, I can't really see why this wouldn't work in theory.
User avatar
Danny Blight
 
Posts: 3400
Joined: Wed Jun 27, 2007 11:30 am

Post » Sat Apr 02, 2011 3:23 am

My concern is a lack of experience working with the "getspelleffects" command. I'm not sure if it will work the way I want it to, particularly if it gets dispelled. I tried to account for that, but I'll need to test it out.
User avatar
Irmacuba
 
Posts: 3531
Joined: Sat Mar 31, 2007 2:54 am

Post » Sat Apr 02, 2011 7:25 am

A good alternative to what you're trying to do (since you're using scripts for existing spells) is using the GetSpell function, which will literally return 1 if the actor has that particular spell and 0 in any other case. This is a very stable function that's never failed me in my most extensive calculations.
User avatar
Hayley Bristow
 
Posts: 3467
Joined: Tue Oct 31, 2006 12:24 am

Post » Sat Apr 02, 2011 6:51 am

A good alternative to what you're trying to do (since you're using scripts for existing spells) is using the GetSpell function, which will literally return 1 if the actor has that particular spell and 0 in any other case. This is a very stable function that's never failed me in my most extensive calculations.


That, unfortunately, will not serve my intended purpose, since I need it to return 1 when the spell has been *used*. Simply knowing whether or not the player knows it is worthless.
User avatar
Dewayne Quattlebaum
 
Posts: 3529
Joined: Thu Aug 30, 2007 12:29 pm

Post » Sat Apr 02, 2011 3:16 am

That, unfortunately, will not serve my intended purpose, since I need it to return 1 when the spell has been *used*. Simply knowing whether or not the player knows it is worthless.

im pretty sure when he means the actor has the spell on it. He means that it has been cast on the actor.
User avatar
renee Duhamel
 
Posts: 3371
Joined: Thu Dec 14, 2006 9:12 am

Post » Sat Apr 02, 2011 6:32 am

im pretty sure when he means the actor has the spell on it. He means that it has been cast on the actor.


No, GetSpell only returns one if the actor has the spell in their inventory. It has nothing to do with whether or not it has been cast.
User avatar
Dan Scott
 
Posts: 3373
Joined: Sun Nov 11, 2007 3:45 am

Post » Sat Apr 02, 2011 1:35 am

Thoughts?


        elseif ( vital == 1 )                if ( player->getspelleffects "vitality" == 0 )                        set vital to 0                endif        endif

could probably be simplified to
        else                set vital to 0        endif

because that's what it's going to do anyway, no need to waste time checking the conditions at all.

Just to lay it out, I'm of the opinion that fortify is not the same class as a restore spell and shouldn't try to be. Morrowind magic is a harsh mistress. As an example, if fortify really did work like you want, let us go to the enchant maker and make a 1 second fortify health spell for 50 points. That becomes an instant heal, as good as chugging an insta potion from Diablo II: The Clickening. On top of that, if it was a part of MCP with no mod support, let us check the effect base cost table... restore health, 5, fortify health, 1. Hmmmmm.

It might be worth having a buffer that is just a fraction of the actual spell, though that's not so charming.
User avatar
Portions
 
Posts: 3499
Joined: Thu Jun 14, 2007 1:47 am

Post » Fri Apr 01, 2011 10:18 pm

        elseif ( vital == 1 )                if ( player->getspelleffects "vitality" == 0 )                        set vital to 0                endif        endif

could probably be simplified to
        else                set vital to 0        endif

because that's what it's going to do anyway, no need to waste time checking the conditions at all.


Er... good point. I had thought about that, but I wasn't exactly all there when I wrote this.


Just to lay it out, I'm of the opinion that fortify is not the same class as a restore spell and shouldn't try to be. Morrowind magic is a harsh mistress. As an example, if fortify really did work like you want, let us go to the enchant maker and make a 1 second fortify health spell for 50 points. That becomes an instant heal, as good as chugging an insta potion from Diablo II: The Clickening. On top of that, if it was a part of MCP with no mod support, let us check the effect base cost table... restore health, 5, fortify health, 1. Hmmmmm.


It isn't a restore health effect, and what you mentioned is the exact reason why this issue hasn't really been addressed much in the past. But remember I intend to stick this into my mod, which balances the spell effects accordingly. The primary intent of a fortify health spell is to give you extra health on top of your maximum - using it exclusively as a restore health spell *will* work, but it will be far elss efficient, magicka-wise, as using a restore health spell would.

Because I can only apply this script to existing spells and enchantments, AFAIK, I will just go ahead and disallow custom spells and enchantments with the fortify health effect.

It might be worth having a buffer that is just a fraction of the actual spell, though that's not so charming.


I already figured that I'd make the drain health effect last about two seconds shorter than that of the fortify health spell for just that reason.
User avatar
Trevi
 
Posts: 3404
Joined: Fri Apr 06, 2007 8:26 pm

Post » Fri Apr 01, 2011 10:13 pm

Your drain/restore acts like a health buffer, and it doesn't have to be 100% of the fortified health. That may be too complicated to be fun, though.

Try not to disallow too many custom effects, just make them expensive. I can imagine a dedicated priest with 100 restoration and a skill-linked cast cost reduction mod should be able to extract a powerful spell which fortifies her health to more than Vivec's. A powerful but unspecialised magister can maybe do 25 health for a minute at best. Just a little more freedom for the less conventional classes. If only there were more scenarios where surviving was more important that direct combat.
User avatar
Nick Swan
 
Posts: 3511
Joined: Sat Dec 01, 2007 1:34 pm

Post » Sat Apr 02, 2011 11:17 am

Your drain/restore acts like a health buffer, and it doesn't have to be 100% of the fortified health. That may be too complicated to be fun, though.


Yeah, I thought about that, too... but having it be equal to the fortified amount just makes things simpler.

Besides, like I said, it's still less efficient as a means of restoring health than a regular restore health spell would be.

Try not to disallow too many custom effects, just make them expensive. I can imagine a dedicated priest with 100 restoration and a skill-linked cast cost reduction mod should be able to extract a powerful spell which fortifies her health to more than Vivec's. A powerful but unspecialised magister can maybe do 25 health for a minute at best. Just a little more freedom for the less conventional classes. If only there were more scenarios where surviving was more important that direct combat.


Well, in this case, disallowing custom spells/enchantments is a mercy killing rather than a nerf, since there'd be no way to get them to function the way that I've scripted them to.
User avatar
Julia Schwalbe
 
Posts: 3557
Joined: Wed Apr 11, 2007 3:02 pm

Post » Sat Apr 02, 2011 5:42 am

But what if I want to play a sister of mercy? You're killing me here. What happens if you pack the fortify, drain and restore into the same spell? I'll try to find BrodieSWR, he'd be interested in this thread.
User avatar
Alexis Acevedo
 
Posts: 3330
Joined: Sat Oct 27, 2007 8:58 pm

Post » Sat Apr 02, 2011 8:00 am

What happens if you pack the fortify, drain and restore into the same spell?


Well, a few things.

One, first and foremost, I disable drain health spells and enchantments in my mod for unrelated reasons.

Two, the reason I came up with the script in the first place, is that I didn't want fortify health spells to require a high Destruction skill level to cast.

Now, I suppose I could apply the script to the fortify health effect in general, but the problem is that we come right back around to it breaking constant effect restore health enchantments. I also would have no way of determining duration/magnitude. I'd be a lot better off just expanding the line of pre-made fortify health spells.

I'll try to find BrodieSWR, he'd be interested in this thread.


I already shot him a line earlier.
User avatar
Bedford White
 
Posts: 3307
Joined: Tue Jun 12, 2007 2:09 am

Post » Sat Apr 02, 2011 3:06 am

(Nevermind... I'm an idiot. Forget I said anything right here. Forget, damn you!)
User avatar
Susan Elizabeth
 
Posts: 3420
Joined: Sat Oct 21, 2006 4:35 pm

Post » Sat Apr 02, 2011 12:55 am

Hey guys, Talrivian, the author of the State-Based HP mod would like to give his opinion on the matter.

I believe that you guys are looking at this from the wrong perspective. I think that I have worked with the Fortify Health spell more than others because of my obsession with it, and I know many different ways to implement it.

There is ONE way to make it a health buffer, WITHOUT functioning as a healing spell. It can also be accomplished using scripting quite easily, but it requires BTB's method to function:

It must be implemented individually for all spells already in the game, and will require you to disable custom spell making and enchantments for the Fortify Health Spell because of the necessary scripting.

Basically, what you need to do is have the Fortify Health Spell remove all of the HP that it gave, minus the damage that you received during the duration of the spell, up to the maximum allowed by the spell. This way, it acts as a "preemptive heal" in a way, and ONLY "heals" you if you actually receive damage. In this way, it funcions more as temporary HP like in Dungeons and Dragons.

This is very easy to implement with scripting, you just need to create a "damage counter" that stays active when a person has the selected effect cast on them, and heals them as they receive damage, and removes the effect when the damage equals the value of the spell.

I am currently at the beach with my wife's family. When I return home, I can dig up my files and provide an example of the test script that I created for this very thing a while back. I shall post soon, probably tomorrow afternoon.

Tchau, and HAPPY NEW YEAAAAAAAAAAAAAR!!!
User avatar
Ebou Suso
 
Posts: 3604
Joined: Thu May 03, 2007 5:28 am

Post » Sat Apr 02, 2011 2:59 am

As long as you make sure it relates to similar principles of the forefather of great roleplaying, AD&D.
Unless you already thought of that one, of course.

I thought we all had some kind of crazy war about all this already...?
User avatar
Phillip Hamilton
 
Posts: 3457
Joined: Wed Oct 10, 2007 3:07 pm

Post » Sat Apr 02, 2011 2:33 am

Well, like I said above, I'm fine with the fortify health spells giving you health that you get to keep if you don't use it, because it remains balanced by the fact that it costs far more to use it as a restore health spell than it would be to just use a restore health spell.
User avatar
Lizs
 
Posts: 3497
Joined: Mon Jul 17, 2006 11:45 pm

Post » Sat Apr 02, 2011 1:10 am

As long as you make sure it relates to similar principles of the forefather of great roleplaying, AD&D.
Unless you already thought of that one, of course.

I thought we all had some kind of crazy war about all this already...?


Yeah, we already had this discussion and it came to a pretty poor ending. Hopefully this idea is nifty enough to avoid that this time around, but I don't doubt the mods will be keeping a close eye on things.

As far as the technical side, GetSpellEffects and most of those detection functions aren't always reliable and finding the player's max health has the good old magic issues. If it's really necessary to fix the effects until it's broken, you'll have to find work-arounds for both of those.

And breaking all mod-added restore health spells is a Bad Idea. If you can't set up some kind of framework that will work with them, you might want to reconsider touching the effect at all. Having mismatched effects depending on where the spell came from would be confusing at best, fatal for quite a few characters at worst. With some clever scripting, it might be possible to set something up that would work well in most cases.
User avatar
MatthewJontully
 
Posts: 3517
Joined: Thu Mar 08, 2007 9:33 am

Post » Sat Apr 02, 2011 8:45 am

As far as the technical side, GetSpellEffects and most of those detection functions aren't always reliable and finding the player's max health has the good old magic issues. If it's really necessary to fix the effects until it's broken, you'll have to find work-arounds for both of those.


I don't see the need to know the player's maximum health at all, actually. I think that's the beautfy of this idea - it's extremely simple. At its core, all it's really doing is restoring an equal amount of health that gets taken away when the spell ends.

And breaking all mod-added restore health spells is a Bad Idea. If you can't set up some kind of framework that will work with them, you might want to reconsider touching the effect at all. Having mismatched effects depending on where the spell came from would be confusing at best, fatal for quite a few characters at worst. With some clever scripting, it might be possible to set something up that would work well in most cases.


This shouldn't do that at all. I'm assuming you meant to say "fortify health" instead of "restore health", and all I'm really doing to the effect itself is turning off spellmaking and enchanting privleges, which I already do with a handful of them in my mod, anyways. The script itself targets only the three pre-made spells, and is perfectly safe to be used with fortify health spells added by mods... although it will render them pretty useless (not that they weren't to begin with).

EDIT: Though, I suppose that since constant effect fortify health enchantments are actually still useful, and not everybody uses the part of my mod that disables CE enchantments, I should just go ahead and leave enchanting privleges active for it. There's still no reason that I can see why anyone who uses my spells plugin would want to custom-build a spell, though.
User avatar
Zualett
 
Posts: 3567
Joined: Mon Aug 20, 2007 6:36 pm

Post » Sat Apr 02, 2011 10:10 am

This shouldn't do that at all. I'm assuming you meant to say "fortify health" instead of "restore health", and all I'm really doing to the effect itself is turning off spellmaking and enchanting privleges, which I already do with a handful of them in my mod, anyways. The script itself targets only the three pre-made spells, and is perfectly safe to be used with fortify health spells added by mods... although it will render them pretty useless (not that they weren't to begin with).

That bit was gone over pretty well last time someone tried to start a flame war about this.

Fortify health (what I meant) has a wide variety of player opinions about it, and plenty of people don't think it's broken. I've never had a problem with the existing spells, or the effect in general.

You should also consider that a: not everyone runs your other mods (I wasn't aware you had made a spell editing mod) and compatibility is something to consider, and b: if it's so closely related to your other mod, maybe it should be in there instead of as a second mod/thread/whatnot?

There's still no reason that I can see why anyone who uses my spells plugin would want to custom-build a spell, though.

... am I missing some sarcasm? Maybe for spell making? :P I was under the impression people did that on occasion, since it's been included in every TES game since Daggerfall (not sure about Arena).
User avatar
MR.BIGG
 
Posts: 3373
Joined: Sat Sep 08, 2007 7:51 am

Post » Fri Apr 01, 2011 10:41 pm

That bit was gone over pretty well last time someone tried to start a flame war about this.


Which I have no interest in reviving :)

So, I'll try to keep this discussion confined to the logistics of the idea rather than its merits.

Fortify health (what I meant) has a wide variety of player opinions about it, and plenty of people don't think it's broken. I've never had a problem with the existing spells, or the effect in general.


Bearing the above point in mind, how is it that you find a use for an effect that gives you health and then takes it right back away? I presume that you use it solely as a means as keeping yourself alive through a beating that you ordinarily could not handle, after which you heal yourself before the effect ends.

You should also consider that a: not everyone runs your other mods (I wasn't aware you had made a spell editing mod) and compatibility is something to consider, and b: if it's so closely related to your other mod, maybe it should be in there instead of as a second mod/thread/whatnot?


It's just the one mod... broken up into five components. The one that disables constant effect enchantments doesn't appear to be as popular as the one that edits spells.

And big ideas like this that require lots of input I try to keep separate from the thread about my mod... which may or may not be a good idea, depending on how you look at it.

... am I missing some sarcasm? Maybe for spell making? :P I was under the impression people did that on occasion, since it's been included in every TES game since Daggerfall (not sure about Arena).


Heh, nope, I'm being quite serious. Like I said above, that's the only real use I can think of for the effect as is (outside of constant effect enchantments, anyways).
User avatar
Chad Holloway
 
Posts: 3388
Joined: Wed Nov 21, 2007 5:21 am

Post » Sat Apr 02, 2011 9:10 am

Well, GetSpellEffects is working properly... cast is not.

*Scratches head*
User avatar
noa zarfati
 
Posts: 3410
Joined: Sun Apr 15, 2007 5:54 am

Post » Sat Apr 02, 2011 1:31 am

*Snip*
User avatar
Steven Nicholson
 
Posts: 3468
Joined: Mon Jun 18, 2007 1:24 pm

Post » Sat Apr 02, 2011 10:37 am

I'm really not sure what I was thinking last night, or why I was trying so hard to avoid using a timer... could be that I'm just not getting enough sleep.

Anyways, this should work:

begin _fortify_health	short vital	short bloody	short daedric	if ( player->getspelleffects "vitality" == 1 )		if ( vital == 0 )			set vital to ( vital + getsecondspassed )		endif		if ( vital >= 59 )			player->modcurrenthealth 20			set vital to -1		endif	elseif ( vital > 0 )		player->modcurrenthealth 20		set vital to 0	else		set vital to 0	endif	if ( player->getspelleffects "blood gift" == 1 )		if ( bloody == 0 )			set bloody to ( bloody + getsecondspassed )		endif		if ( bloody >= 59 )			player->modcurrenthealth 50			set bloody to -1		endif	elseif ( bloody > 0 )		player->modcurrenthealth 50		set bloody to 0	else		set bloody to 0	endif	if ( player->getspelleffects "daedric health" == 1 )		if ( daedric == 0 )			set daedric to ( daedric + getsecondspassed )		endif		if ( daedric >= 59 )			player->modcurrenthealth 100			set daedric to 0		endif	elseif ( daedric > 0 )		player->modcurrenthealth 100		set daedric to 0	else		set daedric to 0	endifend

User avatar
Ludivine Poussineau
 
Posts: 3353
Joined: Fri Mar 30, 2007 2:49 pm

Post » Fri Apr 01, 2011 8:23 pm

You could just put all that into your last post, I'm sure someone out there would read it.
User avatar
Elina
 
Posts: 3411
Joined: Wed Jun 21, 2006 10:09 pm


Return to III - Morrowind