Noob question about spell effect script

Post » Sat Feb 19, 2011 3:49 am

CSWiki seems to be down at the moment and I'm pretty much a noob when it comes to writing mods so any help would be much appreciated.

I'm working on a mod that will change some of the fortify skill/attribute abilities that are given from various quests, items, etc. so that they will give a fortify effect similar to an enchantment rather than just increasing the base attribute/skill level so that someone can still get increases in those attributes/skills. The Skeleton Key enchantment for example is one i'm working on.


First, I'm assuming that the way that the ability bonuses applies "fortify" effects to the base level rather than adding a bonus similar to an enchantment or spell is hard coded into the game. Correct me if I'm wrong on this because I would rather make my changes here if its possible.

Assuming that it is indeed hard coded I was able to get the desired effect by changing these abilities into diseases. I added a scripted effect to the ability effect list to reapply whenever the ability was lost due to cure disease or what ever reason. The problem is that this new scripted effect appears in the active effects list on the magic tab in game. (http://i75.photobucket.com/albums/i303/greezemunkee/ScreenShot0.jpg)

Is there any way to hide this entry or even trigger the script some where else so that it doesen't show up here?

Also how would I go about hiding the message that displays notifying the player whenever the effect is re-applied?
User avatar
Jeremy Kenney
 
Posts: 3293
Joined: Sun Aug 05, 2007 5:36 pm

Post » Sat Feb 19, 2011 2:27 am

Quest Scripts are your best bet-- if you set a Quest to run every second or so, you can re-add the Diseases if they are removed. Diseases are almost certianly the best way to do this as you have noticed-- I do the same in my Vampirism mod.

Something along the lines of...
If ( Player.GetItemCount [SkeletonKeyID] >= 1 )   If ( Player.IsSpellTarget [SpellBonusID] == 0 )      Player.AddSpell [SpellBonusID]   EndIfElseIf ( Player.GetItemCount [SkeletonKeyID] == 0 )   If ( Player.IsSpellTarget [SpellBonusID] == 1 )      Player.RemoveSpell [SpellBonusID]   EndIfEndIf


As to hiding the messages, you have two choices:
If you're using OBSE just use the NS versions-- Player.AddSpellNS Player.RemoveSpellNS
If you're not using OBSE, put the following directly before the add:

Message" "Message" "


A double blank message blocks other messages from coming up in that run of the script.
User avatar
Daramis McGee
 
Posts: 3378
Joined: Mon Sep 03, 2007 10:47 am


Return to IV - Oblivion