Jump to content

Help resetting/stopping a visual Fx


donnyducky

Recommended Posts

Hi - I'm very new to papyrus scripting and have been looking at tutorials and reverse engineering scripts that interested me. So, I'm trying, but have a long way to go. I'm wondering if I can get some help with the following:

 

Basically, I'm trying to attach a script to a Magic Effect that will remove a couple of very specific visual effects if they appear on the PC Actor. This would be a spell the player would cast on themselfs to get rid of the Fx. I'm thinking this should be simple, but I can't get it to work. I've listed my script here, it compiles and in game I can cast the spell it is attached to, but it doesn't do anything - ha.

 

 

Scriptname EpicElfRemoveLeaves extends VisualEffect
VisualEffect Property ElfFXSprigganAttachmentsMatronEffect Auto
VisualEffect Property ElfFXSprigganFX01Effect Auto
VisualEffect Property ElfFXSpriggenSwarmEffect Auto
ObjectReference Property EpicElfGetPlayer Auto
Function ResetVisuals(int switch) ; - switch: 0 all, 1 FX, 2 other
if (switch == 1) || (switch == 0)
ElfFXSprigganAttachmentsMatronEffect.Stop(EpicElfGetPlayer)
ElfFXSprigganFX01Effect.Stop(EpicElfGetPlayer)
ElfFXSpriggenSwarmEffect.Stop(EpicElfGetPlayer)
endif
if (switch == 2) || (switch == 0)
ElfFXSprigganAttachmentsMatronEffect.Stop(EpicElfGetPlayer)
ElfFXSprigganFX01Effect.Stop(EpicElfGetPlayer)
ElfFXSpriggenSwarmEffect.Stop(EpicElfGetPlayer)
endif
endfunction
Edited by donnyducky
Link to comment
Share on other sites

Those don't appear to be actual magic effects. In the creation kit, I only see abFXSprigganMatron and SprigganMatronBugDamageConcAimed when I search for "SprigganMatron."

 

Also, I think the way to go is to use actor.removespell to rmove the associated spell, which will also remove the effect.

 

Before you remove the spell, you can use Actor.HasMagicEffect(MagicEffect akEffect) to check to see if they have each effect you want to remove before calling RemoveSpell.

Link to comment
Share on other sites

I know it seems strange at first, but spells are used to apply all sorts of visual effects in this game. The spell applies a magic effect, and the magic effect applies the visual effect. I'm pretty sure the mods Wet and Cold and GetSnowy use this method to apply a visual snow effect to the player. They are actually applying a spell, that in turn applies a magic effect, that in turn applies a visual effect. Hope this helps.

Link to comment
Share on other sites

thanks for this input


I'll give your suggestion a shot, - and it also has me thinking - perhaps if the script gives the PC a spell with the Fx attached, then makes the PC cast the spell, then removes the spell - perhaps this will be a fix

 

here's some additional infos
- these FXSprigganFX01Effect, etc. are objects in the Visual Effects property type, so they don't pull up specifically in ck, this explains to me why I can't use simple console command to address it

- The PC has no spell that they know creating this issue

Here's how this anomoly plays out
- PC comes into contact with an NPC or creature with a Visual Effect on it
- PC catches the visual Fx

its some kinda Skyrim bug, I think - I have a NPC follower that has a Visual Fx attached to her constantly via a spell that she knows, it is supposed to be there - NPCs and PC constantly come into contact with her and never 'catch' the Fx - but occassionally the PC or another follower NPC witll 'catch' the Fx (about 0.6% occurance accross all people's games - you seem to either have this issue or you never have this issue ever)

So the Fx isn't from a spell - but I might be able to use a spell to fix it - let me try this and i'll report back

Edited by donnyducky
Link to comment
Share on other sites

It doesn't really have anything to do with an actor having learned a spell. Spells are used a lot on the back in in Skyrim to apply magic effects. I know it is confusing at first.

ok - i'm getting it

 

- so now I'm thinking a script that applies a magic effect with the unwanted Visual Effect attached to it, but in the script have a line then to end the Visual, i.e. take control of the obnoxious fx and end it

Edited by donnyducky
Link to comment
Share on other sites

Oh thank you again! I've checked into the mod and also PMed the develper - I see my error. the .stop command gets this done, but I'd made a mistake in using it - I need to redo this tomorrow and will post up the final script.

Edited by donnyducky
Link to comment
Share on other sites

I was not able to attach this to a Magic Effect, so I still needs some pointers on how to do that if possible, but here is a workaround solution that at least addresses this issue for my mod players - this does remove the Fx anomoly from the PC



ElfFXSprigganAttachmentsMatronEffect points to Visual Effect Object FXSprigganAttachmentsMatronEffect

ElfFXSprigganFX01Effect points to Visual Effect Object FXSprigganFX01Effect

ElfFXSpriggenSwarmEffect points to Visual Effect Object FXSpriggenSwarmEffect




Scriptname EpicElf00InitMessage extends Quest

{Event OnInit()

ElfFXSprigganFX01Effect.stop(Game.GetPlayer())

endEvent}


VisualEffect Property ElfFXSprigganFX01Effect Auto


VisualEffect Property ElfFXSpriggenSwarmEffect Auto


VisualEffect Property ElfFXSprigganAttachmentsMatronEffect Auto


Event OnInit()

ElfFXSprigganAttachmentsMatronEffect.stop(Game.GetPlayer())

ElfFXSprigganFX01Effect.stop(Game.GetPlayer())

ElfFXSpriggenSwarmEffect.stop(Game.GetPlayer())

Debug.Notification( "Effect Removed. Save your game and remove this mod. ")

endEvent


Ok so this works. But I need to be able to apply this same thing to NPC actors. So I'm asking for some more help.


What event command will perform something similar when it is attached to a Magic Effect? I need a Self Magic Effect that does this to the PC Actor. Plus, I need an Aimed Magic Effect that does it to a target NPC Actor. I know there must be a simple way to do this, but I am at a loss at this point. I've tried a few things, like my initial post, they will compile, but end up doing nothing


Any help is appreciated - thank you
Edited by donnyducky
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...