tg08096 Posted May 29, 2012 Share Posted May 29, 2012 I'm troubleshooting a silence effect, the one that makes one unable to cast spells. Since there is no actual "silence" effect in the CK, I figured I would settle for an effect that would make it "impossible" to cast magic. What I did was create a perk that modified the cost of spells, multiplying the base cost by 1000. So unless an armor set which reduces the cost of spells by 100% is worn, even a 6 magicka spell costs 6000, essentially "silencing" the caster. To test the effect, I first created two alchemical ingredients that make a potion - a potion that the PC can drink. The effect worked on my character as intended, and all spells were 1000s - 10000s range. I then changed the effect and ingredients to make a poison - a poison that I applied to a weapon to test the effect on NPCs. To my dismay, the effect did not seem to work on NPCs, because they continued to blast me with spells after I "poisoned" them. Does anyone know if the cost of spells does not apply to npcs? Do npcs work by a different set of rules than PCs? Does anyone have a thought on what I could do to get a silence effect? Any help is greatly apprectiated Link to comment Share on other sites More sharing options...
AstralFire Posted May 29, 2012 Share Posted May 29, 2012 A lot of actor values don't multiply correctly when dealing with NPCs. I would try instead doing a ravage magicka effect of impossibly high magnitude? Link to comment Share on other sites More sharing options...
tg08096 Posted May 29, 2012 Author Share Posted May 29, 2012 Thanks for the tip - ill try that! Link to comment Share on other sites More sharing options...
AstralFire Posted May 29, 2012 Share Posted May 29, 2012 (edited) Alternatively, there is an interrupt cast function, if you can figure out a way to get it to constantly apply - and if it triggers, you could set it so that it deals damage, which adds consequences to using concentration. Edited May 29, 2012 by AstralFire Link to comment Share on other sites More sharing options...
Korodic Posted May 29, 2012 Share Posted May 29, 2012 You could also disarm them whenever they equip magic. But to do so would involve much scripting. Better off ravaging their magic or even use a script effect that sets their magic AV (actor value) to zero, but stores the old value... and sets it to the old value on the effect finish. Link to comment Share on other sites More sharing options...
steve40 Posted May 30, 2012 Share Posted May 30, 2012 (edited) You could also disarm them whenever they equip magic. But to do so would involve much scripting. Better off ravaging their magic or even use a script effect that sets their magic AV (actor value) to zero, but stores the old value... and sets it to the old value on the effect finish. I think Korodic has almost hit the nail on the head. You don't need to use any script to ravage their magicka AV. Just create a base MagicEffects with Effect Archetype of PeakValueModifier and modify Actor Value "Magicka". Make sure that you tick the "Detrimental" and "Recover" boxes in the magic effect so that its magnitude will be applied NEGATIVELY, and so that the original stats will be restored when the spell wears off. Then create a spell/ability/poison/disease/shout whatever (they're effectively the same thing) and apply a very large magnitude to the spell. It might be redundant, but you might add a second MagicEffect to reduce the MagickaRate to zero so that their magicka doesn't recharge, just as a precaution. The effect(s) SHOULD wear off when the spell expires and restore the actor values to their original values, but test this thoroughly, as I have found that some actor values seem to be bugged and don't restore like they should ("DamageResist" is one AV that is broken). Alternatively, you could possibly use the Effect Archetype of "Dual Value Modifier" and change both Magicka and MagickaRate in the one MagicEffect, but these are stacking effects and might not be as effective as reducing the peak value directly. Edited May 30, 2012 by steve40 Link to comment Share on other sites More sharing options...
tg08096 Posted May 30, 2012 Author Share Posted May 30, 2012 You could also disarm them whenever they equip magic. But to do so would involve much scripting. Better off ravaging their magic or even use a script effect that sets their magic AV (actor value) to zero, but stores the old value... and sets it to the old value on the effect finish. I think Korodic has almost hit the nail on the head. You don't need to use any script to ravage their magicka AV. Just create a base MagicEffects with Effect Archetype of PeakValueModifier and modify Actor Value "Magicka". This would be the ideal effect, one that sets magicka to zero, then restores the original value upon expiration. I previously experimented with a burden effect, where I created an effect that set max carry weight to zero (to see if it worked). I tested in the same way I tested silence, I first created a potion of burden to test the effect on the PC. When that was successful, I switched the properties to hostile, detrimental, and changed keyword from magicalchbeneficial to magicalchharmful. The effect did not work on npcs. A lot of actor values don't multiply correctly when dealing with NPCs. I would try instead doing a ravage magicka effect of impossibly high magnitude? I think the key word here is a lot, I shouldnt assume all, so I will test the method of modifying the AV. In the meantime, I have used the ravage method as a placeholder. The only downside to this method is that the actor's magicka will be empty upon expiration of the effect, and I have no knowledge of scripting at this time. Thank you all for your help; I will test this and let you know if it works Link to comment Share on other sites More sharing options...
steve40 Posted May 30, 2012 Share Posted May 30, 2012 (edited) Create a base MagicEffect of archetype Script. Attach the following script to it: Scriptname SilenceMagic extends ActiveMagicEffect {Reduces the creature's magicka stats to zero temporarily and restores them when the effect ends} ;============================================================ float origmagicka float origmagickarate float origmagickaratemult ;============================================================ ;Weaken stats on effect start. Event OnEffectStart(Actor akTarget, Actor akCaster) origmagicka = akTarget.GetAV("magicka") origmagickarate = akTarget.GetAV("magickarate") origmagickaratemult = akTarget.GetAV("magickaratemult") akTarget.ForceAV("magicka", 0.0) akTarget.ForceAV("magickarate", 0.0) akTarget.ForceAV("magickaratemult", 0.0) EndEvent ;Restore stats on effect end. Event OnEffectFinish(Actor akTarget, Actor akCaster) akTarget.ForceAV("magicka", origmagicka) akTarget.ForceAV("magickarate", origmagickarate) akTarget.ForceAV("magickaratemult", origmagickaratemult) EndEvent ;============================================================ I haven't tested this in game, but it is very similar to a script that I use in my JAWS mod, so it should work on npc's. Edited May 30, 2012 by steve40 Link to comment Share on other sites More sharing options...
Korodic Posted May 30, 2012 Share Posted May 30, 2012 Create a base MagicEffect of archetype Script. Attach the following script to it: Scriptname SilenceMagic extends ActiveMagicEffect {Reduces the creature's magicka stats to zero temporarily and restores them when the effect ends} ;============================================================ float origmagicka float origmagickarate float origmagickaratemult ;============================================================ ;Weaken stats on effect start. Event OnEffectStart(Actor akTarget, Actor akCaster) origmagicka = akTarget.GetAV("magicka") origmagickarate = akTarget.GetAV("magickarate") origmagickaratemult = akTarget.GetAV("magickaratemult") akTarget.ForceAV("magicka", 0.0) akTarget.ForceAV("magickarate", 0.0) akTarget.ForceAV("magickaratemult", 0.0) EndEvent ;Restore stats on effect end. Event OnEffectFinish(Actor akTarget, Actor akCaster) akTarget.ForceAV("magicka", origmagicka) akTarget.ForceAV("magickarate", origmagickarate) akTarget.ForceAV("magickaratemult", origmagickaratemult) EndEvent ;============================================================ I haven't tested this in game, but it is very similar to a script that I use in my JAWS mod, so it should work on npc's. This is what I would have done :P Should definitely work. Link to comment Share on other sites More sharing options...
tg08096 Posted May 30, 2012 Author Share Posted May 30, 2012 @Steve40 Well this is more than I could have hoped for. The script seems to work perfectly. Thank you very much, kudos to you, Steve Edit: It seems I could probably use this script as a template for a burden effect as well, using "maxcarryweight" instead of magicka, and changing aktarget.forceav to aktarget.[subtractav] or something like it, where [subtractav] is likely not the proper function, but something like it. It seems I should start playing around with some scripting tutorials. Link to comment Share on other sites More sharing options...
Recommended Posts