candlepin Posted March 29, 2017 Author Share Posted March 29, 2017 (edited) If anyone has time, could you take a look at my Resist Paralysis script? In particular, I'm wondering about my Update time; is 0.1 too frequent? I'm also not sure about how the script would handle multiple paralyze effects; what happens to a paralyzed player when they are hit with another paralyze effect? Do they concatenate? Does the new effect replace the old effect? Does the new effect get ignored since they are already paralyzed? As-is, my script will only handle the last case. I'll give a try tonight, but I'm always open to input to make it better/work. Any input is appreciated! Scriptname CP_ResistParalysisScript extends activemagiceffect {Script for actor to resist paralysis} Actor Property akTarget autoBool Property ResistAttempted = false auto Event OnEffectStart(Actor akCaster, Actor akTarget) RegisterForSingleUpdate(0.1)EndEvent Event OnEffectFinish(Actor akCaster, Actor akTarget) UnregisterForUpdate()EndEvent Event OnUpdate() If akTarget.GetAV("Paralysis") != 0 ;if akTarget is paralyzed If ResistAttempted == false ResistAttempted = true ;so that this will only be checked once per paralysis Float Mag = Self.GetMagnitude() Float RandomNumber = Utility.RandomFloat(0, 100) If Mag >= RandomNumber akTarget.SetAV("Paralysis", 0) ResistAttempted = false ;so that if the actor gets paralyzed again during the magic effect, they will ;attempt to resist future paralysis effects (for the duration of the effect) EndIf EndIf ElseIf akTarget.GetAV("Paralysis") == 0 ResistAttempted = false ;so that if an actor's paralysis ends naturally, they have a chance to resist ;future paralysis effects (for the duration of the effect) EndIf RegisterForSingleUpdate(0.1)EndEvent Edited March 29, 2017 by candlepin Link to comment Share on other sites More sharing options...
NagusQuark Posted March 30, 2017 Share Posted March 30, 2017 what happens to a paralyzed player when they are hit with another paralyze effect? Do they concatenate? Does the new effect replace the old effect? Does the new effect get ignored since they are already paralyzed? As-is, my script will only handle the last case. They stack independently. If you keep casting it again before the previous stack expired, it keeps the target paralysed for the entire time. Link to comment Share on other sites More sharing options...
PeterMartyr Posted March 30, 2017 Share Posted March 30, 2017 I look at your Script and went no way is that going to work, what would I do? i came up this Scriptname ResistParalysisScript extends activemagiceffect Spell Property ParalysisDispell Auto ; Custom spell design to dispel Magic Effect with the Keyword "MagicParalysis" Keyword Property MagicParalysis Auto Actor Target Bool IsUpdating = false Event OnEffectStart(Actor akCaster, Actor akTarget) If(akTarget == Game.GetPlayer() && !IsUpdating) Target = akTarget IsUpdating = true RegisterForSingleUpdate(2) EndIf EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) IsUpdating = false EndEvent Event OnUpdate() Int nIndex = 7 ; a loop of lucky # 7 for Stacking Effects While(Target.HasMagicEffectWithKeyword(MagicParalysis) && nIndex) nIndex -= 1 ParalysisDispell.Cast(Target, Target) EndWhile RegisterForSingleUpdate(1) EndEvent but then came the testing for Function bit, and I really didn't want to take it any further, so feel free the script is yours. The loop should counter any stacking effect, it design to short the effect has much as possible, not magically shrug it off. I expect the player to a least fall to the ground. If your script works & works well I am very happy to be proven wrong. :thumbsup: Anywho Good Modding PS Also I only use the loop cause Stacking was mention in an above post, It may not be necessary. Like I said not test for Function, but I can't see a problem with not working, except user.(sorry don't mean to offend) PSSS Magic Effects Auto unregister for everything so there no need to to unregister for update. But if make feel better you can add it. Link to comment Share on other sites More sharing options...
PeterMartyr Posted March 30, 2017 Share Posted March 30, 2017 (edited) another option is on Effect Start give the player a Force Selected Alias with Keyword "ImmuneParalysis" then Clear the Alias on Effect End, also untested, yep that it, out of ideas. :huh: But really like this one, since I believe it come the closest to what your trying to achieve, but I could wrong. Good Modding. Ps be sure to sure to tick right boxes, so it clear correctly. (Irish Accent) I 'm going to bed. Edit sometime Papyrus isn't the answer, since I seen post that it impossible give Actor's Keywords, nevertheless, I done it with Alias & it works. Ok it still needs papyrus to apply the alias. Edited March 30, 2017 by PeterMartyr Link to comment Share on other sites More sharing options...
candlepin Posted March 30, 2017 Author Share Posted March 30, 2017 Very interesting approach. I might use some of this in my script, particularly the while loop checking for HasMagicEffectWithKeyword. I would likely remove "akTarget == Game.GetPlayer() && " from the OnEffectStart though, since I'd like this to work with any target, not just the player. Also, instead of making another Spell I should be able to remove any paralysis effects from within this script (where "ParalysisDispell.Cast(Target, Target)" is), right? I'm not sure how well this would work for non-player actors. Instead, I should be able to use something like: if akTarget.HasMagicEffect("Paralysis") Paralysis.Dispel() The problem I'm having is that Dispel appears like it should only work on spells. I'd preferably like an effect that prevents paralysis from all sources; spells, poisons, traps, etc. Therefore I'd like to remove the paralysis Magic Effect itself, but I'm having a difficult time figuring out how to do this. Thus my earlier script attempt of akTarget.SetAV("Paralysis", 0). Any insight would be helpful. The Forced Alias approach might work, but that would be all or nothing (not checking for each paralysis attempt). Also not sure how well this would work with non-player actors (e.g. companions). Also, the Forced Alias approach might work, but that would be all or nothing (not checking for each paralysis attempt). Also not sure how well this would work with non-player actors (e.g. companions). Link to comment Share on other sites More sharing options...
candlepin Posted April 4, 2017 Author Share Posted April 4, 2017 A little update on one of my scripts. I've changed tack on how I'm going to do my silence effect. I really liked the idea of changing the combat style of the NPC (and setting the player's magic & magic regen to 0), but that won't work. Well, I think it would work but with one main problem; Combat Styles are linked to ActorBase and not Actor. Thus if you change the combat style of one target, you'd be changing the Combat Style of all actors with that ActorBase. Obviously this makes my approach untenable, since if you're fighting two mages of the same type silencing one of them would silence both of them. So here is my Silence script for now. Any help, especially with figuring out what potion magnitude values are likely to be, would be appreciated. Scriptname CP_AlchSilence extends activemagiceffect {Temporarily reduces target's magicka and magicka regen to 0, thereby silencing them} Actor Property akTarget autoObjectReference Property PlayerRef autoFloat StartingMagickaFloat StartingMagickaRateBool AlreadySilenced = false Event OnEffectStart(Actor akCaster, Actor akTarget)Float Mag = Self.GetMagnitude()Float Chance = Utility.RandomFloat(0.0, 10.0) ; will need to change the 10.0 - still not sure how magnitude is calculatedIf Mag > Chance && AlreadySilenced == falseAlreadySilenced = trueStartingMagicka = akTarget.GetAV("Magicka")StartingMagickaRate = akTarget.GetAV("MagickaRate")akTarget.SetAV("Magicka", 0.0)akTarget.SetAV("MagickaRate", 0.0)RegisterForSingleUpdate(1)EndIfEndEvent Event OnUpdate()akTarget.SetAV("Magicka", 0.0)akTarget.SetAV("MagickaRate", 0.0)RegisterForSingleUpdate(1)EndEvent Event OnEffectFinish(Actor akCaster, Actor akTarget)akTarget.SetAV("Magicka", StartingMagicka)akTarget.SetAV("MagickaRate", StartingMagickaRate)EndEvent Link to comment Share on other sites More sharing options...
candlepin Posted April 6, 2017 Author Share Posted April 6, 2017 Any help with the Silence effect would be greatly appreciated. The above script compiles fine, but doesn't work in game, even when deleting the chance check (If Mag > Chance && AlreadySilenced == false, so this should happen 100& of the time). I even tried cranking up the update time to 0.1 but when I tried it against a weak fire mage my test character was still BBQ. The mage's magicka & magicka regen rate did not appear to be altered by the spell. I also checked to make sure the player's magicka & magicka regen rate were not altered; they were not. Oh, and I also tried ForceAV instead of SetAV, to no avail. Not sure why this doesn't seem to be working. Link to comment Share on other sites More sharing options...
candlepin Posted May 3, 2017 Author Share Posted May 3, 2017 Got many of my effects to work. I still need to go back and tweak some values, but they're working. The one effect that I'm still having trouble with is a blind effect. I have it working for NPCs but I'm having difficulty with custom Imods for when the player is binded. Is there a tutorial, post, or any advice someone can point me to for making a brand new Imod? Link to comment Share on other sites More sharing options...
candlepin Posted June 7, 2017 Author Share Posted June 7, 2017 More noobish questions :) I generally have the alchemy effects that I want working, and am now concentrating on getting the magnitudes and durations of the effects to be balanced (i.e. not batshit crazy). I'm specifically looking for advice on how to handle the magnitudes of my scripted effects. With SKSE I can use Self.GetMagnitude. I was hoping that would get the magnitude of the effect, factoring in perks, enchanted gear, etc. Unfortunately, this only returns the magnitude of the alchemy effect for this ingredient. Therefore, it seems I might have to calculate this in the script. The big problem with this: if this is calculated during the magic effect, it will check the alchemy level, enchanted gear, etc AT THE TIME OF USE. For a number of obvious reasons, I'd prefer that this be calculated at the time of potion creation. Can anyone help me out with this? Is there a way I could calculate this number, store it in some sort if array, and recall this number upon potion use? This seems extremely convoluted, but I can't think of anything else/better. Link to comment Share on other sites More sharing options...
candlepin Posted June 7, 2017 Author Share Posted June 7, 2017 Along the same lines, does anyone know how/where the magnitude or duration information for player-made potions is stored? Could I attach a script to alchemy tables which would allow for this information to be stored? Link to comment Share on other sites More sharing options...
Recommended Posts