Page 1 of 1

Spell effect will only apply itself to NPC's and not player

PostPosted: Tue Feb 28, 2017 1:37 am
by Jinx Sykes

Hi again all ran into another weird issue. I have created a new helmet with a custom enchantment that adds a modified version of the soulcairn keeper black smoke and glowing eyes effect. The problem is the effect is applied just fine when a non player actor equips the helm but when the player equips the helm the effect is not applied.



screen shot: http://www.nexusmods.com/skyrim/Images/650296/?



The player is the one on the right.



I even tried adding the following script to the helm but still it would not apply the visual effect to the player. Does anyone know how to fix this???



Scriptname nightspawnhelmetscript extends ObjectReference

SPELL Property NSPWFX Auto

Event OnEquipped(Actor akActor)
If akActor == Game.GetPlayer()
Game.GetPlayer().addspell (NSPWFX)
EndIf
EndEvent

Event OnUnequipped(Actor akActor)
If akActor == Game.GetPlayer()
Game.GetPlayer().removespell (NSPWFX)
EndIf
EndEvent

Spell effect will only apply itself to NPC's and not player

PostPosted: Tue Feb 28, 2017 7:47 am
by Ernesto Salinas

There's no reason to call a game.getplayer() twice in a row, its a latent function;


http://www.creationkit.com/index.php?title=Category:Latent_Functions



i would also question the wisdom of even checking if the the akActor is the player, unless you only want the player to have the effect.



as for why the spell doesn't work, idk i dont work with spells very often. it might need to be an Ability, and make sure everything is pointing correctly in the spell > magicEffect ; i.e. like self firing, constant, script, etc., flags are ticked.



Scriptname nightspawnhelmetscript extends ObjectReference

SPELL Property NSPWFX Auto

Event OnEquipped(Actor akActor)
If akActor == Game.GetPlayer()
akActor.addspell (NSPWFX)
EndIf
EndEvent

Event OnUnequipped(Actor akActor)
If akActor == Game.GetPlayer()
akActor.removespell (NSPWFX)
EndIf
EndEvent

Spell effect will only apply itself to NPC's and not player

PostPosted: Mon Feb 27, 2017 10:37 pm
by Sharra Llenos

The script is not required I can get the magic effect to be applied to as many non player NPC's as i give helmets too (So I know the magic effect and the enchantment is set up properly and working as it should). The problem is for some reason the effect is not applied to the player when the helm is equipped on the player. I am pretty god at modding spells and magic effects and have never encountered this problem before. I am baffled. If it works on every NPC actor I try then there is no reason it should not work on the player too. Sigh, but such is the nature of the Creation Kit lol.


Spell effect will only apply itself to NPC's and not player

PostPosted: Tue Feb 28, 2017 1:13 am
by Dark Mogul


so you can apply the spell to npc's without a script, why would you add a script then to the player's helmet?



is this an enchantment on the helmet or a spell on the player / npc?


Spell effect will only apply itself to NPC's and not player

PostPosted: Mon Feb 27, 2017 7:21 pm
by Marcus Jordan

I added the script because the effect is not being applied to the player to see if it would work, but it didn't. Its a helmet enchantment using the magic effect "dlc01soulcairabkeeperheadwithhelmet" which I have modified to have red eyes instead of purple


Spell effect will only apply itself to NPC's and not player

PostPosted: Tue Feb 28, 2017 6:13 am
by Prohibited


you modified the base object in the game? why didn't you create a duplicate of the effect and then modify it?



it sounds like you may be having problems with the effect being baked into a save.



or something is overwriting it. something like this doesn't need a script, and especially not manually adding in a spell to the player. its something on your end either with the magic effect or using an object already baked into the save. you should always avoid changing or modifying base objects. if its a unique object, it should have its own record.