Simple Script Assistance

Post » Sun Nov 18, 2012 2:05 pm

Ahoy

As part of a dungeon making a unique weapon with a special power attached to it.

Simple script yet it won't work, not sure why, hoping you could help.

Scriptname ilsebonecallerabilityscript extends ObjectReference  {Spell Property 0ilseBonecallerAbility autoEvent OnEquipped(Actor akActor)	if (akActor == Game.GetPlayer())		Game.GetPlayer().AddSpell(0ilseBonecallerAbility)	endifEndEventEvent OnUnEquipped(Actor akActor)	if (akActor == Game.GetPlayer())		Game.GetPlayer().RemoveSpell(0ilseBonecallerAbility)	endifEndEvent}

Its super simple, I am not sure why it wouldn't be working, *shrug*
User avatar
Laura Cartwright
 
Posts: 3483
Joined: Mon Sep 25, 2006 6:12 pm

Post » Mon Nov 19, 2012 1:02 am

Try removing " } " from the end of the script.
User avatar
Brandi Norton
 
Posts: 3334
Joined: Fri Feb 09, 2007 9:24 pm

Post » Sun Nov 18, 2012 9:11 pm

Try removing " } " from the end of the script.

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

Post » Sun Nov 18, 2012 8:00 pm

...and the '{' from the beginning.
User avatar
Bonnie Clyde
 
Posts: 3409
Joined: Thu Jun 22, 2006 10:02 pm

Post » Sun Nov 18, 2012 11:37 pm

...and the '{' from the beginning.

I did that as well, and again, returned a compilation error.
User avatar
Lawrence Armijo
 
Posts: 3446
Joined: Thu Sep 27, 2007 7:12 pm

Post » Sun Nov 18, 2012 11:52 am

You can't name properties/variable with digits as the first character, so kill the '0'. http://www.creationkit.com/Identifier_Reference

ScriptName ilsebonecallerabilityscript Extends ObjectReference  Actor Property PlayerREF Auto ; 1,000 time faster than Game.GetPlayer(), literallySpell Property IlseBonecallerAbility AutoEvent OnEquipped(Actor akActor)	If akActor == PlayerREF		PlayerREF.AddSpell(IlseBonecallerAbility)	endifEndEventEvent OnUnEquipped(Actor akActor)	If akActor == PlayerREF		PlayerREF.RemoveSpell(IlseBonecallerAbility)	EndIfEndEvent
User avatar
Emily Jones
 
Posts: 3425
Joined: Mon Jul 17, 2006 3:33 pm

Post » Sun Nov 18, 2012 1:41 pm

Hm, well I made the changes and it still doesn't work, also not using brackets to organize things will drive me crazy >.>
User avatar
Sun of Sammy
 
Posts: 3442
Joined: Mon Oct 22, 2007 3:38 pm

Post » Sun Nov 18, 2012 6:20 pm

Hmmm... What I posted compiles. Post the current version? Brackets are for comments in Papyrus, so...
User avatar
Rob Smith
 
Posts: 3424
Joined: Wed Oct 03, 2007 5:30 pm

Post » Sun Nov 18, 2012 12:29 pm

Hmmm... What I posted compiles. Post the current version?

Oh the version you posted compiles fine, it simply doesn't work >.<

Sorry I should have been more specific.
User avatar
Jessica Colville
 
Posts: 3349
Joined: Wed Oct 18, 2006 6:53 pm

Post » Sun Nov 18, 2012 11:39 am

Make sure, in the object which the script is attached to's scripts window, that the properties are filled. You'll have to remove the '0' from the EditorID of your spell too that it's name will match the property name or it won't auto-fill.
User avatar
Fam Mughal
 
Posts: 3468
Joined: Sat May 26, 2007 3:18 am

Post » Sun Nov 18, 2012 12:45 pm

