Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Dynamic Spell Magnitude?


primemonky
 Share

Recommended Posts

Okay, what i want to know is can i alter the magnitude of a spell via script? basically i want the magnitude of a fortify speed effect to diminish as your fatigue gets lower for a sprint mod I've made, I also want the amount that your speed is fortified by to depend on how high your speed already is. I already have this done but using the mod modAV function, so far its worked fine, I've had this mod enabled for at least a month, but people say that it can cause problems so I would rather find a way to avoid those problems. Also, if I can modify the magnitude of a spell with a script, it would probably be better to use a fortify athletics effect instead correct??

Link to comment
Share on other sites

Use a scripted effect for the spell. I know, sounds to obvious right? I think the CS will allow you to create a spell, and have the spell effects contained in the script, that would certainly be the easiest way.

Yeah but he want's to change the magnitude of a fortify effect in game. He could make a scripted spell, but he would have to just modAV from the script there, and apparently he doesn't want to do modav :shrug:

Link to comment
Share on other sites

Thanks Critterman, i had thought that i would use that function ( SetNthActiveEffectMagnitude right?) Ill just have to mess with it since I'm a little confused on how to use it. Will i be able to only modify the fortify athletics from a specific ability ( the one i made)?? or will it affect the magnitude from other fortify athletic effects as well?

I don't mind using modAV, especially since i haven't ran into any problems with how i have it in my script, but people suggest not using it since it can cause problems with other mods i believe, as well as vanilla oblivion, Like some of the old Health Regen Mods.

Link to comment
Share on other sites

Thanks Critterman, i had thought that i would use that function ( SetNthActiveEffectMagnitude right?) Ill just have to mess with it since I'm a little confused on how to use it. Will i be able to only modify the fortify athletics from a specific ability ( the one i made)?? or will it affect the magnitude from other fortify athletic effects as well?

I don't mind using modAV, especially since i haven't ran into any problems with how i have it in my script, but people suggest not using it since it can cause problems with other mods i believe, as well as vanilla oblivion, Like some of the old Health Regen Mods.

I'm pretty sure it will only modify your special ability, just make sure to use a custom spell and your good (yes SetNthActiveEffectMagnitude) aa_biggrin.gif

You'll have to use GetActiveEffectCount and use a loop with Label and Goto and run through the player's active effects until you find your special ability, using GetNthActiveEffectCode (codes), and then modify it with SetNthActiveEffectMagnitude. It's sort of a round-about way but it is similar to how you would walk through the inventory

Looking through these functions you might want to use a magic item (just some random item with an enchantment) to add the effect, because it looks like you can't actually get the spell's ID doing this. So you could use GetNthActiveEffectMagicItem to make sure it is in fact your special ability you're modifying.

Link to comment
Share on other sites

I appreciate the help Critterman, but i feel my newbness coming out again. Im confused on exactly what to do. when you use player.GetNthActiveEffectCode 0 that will return the ID of the spell that the 1st active effect came from?

Ok, I wasn't so sure about it so I tested it in-game and it worked so this is pretty much how you can find your effect among the ones the player has:

float fQuestDelayTime

 short Once

 long Count


 Begin Gamemode

     Set fQuestDelayTime to 0.01

     if Once == 0

         Player.AddSpell FortifyAthletics

         Set Once to 1

     endif

     Set Count to Player.GetActiveEffectCount

     Label

     if Count > -1

         if Player.GetNthActiveEffectMagicItem Count == FortifyAthletics

             Player.SetNthActiveEffectMagnitude 30 Count

         endif

         Set Count to Count - 1

         GoTo

     endif

 End

For this test it simply sets the magnitude to 30 (over and over again I might add). So you can substitute the 30 for your variable (whatever you want the magnitude set to) and make sure the Label and Goto part only is run when you need it, or it will run over and over again for infinity, though it doesn't give any noticeable impact on my performance.

Link to comment
Share on other sites

Okay Ive implemented your code into my script Critterman, many thanks again, and its working almost perfectly. The only problem I'm having is for some reason it wont fortify my speed over 100, or at least it wont show above 100, but as the amount its fortified by decreases I'll see my speed start returning to normal as it should and I'll see it decreasing. The thing is when i used the modAV command for it, my speed would show over 100. I have Ely's Uncapper but i cant remember if it shows that your attributes are over 100 in the menu. Anyways is this normal, or a problem with my script?

Also if i could get your opinion, Ive used my version with the modAV command for over a month and have found no problems with it permanently changing my speed. So would you think that it could be considered stable? Ive been reluctant to release because i don't want to mess up anyones game. Either way I'm going to figure out how to get this to work if possible, you know, for the learning experience.

Link to comment
Share on other sites

Okay Ive implemented your code into my script Critterman, many thanks again, and its working almost perfectly. The only problem I'm having is for some reason it wont fortify my speed over 100, or at least it wont show above 100, but as the amount its fortified by decreases I'll see my speed start returning to normal as it should and I'll see it decreasing. The thing is when i used the modAV command for it, my speed would show over 100. I have Ely's Uncapper but i cant remember if it shows that your attributes are over 100 in the menu. Anyways is this normal, or a problem with my script?

Also if i could get your opinion, Ive used my version with the modAV command for over a month and have found no problems with it permanently changing my speed. So would you think that it could be considered stable? Ive been reluctant to release because i don't want to mess up anyones game. Either way I'm going to figure out how to get this to work if possible, you know, for the learning experience.

Unfourtunatly the game won't let you increase over 100 with a spell. Even if you put 1000000000000000000, it would still be 100 :D

You should consider using ModAV2 to change the stats in your script. That way you can restore the points with another spell or with potions. ModAV2 works exactly the same way ModAV works in the console (yes the normal ModAV works to permanently change stats in a script :bagged:)

Link to comment
Share on other sites

Unfourtunatly the game won't let you increase over 100 with a spell. Even if you put 1000000000000000000, it would still be 100 :D

You should consider using ModAV2 to change the stats in your script. That way you can restore the points with another spell or with potions. ModAV2 works exactly the same way ModAV works in the console (yes the normal ModAV works to permanently change stats in a script :bagged: )

Hmmm, i swore that you could fortify skills past 100, i thought it was just that in vanilla you just couldn't increase them past 100. O well.

I had changed my script to use modav2 but the original never had a problem until I changed it to use modav2. it would work while i was "sprinting" but when i stopped i was slower...a lot slower, I cant remember how low my speed was modified but it was a good amount. The way i had my script set up with modav is that at the end of the script it would modify my speed if the conditions were met, and the very 1st thing it does the next time the script runs is remove the modification as long as their was one at the end of the last script. Maybe it was that removing part that messed my speed up?? But if so, then how do i return the the speed to the correct value?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...