HeirOfTheSeptims Posted December 12, 2015 Share Posted December 12, 2015 (edited) I need some help with a script I'm making for a new spell. The script is: Scriptname aaaMetiorScript extends activemagiceffect import utilityimport game Float Property HeightRef Auto Activator Property ActivatorRef Auto SPELL Property SpellRef Auto Actor TargetActorRefActivator ActivatorRef Event OnEffectStart(TargetActorRef, PlayerActorRef) Float PosX = TargetActorRef.GetPositionX()Float PosY = TargetActorRef.GetPositionY()Float PosZ = TargetActorRef.GetPositionZ() + HeightRef TargetActorRef.PlaceAtMe(ActivatorRef) ;place activator in world at TargetUtility.Wait(0.1)ActivatorRef.SetPosition(PosX,PosY,PosZ) ;set activator new positon to above targetUtility.Wait(0.5)SpellRef.RemoteCast(ActivatorRef,PlayerActorRef,TargetActorRef) ;from activator, hit target, blame playerUtility.Wait(1.0)ActivatorRef.Disable()ActivatorRef.Delete()EndEvent and I get an output of: Starting 1 compile threads for 1 files...Compiling "aaaMetiorScript"...C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\aaaMetiorScript.psc(14,34): extraneous input ',' expecting IDNo output generated for aaaMetiorScript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on aaaMetiorScript For some reason it doesn't like the coma between TargetActorRef and PlayerActorRef, when I try removing it the error goes away, but (predictably) it thinks I'm trying to define PlayerActorRef again. Does anybody know whats actually wrong?(I don't know how good my script actually is, I'm fairly new to the whole scripting thing) Edited December 12, 2015 by HeirOfTheSeptems Link to comment Share on other sites More sharing options...
Arocide Posted December 12, 2015 Share Posted December 12, 2015 (edited) Event OnEffectStart(Actor TargetActorRef, Actor PlayerActorRef) When declaring an Event or Function you'll need to include the types of the parameters in its signature otherwise papyrus won't know what type each parameter should be. Currently the compiler is assuming TargetActorRef is the type of the parameter and so it is expecting the ID to come after, which it's not so it's throwing that error. There's no real use for the: Actor TargetActorRef Declaration currently, unless you intend to use it outside the Event in which case you would need a different identifier for it or the parameter. Leaving it in would make the variable ambiguous (Since you've already declared it), I don't remember if the compiler throws an error for that or not. Edited December 12, 2015 by Arocide Link to comment Share on other sites More sharing options...
HeirOfTheSeptims Posted December 12, 2015 Author Share Posted December 12, 2015 (edited) Scriptname aaaMetiorScript extends activemagiceffect import utilityimport game Float Property HeightRef Auto Activator Property ActivatorRef Auto SPELL Property SpellRef Auto Activator ActivatorRef Event OnEffectStart(Actor TargetActorRef, Actor PlayerActorRef) Float PosX = TargetActorRef.GetPositionX()Float PosY = TargetActorRef.GetPositionY()Float PosZ = TargetActorRef.GetPositionZ() + HeightRef TargetActorRef.PlaceAtMe(ActivatorRef) ;place activator in world at TargetUtility.Wait(0.1)ActivatorRef.SetPosition(PosX,PosY,PosZ) ;set activator new positon to above targetUtility.Wait(0.5)SpellRef.RemoteCast(ActivatorRef,PlayerActorRef,TargetActorRef) ;from activator, hit target, blame playerUtility.Wait(1.0)ActivatorRef.Disable()ActivatorRef.Delete()EndEvent Now it gives me even more errors :sad: Starting 1 compile threads for 1 files...Compiling "aaaMetiorScript"...C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\aaaMetiorScript.psc(21,16): SetPosition is not a function or does not existC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\aaaMetiorScript.psc(23,12): type mismatch on parameter 1 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\aaaMetiorScript.psc(25,14): Disable is not a function or does not existC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\aaaMetiorScript.psc(26,14): Delete is not a function or does not existNo output generated for aaaMetiorScript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on aaaMetiorScript that change causes it to stop recognizing a whole bunch of commands Edited December 12, 2015 by HeirOfTheSeptems Link to comment Share on other sites More sharing options...
Arocide Posted December 12, 2015 Share Posted December 12, 2015 (edited) that change causes it to stop recognizing a whole bunch of commands It never recognised them in the first place :laugh:.The original error masked the rest there was no point in the compiler continuing since it knew it was already invalid. The problem now is that an Activator is not a ObjectReference, an Activator is a Form. You'll need to change its type to ObjectReference and link the property to the ObjectReference of the Activator you want to perform the functions on, or use a second Variable to point to the Activator Form so you can place it and then assign the PlaceAtMe functions return value to a ObjectReference variable and use that instead. You've also declared ActivatorRef twice in the script (once as a property and again as a field). Edited December 12, 2015 by Arocide Link to comment Share on other sites More sharing options...
HeirOfTheSeptims Posted December 12, 2015 Author Share Posted December 12, 2015 Thanks! It Finally saved, now to see if it actually works XD Link to comment Share on other sites More sharing options...
Recommended Posts