irswat Posted August 24, 2016 Share Posted August 24, 2016 I'm trying to compile a script, and it's my first script ever, and granted its kind of complicated. Needless to throw it's throwing some errors at me, and won't compile. Is there a real time debugger that will allow me to click on the error and it takes me to the line the error is on? Link to comment Share on other sites More sharing options...
FrankFamily Posted August 24, 2016 Share Posted August 24, 2016 Yes, the compile output already tells you the exact line and column where the error is. Doesn't have the shorcut you mention but it takes 5 seconds to find the line...You can also post the script here and I or someone else can help you locate the error. Link to comment Share on other sites More sharing options...
irswat Posted August 24, 2016 Author Share Posted August 24, 2016 (edited) I added/changed the following to the wispActorScript. Apparently it's way off because almost every line I wrote is throwing an error: Starting 1 compile threads for 1 files...Compiling "wispActorScript"...C:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(174,38): selfRef is not a function or does not existC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(174,38): cannot call the member function selfRef alone or on a type, must call it on a variableC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(174,59): variable DLC1LD_AetherialCrown is undefinedC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(174,48): none is not a known user-defined typeC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(175,8): a property cannot be used directly on a type, it must be used on a variableC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(175,8): selfRef is not a property on script game or one of its parentsC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(175,24): variable DLC1LD_AetherialCrown is undefinedC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(175,16): none is not a known user-defined typeC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(176,21): variable DLC1LD_AetherialCrown is undefinedC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(176,11): EquipItem is not a function or does not existC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(177,39): selfRef is not a function or does not existC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(177,39): cannot call the member function selfRef alone or on a type, must call it on a variableC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(177,60): variable DLC1LD_AetherialCrown is undefinedC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(177,49): none is not a known user-defined typeC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(178,23): variable DLC1LD_AetherialCrown is undefinedC:\Games\steamapps\common\skyrim\Data\Scripts\Source\wispActorScript.psc(178,11): UnequipItem is not a function or does not existNo output generated for wispActorScript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on wispActorScript ;counter for number of summoned wisps int WispChildCount = 0 EVENT OnEffectStart() selfRef = caster int RemainingWispChildren=(9-WispChildCount) if RemainingWispChildren>=3 orb01 = selfref.getLinkedRef(WispChild01) orb02 = selfRef.getLinkedRef(WispChild02) orb03 = selfRef.getLinkedRef(WispChild03) WispChildCount+=3 elseif RemainingWispChildren == 2 orb01 = selfref.getLinkedRef(WispChild01) orb02 = selfRef.getLinkedRef(WispChild02) WispChildCount+=2 elseif RemainingWispChildren==1 orb01 = selfref.getLinkedRef(WispChild01) WispChildCount+=1 endif endEVENT EVENT OnUpdate() bool IsOrb01Dead=(orb01 as actor).IsDead()bool IsOrb02Dead=(orb02 as actor).IsDead()bool IsOrb03Dead=(orb03 as actor).IsDead() if (IsOrb01Dead==true)WispChildCount-=1endifif (IsOrb02Dead==true)WispChildCount-=1endifif (IsOrb03Dead==true)WispChildCount-=1endifif ((WispChildCount >= 1) && !(Game.selfRef().IsEquipped(DLC1LD_AetherialCrown))) Game.selfRef.AddItem(DLC1LD_AetherialCrown, 1, true) selfRef.EquipItem(DLC1LD_AetherialCrown, true) elseif ((WispChildCount==0) && (Game.selfRef().IsEquipped(DLC1LD_AetherialCrown))) selfRef.UnequipItem(DLC1LD_AetherialCrown, true) endif endEVENT Edited August 24, 2016 by irswat Link to comment Share on other sites More sharing options...
irswat Posted August 24, 2016 Author Share Posted August 24, 2016 (edited) Is there a spoiler tag in this forum. It would be preferable to put large chunks of code in spoiler frames yea? Edited August 24, 2016 by irswat Link to comment Share on other sites More sharing options...
FrankFamily Posted August 24, 2016 Share Posted August 24, 2016 (edited) Yes, there is [*spoiler] and [*/spoiler] (without the *) but the code tag is fine, easier to read. You can put the code within the spoiler too: some code So, the errors, not so many actually: > "IsDead is not a function or does not exist" and "(Un)EquipItem is not a function or does not exist" => You are calling it on the orbs which are ObjectReference, so it's looking for IsDead function within that script. IsDead belongs to the actor script. So asuming the orbs are indeed actors: (orbX as Actor).IsDead() (selfRef as Actor).EquipItem(DLC1LD_AetherialCrown, true) You need to cast it as the proper type that contains the function you want to call. Here: http://www.creationkit.com/index.php?title=Category:Papyrus by the side of each function you see the script it belongs to. And here some more stuff about casting (specially the bottom): http://www.creationkit.com/index.php?title=Cast_Reference You can see in the vanilla script stuff like: (selfRef as actor).damageActorValue("Magicka", -((selfref as actor).getActorValue("Magicka"))) (selfref as actor).removeSpell(Phase1ConcSpell) (selfref as actor).addSpell(Phase2ConcSpell) Continues below: Edited August 24, 2016 by FrankFamily Link to comment Share on other sites More sharing options...
FrankFamily Posted August 24, 2016 Share Posted August 24, 2016 > "Game.selfRef" and "Game.selfRef()" Are also wrong and sending many errors. "Game.GetPlayer()" Is the Getplayer within game script that returns the player's ref, different that using the already defined selfref variable. Just do: SelfRef.Additem(etc) (SelfRed as Actor).Equip(etc) because additem is in the objectrefence script (which SelfRef is) and Equip on the actor script. It's all in the wiki. > You need to define the DLC1LD_AetherialCrown property before using it, like those spell properties in the vanilla script: Armor Property AetherialCrown Auto event someevent() SelfRef.Additem(AetherialCrown) endevent and then you fill the property in ck. tutorials on the wiki above or here: http://www.cipscis.com/skyrim/tutorials/beginners.aspx And i think that was all Link to comment Share on other sites More sharing options...
irswat Posted August 24, 2016 Author Share Posted August 24, 2016 (edited) Thank you so much! God bless man!I managed to get rid of all the bugs myself before seeing you replied, and I figured out it was because they were object and actor references. I was also missing a stupid parenthesis and endif. The other errors were because I was using boolean functions but thought they were binary boolean functions returns 0/1, and as such I declared my variables as ints. That was a eureka moment.I'm still trying to figure out the armor properties thing, because, it's not an armor property that I am trying to add, but an actual circlet.I copied the BoneCrownArmor as a place holder until I figure this out, and I renamed it WispDiadem. I try to AddItem/EquipItem and I'm getting the same error as with the AetherialCrown. Are the AddItem, IsEquipped, EquipItem, and UnequipItem functions looking for a refid? I think this is the problem. I am trying to pass it an editorid, or the baseid even, because I have no idea how to get the refid of an item. I tried GetFormID previously, but it was returning a decimal, and throwing errors.Should I do something likestring WispDiadem=(WispDiadem as ObjectReference)if the editor ID is WispDiadem?I found working in GECK for NV easier. Tough learning new concepts and methods in programming when you do it once every 3 years lol. Edited August 24, 2016 by irswat Link to comment Share on other sites More sharing options...
FrankFamily Posted August 24, 2016 Share Posted August 24, 2016 "it's not an armor property that I am trying to add, but an actual circlet" In skyrim to point to any ingame items such as weapons, armor, quest, anything, you need to make and fill properties. A property basically points to an item (or reference). Editor IDs within scripts is a fallout new vegas thing. The whole matter is very well explained on the cipscis tutorial i linked above. Link to comment Share on other sites More sharing options...
irswat Posted August 24, 2016 Author Share Posted August 24, 2016 (edited) one last question. Suppose I want to create this mod without modifying the original wispActorScript, is it similar to how I would have done it in the GECK, creating a quest script and onload see if player is in combat, and if so is it a wispmother?How would I go about achieving these ends without modifying the original script? Edited August 24, 2016 by irswat Link to comment Share on other sites More sharing options...
irswat Posted August 24, 2016 Author Share Posted August 24, 2016 it compiled!!! thanks for your help mate! Link to comment Share on other sites More sharing options...
Recommended Posts