Jump to content

[LE] Yet another script failing to compile.


Recommended Posts

Hi ho, hi ho, another script won't go. *whistles*

 

So I'm trying to compile a pretty basic transmutation spell that I frankenstein'd off of the Transmute Ore spell, everything seems to be working okay except the advanceskill command which I'm fairly certain I did right. Here's the code.

 

Scriptname SBTransmuteSoulgem01Script extends ActiveMagicEffect  

MiscObject Property SoulGemPiece001 Auto

MiscObject Property SoulGemPiece002 Auto

MiscObject Property SoulGemPiece003 Auto

MiscObject Property SoulGemPiece004 Auto

MiscObject Property SoulGemPiece005 Auto

MiscObject Property SBSoulGemShard Auto

Sound Property FailureSFX Auto

Float Property SkillAdvance = 5.0 Auto

EVENT OnEffectStart(Actor akTarget, Actor akCaster)
objectReference caster = akCaster
if caster.getItemCount(SoulGemPiece001) >= 1

caster.removeItem(SoulGemPiece001, 1, TRUE)
caster.addItem(SBSoulGemShard, 1, FALSE)
advanceSkill("conjuration",skillAdvancement)
elseif caster.getItemCount(SoulGemPiece002) >= 1

caster.removeItem(SoulGemPiece002, 1, TRUE)
caster.addItem(SBSoulGemShard, 1, FALSE)
advanceSkill("conjuration",skillAdvancement)

elseif caster.getItemCount(SoulGemPiece003) >= 1

caster.removeItem(SoulGemPiece003, 1, TRUE)
caster.addItem(SBSoulGemShard, 1, FALSE)
advanceSkill("conjuration",skillAdvancement)

elseif caster.getItemCount(SoulGemPiece004) >= 1

caster.removeItem(SoulGemPiece004, 1, TRUE)
caster.addItem(SBSoulGemShard, 1, FALSE)
advanceSkill("conjuration",skillAdvancement)

elseif caster.getItemCount(SoulGemPiece005) >= 1

caster.removeItem(SoulGemPiece005, 1, TRUE)
caster.addItem(SBSoulGemShard, 1, FALSE)
advanceSkill("conjuration",skillAdvancement)
else
; caster must have had no valid ore
FailureSFX.play(caster)
endif
endEVENT

 

and the errors I'm getting are

 

Starting 1 compile threads for 1 files...
Compiling "SBTransmuteSoulgem01Script"...
C:\Games\Steam\steamapps\common\Skyrim\Data\Scripts\Source\temp\SBTransmuteSoulgem01Script.psc(25,29): variable skillAdvancement is undefined
C:\Games\Steam\steamapps\common\Skyrim\Data\Scripts\Source\temp\SBTransmuteSoulgem01Script.psc(25,2): advanceSkill is not a function or does not exist
C:\Games\Steam\steamapps\common\Skyrim\Data\Scripts\Source\temp\SBTransmuteSoulgem01Script.psc(30,29): variable skillAdvancement is undefined
C:\Games\Steam\steamapps\common\Skyrim\Data\Scripts\Source\temp\SBTransmuteSoulgem01Script.psc(30,2): advanceSkill is not a function or does not exist
C:\Games\Steam\steamapps\common\Skyrim\Data\Scripts\Source\temp\SBTransmuteSoulgem01Script.psc(36,29): variable skillAdvancement is undefined
C:\Games\Steam\steamapps\common\Skyrim\Data\Scripts\Source\temp\SBTransmuteSoulgem01Script.psc(36,2): advanceSkill is not a function or does not exist
C:\Games\Steam\steamapps\common\Skyrim\Data\Scripts\Source\temp\SBTransmuteSoulgem01Script.psc(42,29): variable skillAdvancement is undefined
C:\Games\Steam\steamapps\common\Skyrim\Data\Scripts\Source\temp\SBTransmuteSoulgem01Script.psc(42,2): advanceSkill is not a function or does not exist
C:\Games\Steam\steamapps\common\Skyrim\Data\Scripts\Source\temp\SBTransmuteSoulgem01Script.psc(48,29): variable skillAdvancement is undefined
C:\Games\Steam\steamapps\common\Skyrim\Data\Scripts\Source\temp\SBTransmuteSoulgem01Script.psc(48,2): advanceSkill is not a function or does not exist
No output generated for SBTransmuteSoulgem01Script, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on SBTransmuteSoulgem01Script

 

Plz help and I'll name an axe after you.

Link to comment
Share on other sites

Works like a charm, thanks for pointing it out, what type of axe do you want to be and what do you want it to be called, Levionte? I was thinking Ebony war axe with increased critical chance with a shock/soultrap enchantment tucked away in a cave somewhere.
Link to comment
Share on other sites

Minor point I'd like to add is that the following line is unnecessary:

objectReference caster = akCaster

akCaster is an Actor, which extends ObjectReference (which in turn extends Form), and as such any non-global ObjectReference (and Form) functions can be called on an instance of Actor. akCaster can also be passed as an argument to a function instead of using an explicitly declared ObjectReference variable as an intermediary. Not crucial to the functionality of this script, but a useful technical aspect of the language to know.

Edited by mrpwn
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...