jedp15 Posted April 21, 2020 Share Posted April 21, 2020 (edited) So I'm having trouble getting a script to compile. I've tried using both the CK and Notepad++ and both fail. I'm getting an error that says "variable EnchEbonyGreatswordFire05 is undefined." I'm new to scripting am just trying to add a specific sword to an NPC during a certain stage of a vanilla quest, because this is how they designed the quest (I'd rather just edit his inventory manually but that's not an option). The line of code I've added is in bold: ;BEGIN FRAGMENT Fragment_5Function Fragment_5();BEGIN CODE;Go Speak to Geldis at the Cornerclubif IsObjectiveDisplayed(5) == 1SetObjectiveCompleted(5,1)endifSetObjectiveDisplayed(10,1)Alias_DLC2RR02VendilAlias.GetActorRef().Disable()Alias_DLC2RR02VendilAlias.GetActorRef().MoveTo(pDLC2RR02EndMarker)pDLC2RRVendilSeverin.SetEssential(false)Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2CrimeRavenRockFaction)Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinSpouseFaction)Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinManorFaction)Alias_DLC2RR02VendilAlias.GetActorRef().AddToFaction(pDLC2MoragTongFaction)Alias_DLC2RR02VendilAlias.GetActorRef().SetAv("Aggression",1)Alias_DLC2RR02VendilAlias.GetActorRef().SetOutfit(pDLC2VendilSeverinBattleOutfit)Alias_DLC2RR02VendilAlias.GetActorRef().AddItem(EnchEbonyGreatswordFire05, 01);END CODEEndFunction;END FRAGMENT Here's the complete error code: C:\Program Files (x86)\Notepad++>"G:\Steam\steamapps\common\Skyrim\Papyrus Compiler\PapyrusCompiler" "DLC2_QF_DLC2RR02_02018B14.psc" -f="TESV_Papyrus_Flags.flg"-i="G:\Steam\steamapps\common\Skyrim\Papyrus Compiler\..\Data\Scripts\Source" -o="G:\Steam\steamapps\common\Skyrim\Papyrus Compiler\..\Data\Scripts"Starting 1 compile threads for 1 files...Compiling "DLC2_QF_DLC2RR02_02018B14"...G:\Steam\steamapps\common\Skyrim\Data\Scripts\Source\DLC2_QF_DLC2RR02_02018B14.psc(103,48): variable EnchEbonyGreatswordFire05 is undefinedG:\Steam\steamapps\common\Skyrim\Data\Scripts\Source\DLC2_QF_DLC2RR02_02018B14.psc(176,12): dlc2rr02questscript is not a known user-defined typeG:\Steam\steamapps\common\Skyrim\Data\Scripts\Source\DLC2_QF_DLC2RR02_02018B14.psc(238,12): dlc2rr02questscript is not a known user-defined typeG:\Steam\steamapps\common\Skyrim\Data\Scripts\Source\DLC2_QF_DLC2RR02_02018B14.psc(296,29): unknown type dlc2rr00questscriptG:\Steam\steamapps\common\Skyrim\Data\Scripts\Source\DLC2_QF_DLC2RR02_02018B14.psc(308,29): unknown type dlc2rr02questscriptNo output generated for DLC2_QF_DLC2RR02_02018B14.psc, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on DLC2_QF_DLC2RR02_02018B14.pscC:\Program Files (x86)\Notepad++>pausePress any key to continue . . . The script name is "DLC2_QF_DLC2RR02_02018B14" it's for the quest "Served Cold" in the Dragonborn DLC. Thanks in advance! Edited April 21, 2020 by jedp15 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted April 21, 2020 Share Posted April 21, 2020 Okay, you are working with a fragment script. Fragment scripts must have all properties added to them via the property window before they can be compiled. You have added the item EnchEbonyGreatswordFire05 and without that variable being defined by a property as a weapon and subsequently with the item assigned to the property, the compiler cannot handle it. If you want to skip the property thing, you can add the following instead: Form myForm = Game.GetFormFromFile(0x0001cfba,"Skyrim.esm") ;assigns the base form of "Ebony Greatsword of the Inferno" Alias_DLC2RR02VendilAlias.GetActorRef().AddItem(myForm, 01)If the supplied ID is not correct for the weapon you want, change it accordingly. Link to comment Share on other sites More sharing options...
jedp15 Posted May 4, 2020 Author Share Posted May 4, 2020 (edited) Thanks so much for the help, will try it out and see how it goes. Edit: so where in the fragment script do I place the "myForm" code? Right before ";END CODE" where I placed my original code? Or do I have to create a new script? Edited May 4, 2020 by jedp15 Link to comment Share on other sites More sharing options...
jedp15 Posted May 4, 2020 Author Share Posted May 4, 2020 Okay tried it within the original script and it failed. Like I said I'm NEW to scripting. Need to know verbatum what to do. Here's what I put ;BEGIN FRAGMENT Fragment_5Function Fragment_5();BEGIN CODE;Go Speak to Geldis at the Cornerclubif IsObjectiveDisplayed(5) == 1SetObjectiveCompleted(5,1)endifSetObjectiveDisplayed(10,1)Alias_DLC2RR02VendilAlias.GetActorRef().Disable()Alias_DLC2RR02VendilAlias.GetActorRef().MoveTo(pDLC2RR02EndMarker)pDLC2RRVendilSeverin.SetEssential(false)Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2CrimeRavenRockFaction)Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinSpouseFaction)Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinManorFaction)Alias_DLC2RR02VendilAlias.GetActorRef().AddToFaction(pDLC2MoragTongFaction)Alias_DLC2RR02VendilAlias.GetActorRef().SetAv("Aggression",1)Alias_DLC2RR02VendilAlias.GetActorRef().SetOutfit(pDLC2VendilSeverinBattleOutfit)Form myForm = Game.GetFormFromFile(0x0001cdc8,"Skyrim.esm") ;assigns the base form of "Ebony Greatsword of the Blaze"Alias_DLC2RR02VendilAlias.GetActorRef().AddItem(myForm, 01);END CODEEndFunction;END FRAGMENT Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 4, 2020 Share Posted May 4, 2020 (edited) What failed? The compilation of the script fragment? The adding of the item in-game? Edit: Hmm... Have you considered adding the item directly to the alias' inventory rather than scripting it in? Additionally, if you are looking at keeping it compatible with other mods that might want to affect the same thing, you could create a new quest with its own alias that gets filled with the target alias of the desired quest. Your new quest can be started with the story manger's OnLocationChange event with the condition that the target quest has been started. At least those are some alternative routes to think about. Edited May 4, 2020 by IsharaMeradin Link to comment Share on other sites More sharing options...
jedp15 Posted May 5, 2020 Author Share Posted May 5, 2020 (edited) Yeah it failed to compile. The part I showed is just a small fragment in a much larger script. The reason it needs to be scripted in is because according to the events of the story I'm merging into the quest, the weapon is supposed to be "taken" from a slain NPC much later on. I'd rather keep it simple, so maybe the script property would work. You wrote "Fragment scripts must have all properties added to them via the property window before they can be compiled."I'm not sure how this would be done, do you mind showing me :smile: lol Here's the beginning of the script up to the point I showed you ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 24Scriptname DLC2_QF_DLC2RR02_02018B14 Extends Quest Hidden;BEGIN ALIAS PROPERTY DLC2RR02TombQTAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02TombQTAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02VendilAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02VendilAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02SeverinHouseMarkerAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02SeverinHouseMarkerAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02VelethAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02VelethAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02GeldisAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02GeldisAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02TilisuAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02TilisuAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02MorvaynAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02MorvaynAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02MirriAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02MirriAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02AdrilAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02AdrilAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02GuardQT;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02GuardQT Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RRHoldingSafeAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RRHoldingSafeAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02EvidenceAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02EvidenceAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02SafeAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02SafeAlias Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY DLC2RR02PlayerAlias;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_DLC2RR02PlayerAlias Auto;END ALIAS PROPERTY;BEGIN FRAGMENT Fragment_4Function Fragment_4();BEGIN CODE;Quest is in holding pattern, Player isn't taking it right nowif isObjectiveDisplayed(5) == 0SetObjectiveDisplayed(5,1)endif;END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_5Function Fragment_5();BEGIN CODE;Go Speak to Geldis at the Cornerclubif IsObjectiveDisplayed(5) == 1SetObjectiveCompleted(5,1)endifSetObjectiveDisplayed(10,1)Alias_DLC2RR02VendilAlias.GetActorRef().Disable()Alias_DLC2RR02VendilAlias.GetActorRef().MoveTo(pDLC2RR02EndMarker)pDLC2RRVendilSeverin.SetEssential(false)Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2CrimeRavenRockFaction)Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinSpouseFaction)Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinManorFaction)Alias_DLC2RR02VendilAlias.GetActorRef().AddToFaction(pDLC2MoragTongFaction)Alias_DLC2RR02VendilAlias.GetActorRef().SetAv("Aggression",1)Alias_DLC2RR02VendilAlias.GetActorRef().SetOutfit(pDLC2VendilSeverinBattleOutfit);END CODEEndFunction;END FRAGMENT It's confusing because none of the things in the fragment I'm trying to change are mentioned as properties beforehand (like the pDLC2VendilSeverinBattleOutfit is not set as an outfit property), yet the script works.This is what I would try just by looking at what was written earlier in the script, but yeah, have no idea what I'm doing lol. ;BEGIN ALIAS PROPERTY EnchEbonyGreatswordFire05Alias;ALIAS PROPERTY TYPE WeaponAliasWeaponAlias Property Alias_EnchEbonyGreatswordFire05 Auto;END ALIAS PROPERTY Edited May 5, 2020 by jedp15 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 5, 2020 Share Posted May 5, 2020 Perhaps this old post will help. While your script fragment already exists, the steps to adding the property should be fairly similar.https://forums.nexusmods.com/index.php?/topic/2557844-need-help-with-scripting-a-quest-fragment/&do=findComment&comment=22435329 Link to comment Share on other sites More sharing options...
jedp15 Posted May 8, 2020 Author Share Posted May 8, 2020 Alright thanks, will check it out. Link to comment Share on other sites More sharing options...
Recommended Posts