Jump to content
Heavy Traffic ×

Recommended Posts

Hi ! I have a problem with compiling scripts. I'm using the CK built in compiler, and having a hard time resolving this issue. I would appreciate some help. I have 2 scripts which I wanted to update.

 

Here is the code of the first script :

Scriptname addRemoveSpells extends ObjectReference  

Event OnEquipped(Actor akActor)
  if akActor == Game.GetPlayer()
	if Game.GetPlayer().HasSpell(WandAbilityWardObj)==false
		Game.GetPlayer().AddSpell(WandAbilityWardObj, false)
		Game.GetPlayer().AddSpell(WandSpellFireObj, false)
		Game.GetPlayer().AddSpell(WandSpellIceObj, false)
		Game.GetPlayer().AddSpell(WandSpellLightningObj, false)
		Game.GetPlayer().AddSpell(WandSpellAvadaObj, false)
	endIf
  endIf
endEvent

Event OnUnequipped(Actor akActor)
  if akActor == Game.GetPlayer()
	 if Game.GetPlayer().GetEquippedWeapon()!=wand && Game.GetPlayer().GetEquippedWeapon(true)!=wand
		Game.GetPlayer().RemoveSpell(WandAbilityWardObj)
		Game.GetPlayer().RemoveSpell(WandSpellFireObj)
		Game.GetPlayer().RemoveSpell(WandSpellIceObj)
		Game.GetPlayer().RemoveSpell(WandSpellLightningObj)
		Game.GetPlayer().RemoveSpell(WandSpellAvadaObj)
	endIf
  endIf
endEvent

SPELL Property WandAbilityWardObj  Auto  

SPELL Property WandSpellFireObj  Auto  

SPELL Property WandSpellIceObj  Auto  

SPELL Property WandSpellLightningObj  Auto

SPELL Property WandSpellAvadaObj  Auto

WEAPON Property wand  Auto  

And here is the code for the second script :

Scriptname fireSpell extends Form

Event OnInit()
	RegisterForActorAction(0)
EndEvent

