variable is undefined - adding an ability to player

Post » Thu Jun 04, 2015 5:05 pm

Hello everyone,

I am making a creature follower, that when following the player grants a "buff" to the player. For example; Flame atronach becomes a follower, player gets a resist fire ability.

I have the creature set up, I have the ability set up.

However when I compile my scripts I get a "variable [spell name] is undefined" How do I solve this?

Here is the script that fires when dismissed (i.e removes the spell.)

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 0Scriptname AstraDismiss Extends TopicInfo Hidden;PROPERTYQuest Property pDialogueFollower  Auto;FUNCTIONFunction Fragment_0(ObjectReference akSpeakerRef)	Actor akSpeaker = akSpeakerRef as Actor	(pDialogueFollower as DialogueFollowerScript).DismissAnimal()       game.getplayer().removespell(Astra_ab)EndFunction;END FRAGMENT CODE - Do not edit anything between this and the begin comment
User avatar
Natalie J Webster
 
Posts: 3488
Joined: Tue Jul 25, 2006 1:35 pm

Post » Thu Jun 04, 2015 1:36 pm

The script sees "Astra_ab" and has no idea what it is. Go the the script tab in the Quest, and select the script which contains that fragment. Click the script and then click property. Add a "Spell" property to Astra_ab. Make sure you fill the property (auto-fill works if "Astra_ab" is the same name as your spell).

User avatar
Poetic Vice
 
Posts: 3440
Joined: Wed Oct 31, 2007 8:19 pm

Post » Thu Jun 04, 2015 8:53 am

Thats great its worked for the "dismiss" part, i.e the remove spell.

BUT now I am making the "follow" part and adding the property -> spell ->astra_ab and its throwing this at me:

EDIT: posted the wrong error. This is the one I am getting:

Starting 1 compile threads for 1 files...Compiling "Astra_follow"...C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\Astra_follow.psc(10,43): missing RPAREN at '\\r\\n'No output generated for Astra_follow, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on Astra_follow

Here is my script:

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 0Scriptname Astra_follow Extends TopicInfo Hidden;FUNCTIONFunction Fragment_0(ObjectReference akSpeakerRef)	Actor akSpeaker = akSpeakerRef as Actor	(GetOwningQuest() as DialogueFollowerScript).AnimalFollow()       (Game.GetPlayer().AddSpell(Astra_ab)EndFunction;END FRAGMENT CODE - Do not edit anything between this and the begin comment

EDIT again:

ODD. I clicked ok through it all. Then re-opened the window. Everything is fine. Very strange.

User avatar
kevin ball
 
Posts: 3399
Joined: Fri Jun 08, 2007 10:02 pm

Post » Thu Jun 04, 2015 6:55 pm

missing RPAREN (right parentheses, parenthesis?)

Looks like here you don't need that first left "(" before Game

(Game.GetPlayer().AddSpell(Astra_ab)
User avatar
Emzy Baby!
 
Posts: 3416
Joined: Wed Oct 18, 2006 5:02 pm

Post » Thu Jun 04, 2015 9:02 pm

Ahhh. Ok so I have fixed that but still getting an undefined error. I have put it in the properties like the other one you suggested above.

User avatar
sally coker
 
Posts: 3349
Joined: Wed Jul 26, 2006 7:51 pm

Post » Thu Jun 04, 2015 8:44 pm

The error tells you which line it's on.

User avatar
Sun of Sammy
 
Posts: 3442
Joined: Mon Oct 22, 2007 3:38 pm

Post » Thu Jun 04, 2015 8:28 am

This is my current error for the follow command:

Starting 1 compile threads for 1 files...Compiling "Astra_follow"...C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\Astra_follow.psc(10,33): variable Astra_ab is undefinedNo output generated for Astra_follow, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on Astra_follow
User avatar
Taylor Tifany
 
Posts: 3555
Joined: Sun Jun 25, 2006 7:22 am

Post » Thu Jun 04, 2015 9:08 pm

It's telling you that there's something wrong on line 10(the(10,33) is where it tells you), the variable Astra_ab hasn't been defined. There are a lot of good tutorials you can read on cipscis.com

You need to declare the spell you're trying to add with:

Spell Property Astra_ab Auto

Edit:Mojo already said to do that lol..did you?

User avatar
[Bounty][Ben]
 
Posts: 3352
Joined: Mon Jul 30, 2007 2:11 pm


Return to V - Skyrim