How to check if NPC is hit with a healing spell?

Post » Sat Jul 20, 2013 11:14 pm

Hi all, I'm working on a part of my mod, where the player meets a dying NPC, and has the option to heal her.

I've given the NPC the following script, which obviously doesn't work. I've highlighted a section of the script with asterixes, as I'm unsure of the correct syntax to use. The asterixes aren't in the actual script, they're just there to point out the part I'm having trouble with.

What's supposed to happen, is script should check if a magic effect has been applied, then checks if the caster is the player. After that, it checks if the player's magic effect is the one previously declared as the property "danHealEffect" (a Healing Hands effect), and that's where I'm having trouble, as the CK wiki page for "OnMagicEffectApply" doesn't have information I need.

Scriptname danTaarumeHealScript extends actorGlobalVariable Property danTaarumeGlobal  AutoMagicEffect Property danHealEffect  Auto  Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)	if akCaster == game.getPlayer() 		if akEffect ==  ******danHealEffect()****** 			;do something 		endif 	endifEndEvent

Here's the error I get, as well:

So, what should I have written instead?

User avatar
Janeth Valenzuela Castelo
 
Posts: 3411
Joined: Wed Jun 21, 2006 3:03 am

Post » Sat Jul 20, 2013 8:50 pm

When you put parentheses after something, it thinks it is a function rather than a property/variable.

if akEffect == danHealEffect
User avatar
Cayal
 
Posts: 3398
Joined: Tue Jan 30, 2007 6:24 pm

Post » Sat Jul 20, 2013 9:48 pm

Oh, right.

Obviously.

Thanks, I guess it's a bad habit I've gotten into. Typing something in Papyrus? ADD BRACKETS! :P

User avatar
Jesus Duran
 
Posts: 3444
Joined: Wed Aug 15, 2007 12:16 am


Return to V - Skyrim