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

Post » Tue Feb 28, 2017 1:37 am

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
User avatar
Jinx Sykes
 
Posts: 3501
Joined: Sat Jan 20, 2007 11:12 pm

Post » Tue Feb 28, 2017 7:47 am

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
User avatar
Ernesto Salinas
 
Posts: 3399
Joined: Sat Nov 03, 2007 2:19 pm

Post » Mon Feb 27, 2017 10:37 pm

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.

User avatar
Sharra Llenos
 
Posts: 3399
Joined: Wed Jan 17, 2007 1:09 pm

Post » Tue Feb 28, 2017 1:13 am


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?

User avatar
Dark Mogul
 
Posts: 3438
Joined: Tue Feb 20, 2007 11:51 am

Post » Mon Feb 27, 2017 7:21 pm

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

User avatar
Marcus Jordan
 
Posts: 3474
Joined: Fri Jun 29, 2007 1:16 am

Post » Tue Feb 28, 2017 6:13 am


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.

User avatar
Prohibited
 
Posts: 3293
Joined: Tue Jun 12, 2007 6:13 am


Return to V - Skyrim