Casting a spell on palyer.

Post » Mon Jun 18, 2012 10:59 am

My script runs, but no spell is cast and im not sure why :/

Scriptname MyScript extends ObjectReference ConditionalSpell Property MySpell Auto    EVENT onInit()					   ; This event will run once, when the script is initialized        Debug.MessageBox("Script Started!")   	 MySpell.Cast(Game.GetPlayer(), Game.GetPlayer())        registerForUpdate(5)        gotoState ("polling")    endEVENT

I get the "Script Started" Message, but no spell! :( :( Any ideas?
The spell is actually an Ability that should only last 3 mins (I dont think it ever expires but thats another problem) I need it to be reapplied when the script runs again...
User avatar
Jenna Fields
 
Posts: 3396
Joined: Mon Dec 11, 2006 11:36 am

Post » Mon Jun 18, 2012 5:27 pm

Is http://www.creationkit.com/Cast_-_Spell appropriate for abilities? Perhaps you could try using http://www.creationkit.com/AddSpell_-_Actor instead.

Just a guess - I'd have tried Cast first.

Cipscis
User avatar
clelia vega
 
Posts: 3433
Joined: Wed Mar 21, 2007 6:04 pm

Post » Mon Jun 18, 2012 11:58 am

Game.GetPlayer().AddSpell(MySpell)

Give that a whirl, instead of MySpell.Cast()
User avatar
Baby K(:
 
Posts: 3395
Joined: Thu Nov 09, 2006 9:07 pm

Post » Mon Jun 18, 2012 4:51 pm

AddSpell also doesnt work. I even tried RemoveSpell to remove the ability that I have initially, and it doesnt work. :/
User avatar
Cameron Garrod
 
Posts: 3427
Joined: Sat Jun 30, 2007 7:46 am

Post » Tue Jun 19, 2012 2:34 am

Just to make doubly sure - your property has been associated with your ability correctly?

Cipscis
User avatar
Robert Jackson
 
Posts: 3385
Joined: Tue Nov 20, 2007 12:39 am

Post » Mon Jun 18, 2012 9:45 pm

The script is exactly like above, I have "Spell Property MySpell Auto"
Should I set it some other way?
User avatar
gemma king
 
Posts: 3523
Joined: Fri Feb 09, 2007 12:11 pm

Post » Mon Jun 18, 2012 10:49 pm

You also need to associate your property with a form in the Creation Kit. Open up the dialogue window for the object with your script attached to it, right click on your script in the scripts section, and select "Edit Properties".

Cipscis
User avatar
Sophie Payne
 
Posts: 3377
Joined: Thu Dec 07, 2006 6:49 am

Post » Mon Jun 18, 2012 11:04 pm

Oh I didnt have the propery set, but even setting the spell to my MySpell, still no casting :x
User avatar
Klaire
 
Posts: 3405
Joined: Wed Sep 27, 2006 7:56 am

Post » Mon Jun 18, 2012 11:45 am

What do you have this script attached to?
User avatar
electro_fantics
 
Posts: 3448
Joined: Fri Mar 30, 2007 11:50 pm

Post » Mon Jun 18, 2012 8:51 pm

An item I add to an NPC after it dies. I tried adding a vanilla spell to no avail as well.
I got the spell to fire!! I think I needed to change it from Constant effect to Fire and Forget.

Except now my problem is the duration does not expire, even though its not constant effect...
User avatar
bimsy
 
Posts: 3541
Joined: Wed Oct 11, 2006 3:04 pm

Post » Tue Jun 19, 2012 1:07 am

Good to hear you got it working!

Did you set a duration on the effect when you added it to the spell?
User avatar
Katy Hogben
 
Posts: 3457
Joined: Mon Oct 30, 2006 12:20 am

Post » Mon Jun 18, 2012 5:37 pm

Yeah, which is odd. It says in my in game UI the ability lasts 5 seconds, but it never counts down and I never lose the effect. Its not because the spell keeps getting added either because a message box pops up for my to hit OK when that happens.

Hmm..

Got it working!!!!! Thanks guys for your help!!! It needed to be a SPELL not an Ability.
User avatar
Alexandra Louise Taylor
 
Posts: 3449
Joined: Mon Aug 07, 2006 1:48 pm


Return to V - Skyrim