Make sure, in the object which the script is attached to's scripts window, that the properties are filled. You'll have to remove the '0' from the EditorID of your spell too that it's name will match the property name or it won't auto-fill.
Yeah I had already done that, still no such luck, irritating >.<
User avatar
Lizzie
 
Posts: 3476
Joined: Sun Nov 19, 2006 5:51 am

Post » Sun Nov 18, 2012 8:55 pm

ScriptName ilsebonecallerabilityscript Extends ObjectReference  Actor Property PlayerREF Auto ; 1,000 time faster than Game.GetPlayer(), literallySpell Property IlseBonecallerAbility AutoEvent OnEquipped(Actor akActor)        If akActor == PlayerREF               Debug.Notification("OnEquipped")                PlayerREF.AddSpell(IlseBonecallerAbility)        endifEndEventEvent OnUnequipped(Actor akActor)        If akActor == PlayerREF                Debug.Notification("OnUnequipped")                PlayerREF.RemoveSpell(IlseBonecallerAbility)        EndIfEndEvent
Check to see if the notifications show? This is attached to an apparel item?
User avatar
Tinkerbells
 
Posts: 3432
Joined: Sat Jun 24, 2006 10:22 pm

Post » Sun Nov 18, 2012 3:30 pm

ScriptName ilsebonecallerabilityscript Extends ObjectReference  Actor Property PlayerREF Auto ; 1,000 time faster than Game.GetPlayer(), literallySpell Property IlseBonecallerAbility AutoEvent OnEquipped(Actor akActor)		If akActor == PlayerREF			   Debug.Notification("OnEquipped")				PlayerREF.AddSpell(IlseBonecallerAbility)		endifEndEventEvent OnUnequipped(Actor akActor)		If akActor == PlayerREF				Debug.Notification("OnUnequipped")				PlayerREF.RemoveSpell(IlseBonecallerAbility)		EndIfEndEvent
Check to see if the notifications show? This is attached to an apparel item?

its attached to a weapon, i'll test the debugs, but I am fairly sure its the scripting not the spell (already tried substituting it for a vanilla ability)
User avatar
Dan Endacott
 
Posts: 3419
Joined: Fri Jul 06, 2007 9:12 am

Post » Sun Nov 18, 2012 4:32 pm

notifications didn't show blargh
User avatar
Paula Ramos
 
Posts: 3384
Joined: Sun Jul 16, 2006 5:43 am

Post » Sun Nov 18, 2012 2:03 pm

Hmmm... Remove the script from the weapon and reattach it, then refill the properties making sure they're pointed where they ought to be. Both should auto-fill if you've removed the 0 from the spell's Editor ID.
User avatar
Chloe Yarnall
 
Posts: 3461
Joined: Sun Oct 08, 2006 3:26 am

Post » Sun Nov 18, 2012 4:10 pm

Look at your properties. You're treating PlayerREF as an Actor. If you want to use a Quest alias, use ReferenceAlias; it's more reliable and good practice.
User avatar
Add Me
 
Posts: 3486
Joined: Thu Jul 05, 2007 8:21 am

Post » Sun Nov 18, 2012 2:12 pm

After doing that it started working, strange why it didn't work before, but whatever, it works now, and that is what matters.

Now I just have to deal with the fact that the player can simply unequip and re-equip to reuse the ability over and over...*sigh* but the scripting issue is over and done with that's what is important.
User avatar
Hazel Sian ogden
 
Posts: 3425
Joined: Tue Jul 04, 2006 7:10 am

Post » Sun Nov 18, 2012 11:52 am

Look at your properties. You're treating PlayerREF as an Actor. If you want to use a Quest alias, use ReferenceAlias; it's more reliable and good practice.
PlayerREF is an Actor... As JustinOther mentioned in the comment in his code, that is the most efficient way of referring directly to the player. There's no reason to use a ReferenceAlias for it here if you mean to always refer to the player.

Cipscis
User avatar
Ben sutton
 
Posts: 3427
Joined: Sun Jun 10, 2007 4:01 am


Return to V - Skyrim