Add item on npc at spell cast

Post » Tue Jun 19, 2012 6:21 pm

Hi, I'm tryng to add an item in the target npc's inventory with a spell, then I added the script in the Magic Effect, using http://www.creationkit.com/OnEffectStart_-_ActiveMagicEffect and tryng to print a message box, but for arcane reason it doesn't work.. any ideas? Thanks.
User avatar
Dan Scott
 
Posts: 3373
Joined: Sun Nov 11, 2007 3:45 am

Post » Tue Jun 19, 2012 11:01 am

Nobody? );
User avatar
Georgine Lee
 
Posts: 3353
Joined: Wed Oct 04, 2006 11:50 am

Post » Tue Jun 19, 2012 2:27 pm

Could you add the script in your first post? Seeing it would help to figure out what it could be. Also any runtime errors you get if there is any.
User avatar
Captian Caveman
 
Posts: 3410
Joined: Thu Sep 20, 2007 5:36 am

Post » Tue Jun 19, 2012 11:51 am

Check it out
Event OnEffectStart(Actor akTarget, Actor akCaster)  Debug.Trace("Magic effect was started on " + akTarget)AkTarget.AddItem(anyarmor,1)endEventArmor property anyarmor auto
Also don't forget to add properties
User avatar
JERMAINE VIDAURRI
 
Posts: 3382
Joined: Tue Dec 04, 2007 9:06 am

Post » Tue Jun 19, 2012 5:53 pm

Check it out
Event OnEffectStart(Actor akTarget, Actor akCaster)  Debug.Trace("Magic effect was started on " + akTarget)AkTarget.AddItem(anyarmor,1)endEventArmor property anyarmor auto
Also don't forget to add properties

I used this script, but doesn't work. I tried to print a message box too, without success. I think I have to change something in the magic effect property, but I don't know what. What magic effect should I duplicate?
User avatar
Prue
 
Posts: 3425
Joined: Sun Feb 11, 2007 4:27 am

Post » Tue Jun 19, 2012 5:56 pm

You can't complie the script?
User avatar
Tania Bunic
 
Posts: 3392
Joined: Sun Jun 18, 2006 9:26 am

Post » Tue Jun 19, 2012 9:39 am

You can't complie the script?

I can compile it, but nothing happens in the game.
User avatar
gandalf
 
Posts: 3400
Joined: Wed Feb 21, 2007 6:57 pm

Post » Tue Jun 19, 2012 9:38 pm

Your script to hangs on a magic effect? Then this effect need to choice in spell
User avatar
Amy Gibson
 
Posts: 3540
Joined: Wed Oct 04, 2006 2:11 pm

Post » Tue Jun 19, 2012 1:42 pm

Your script to hangs on a magic effect? Then this effect need to choice in spell
I know and I did it, but nothing happens : /
User avatar
Stacyia
 
Posts: 3361
Joined: Mon Jul 24, 2006 12:48 am

Post » Tue Jun 19, 2012 7:18 am

Hmm...look maybe you did some mistake by the way did you add spell the player?
User avatar
Nikki Lawrence
 
Posts: 3317
Joined: Sat Jul 01, 2006 2:27 am

Post » Tue Jun 19, 2012 8:38 pm

Hmm...look maybe you did some mistake by the way did you add spell the player?

By spell book.
User avatar
City Swagga
 
Posts: 3498
Joined: Sat May 12, 2007 1:04 am

Post » Tue Jun 19, 2012 10:20 am

By spell book.
Was spell added the player? And know what? Try rename
Debug.MessageBox("Magic effect was started on " + akTarget)AkTarget.AddItem(anyarmor,1)
User avatar
Riky Carrasco
 
Posts: 3429
Joined: Tue Nov 06, 2007 12:17 am

Post » Tue Jun 19, 2012 7:42 am

Was spell added the player? And know what? Try rename
Debug.MessageBox("Magic effect was started on " + akTarget)AkTarget.AddItem(anyarmor,1)

I created a new spell with these passages:
-Duplicate reanimate and renominate.
-Duplicate main effect of reanimate and renominate.
-Opne reanimate main effect and replace old script with the new script.
-Link new effect to new spell.
And.. doesn't work xd
But, if I place the code into the script "SayTopicWhenReanimate..." it works : /
User avatar
Elina
 
Posts: 3411
Joined: Wed Jun 21, 2006 10:09 pm

Post » Tue Jun 19, 2012 6:38 am

Hmm...i don't any idea, try to take any magic effect and create a new script, only in script write only
Event OnEffectStart(Actor akTarget, Actor akCaster)  Debug.MessageBox("Magic effect was started on " + akTarget)endEvent
User avatar
Lizs
 
Posts: 3497
Joined: Mon Jul 17, 2006 11:45 pm

Post » Tue Jun 19, 2012 2:50 pm

Hmm...i don't any idea, try to take any magic effect and create a new script, only in script write only
Event OnEffectStart(Actor akTarget, Actor akCaster)  Debug.MessageBox("Magic effect was started on " + akTarget)endEvent

Guys, finally I solved it! The problem is in the script creation: When you create a script, there is a camp called Extends, of ObjectReference as default. For a spell, you have to replace it with activemagiceffect :D
I hope I was usefull, bb!
User avatar
Amelia Pritchard
 
Posts: 3445
Joined: Mon Jul 24, 2006 2:40 am


Return to V - Skyrim