Event OnActorAction(int actionType, Actor akActor, Form source, int slot)
		if source==wand
				if (Game.GetPlayer().GetEquippedSpell(2)==WandSpellFireObj &&  Game.GetPlayer().GetActorValue("magicka")>=fireboltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
					fireboltSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
					Game.GetPlayer().DamageActorValue("Magicka", fireboltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)

				elseif (Game.GetPlayer().GetEquippedSpell(2)==WandSpellIceObj &&  Game.GetPlayer().GetActorValue("magicka")>=iceSpikeSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
					iceSpikeSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
					Game.GetPlayer().DamageActorValue("Magicka", iceSpikeSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
				
				elseif (Game.GetPlayer().GetEquippedSpell(2)==WandSpellLightningObj &&  Game.GetPlayer().GetActorValue("magicka")>=lightningBoltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
					lightningBoltSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
					Game.GetPlayer().DamageActorValue("Magicka", lightningBoltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
					
				elseif (Game.GetPlayer().GetEquippedSpell(2)==WandSpellAvadaObj &&  Game.GetPlayer().GetActorValue("magicka")>=killingavadaSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
					killingavadaSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
					Game.GetPlayer().DamageActorValue("Magicka", killingavadaSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
				

				elseif (Game.GetPlayer().GetEquippedSpell(2)!=WandSpellAvadaObj && (Game.GetPlayer().GetEquippedSpell(2)!=WandSpellLightningObj && Game.GetPlayer().GetEquippedSpell(2)!=WandSpellIceObj && Game.GetPlayer().GetEquippedSpell(2)!=WandSpellFireObj)
					Debug.MessageBox("Focus on a spell!")
				endIf
		endIf
EndEvent

WEAPON Property wand  Auto  

SPELL Property WandSpellFireObj  Auto  

SPELL Property fireboltSpell  Auto  

SPELL Property iceSpikeSpell  Auto  

SPELL Property WandSpellIceObj  Auto  

SPELL Property lightningBoltSpell  Auto  

SPELL Property WandSpellLightningObj  Auto

SPELL Property killingavadaSpell  Auto

SPELL Property WandSpellAvadaObj  Auto

SPELL Property WandAbilityWardObj  Auto  

Now the thing is, that I can't compile them for some reason I don't understand. There is also a thing I forgot to mention before. The only lines I have added to the scripts are the ones dealing with WandSpellAvadaObj and killingavadaSpell. This means, that before I added the avada stuff to the script, it was already compiled and working. That's why I don't get it why it won't compile it. The IDs of the added spells ( WandSpellAvada and killingavada) are correct, they exists. I'm gonna post the error the CK gave me so maybe someone can understand it better and will be able to help me.

 

So here is the error for the first script :

Starting 1 compile threads for 1 files...
Compiling "fireSpell"...
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\fireSpell.psc(26,247): missing RPAREN at '\\r\\n'
No output generated for fireSpell.psc, compilation failed.

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

And for the second script :

Starting 1 compile threads for 1 files...
Compiling "addRemoveSpells"...
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(0,0): unable to locate script ObjectReference
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(3,23): unknown type actor
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(4,16): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(4,21): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(5,4): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(5,9): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(5,21): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(5,49): cannot compare a none to a bool (cast missing or types unrelated)
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(6,2): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(6,7): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(6,19): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(7,2): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(7,7): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(7,19): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(8,2): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(8,7): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(8,19): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(9,2): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(9,7): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(9,19): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(10,2): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(10,7): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(10,19): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(15,25): unknown type actor
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(16,16): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(16,21): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(17,5): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(17,10): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(17,22): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(17,51): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(17,56): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(17,68): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(18,2): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(18,7): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(18,19): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(19,2): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(19,7): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(19,19): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(20,2): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(20,7): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(20,19): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(21,2): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(21,7): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(21,19): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(22,2): variable Game is undefined
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(22,7): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(22,19): none is not a known user-defined type
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(27,15): unknown type spell
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(29,15): unknown type spell
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(31,15): unknown type spell
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(33,15): unknown type spell
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(35,15): unknown type spell
C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\addRemoveSpells.psc(37,16): unknown type weapon
No output generated for addRemoveSpells.psc, compilation failed.

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

Please help me guys I would really appreciate it.

Link to comment
Share on other sites

#1 ---------------------------------------------------------------------

 

Scriptname addRemoveSpells extends ObjectReference
SPELL Property WandAbilityWardObj Auto
SPELL Property WandSpellFireObj Auto
SPELL Property WandSpellIceObj Auto
SPELL Property WandSpellLightningObj Auto
SPELL Property WandSpellAvadaObj Auto
WEAPON Property wand Auto
Event OnEquipped(Actor akActor)
if akActor == Game.GetPlayer()
if Game.GetPlayer().HasSpell(WandAbilityWardObj)==false
Game.GetPlayer().AddSpell(WandAbilityWardObj, false)
Game.GetPlayer().AddSpell(WandSpellFireObj, false)
Game.GetPlayer().AddSpell(WandSpellIceObj, false)
Game.GetPlayer().AddSpell(WandSpellLightningObj, false)
Game.GetPlayer().AddSpell(WandSpellAvadaObj, false)
endIf
endIf
endEvent
Event OnUnequipped(Actor akActor)
if akActor == Game.GetPlayer()
if Game.GetPlayer().GetEquippedWeapon()!=wand && Game.GetPlayer().GetEquippedWeapon(true)!=wand
Game.GetPlayer().RemoveSpell(WandAbilityWardObj)
Game.GetPlayer().RemoveSpell(WandSpellFireObj)
Game.GetPlayer().RemoveSpell(WandSpellIceObj)
Game.GetPlayer().RemoveSpell(WandSpellLightningObj)
Game.GetPlayer().RemoveSpell(WandSpellAvadaObj)
endIf
endIf
endEvent

 

#2 ---------------------------------------------------------------------

 

Scriptname fireSpell extends Form
WEAPON Property wand Auto
SPELL Property WandSpellFireObj Auto
SPELL Property fireboltSpell Auto
SPELL Property iceSpikeSpell Auto
SPELL Property WandSpellIceObj Auto
SPELL Property lightningBoltSpell Auto
SPELL Property WandSpellLightningObj Auto
SPELL Property killingavadaSpell Auto
SPELL Property WandSpellAvadaObj Auto
SPELL Property WandAbilityWardObj Auto
Event OnInit()
RegisterForActorAction(0)
EndEvent
Event OnActorAction(int actionType, Actor akActor, Form source, int slot)
if source==wand
if (Game.GetPlayer().GetEquippedSpell(2)==WandSpellFireObj && Game.GetPlayer().GetActorValue("magicka")>=fireboltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
fireboltSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
Game.GetPlayer().DamageActorValue("Magicka", fireboltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
elseif (Game.GetPlayer().GetEquippedSpell(2)==WandSpellIceObj && Game.GetPlayer().GetActorValue("magicka")>=iceSpikeSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
iceSpikeSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
Game.GetPlayer().DamageActorValue("Magicka", iceSpikeSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
elseif (Game.GetPlayer().GetEquippedSpell(2)==WandSpellLightningObj && Game.GetPlayer().GetActorValue("magicka")>=lightningBoltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
lightningBoltSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
Game.GetPlayer().DamageActorValue("Magicka", lightningBoltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
elseif (Game.GetPlayer().GetEquippedSpell(2)==WandSpellAvadaObj && Game.GetPlayer().GetActorValue("magicka")>=killingavadaSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
killingavadaSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
Game.GetPlayer().DamageActorValue("Magicka", killingavadaSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
elseif (Game.GetPlayer().GetEquippedSpell(2)!=WandSpellAvadaObj && Game.GetPlayer().GetEquippedSpell(2)!=WandSpellLightningObj && Game.GetPlayer().GetEquippedSpell(2)!=WandSpellIceObj && Game.GetPlayer().GetEquippedSpell(2)!=WandSpellFireObj)
Debug.MessageBox("Focus on a spell!")
endIf
endIf
EndEvent
Edited by NexusComa
Link to comment
Share on other sites

You really only had 1 error other then putting the Property's in the wrong area ...

 

elseif (Game.GetPlayer().GetEquippedSpell(2)!=WandSpellAvadaObj && (Game.GetPlayer().GetEquippedSpell(2)!=WandSpellLightningObj && Game.GetPlayer().GetEquippedSpell(2)!=WandSpellIceObj && Game.GetPlayer().GetEquippedSpell(2)!=WandSpellFireObj)

right here .................^

 

This is how I would have done the 2nd one. (because I personally hate && && &&'s)

Also I hate to indent like that when I'm coding. If you like you can do that after. It's just to make it easier to read (or so they say, I personally don't think so)

In this case all that indenting and using && && &&'s made a very simple error almost impossible to see. (I like to be able to see my code "chunks" with no run over)

The codes you wright for Skyrim are relatively short as far as codes go. When you get many pages of code and indent like that is crazy hard to see errors.

Also when naming your scripts try putting a _ or __ in front of them (puts your codes at the top of the list in the folder. so you can see your codes easy)

And, always try to use names you don't think others would ever use ... like _aaa_FireSpell. With the "aaa" being an abbreviation of the mod.

(again a personal choice. when you're on your 20th mod you will thank yourself for that) :wallbash:

#2 ---------------------------------------------------------------------

 

Scriptname fireSpell extends Form
WEAPON Property wand Auto
SPELL Property WandSpellFireObj Auto
SPELL Property fireboltSpell Auto
SPELL Property iceSpikeSpell Auto
SPELL Property WandSpellIceObj Auto
SPELL Property lightningBoltSpell Auto
SPELL Property WandSpellLightningObj Auto
SPELL Property killingavadaSpell Auto
SPELL Property WandSpellAvadaObj Auto
SPELL Property WandAbilityWardObj Auto
Event OnInit()
RegisterForActorAction(0)
EndEvent
Event OnActorAction(int actionType, Actor akActor, Form source, int slot)
if source==wand
if(Game.GetPlayer().GetEquippedSpell(2)==WandSpellFireObj)
if(Game.GetPlayer().GetActorValue("magicka")>=fireboltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
fireboltSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
Game.GetPlayer().DamageActorValue("Magicka", fireboltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
endif
elseif(Game.GetPlayer().GetEquippedSpell(2)==WandSpellIceObj)
if(Game.GetPlayer().GetActorValue("magicka")>=iceSpikeSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
iceSpikeSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
Game.GetPlayer().DamageActorValue("Magicka", iceSpikeSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
endif
elseif(Game.GetPlayer().GetEquippedSpell(2)==WandSpellLightningObj)
if(Game.GetPlayer().GetActorValue("magicka")>=lightningBoltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
lightningBoltSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
Game.GetPlayer().DamageActorValue("Magicka", lightningBoltSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
endif
elseif(Game.GetPlayer().GetEquippedSpell(2)==WandSpellAvadaObj)
if(Game.GetPlayer().GetActorValue("magicka")>=killingavadaSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
killingavadaSpell.RemoteCast(Game.GetPlayer(), Game.GetPlayer())
Game.GetPlayer().DamageActorValue("Magicka", killingavadaSpell.GetEffectiveMagickaCost(Game.GetPlayer())/2)
endif
elseif(Game.GetPlayer().GetEquippedSpell(2)!=WandSpellAvadaObj)
if(Game.GetPlayer().GetEquippedSpell(2)!=WandSpellLightningObj)
if(Game.GetPlayer().GetEquippedSpell(2)!=WandSpellIceObj)
if(Game.GetPlayer().GetEquippedSpell(2)!=WandSpellFireObj)
Debug.MessageBox("Focus on a spell!")
endif
endif
endif
endIf
endif
EndEvent
Edited by NexusComa
Link to comment
Share on other sites

  • Recently Browsing   0 members

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