shadowslasher410 Posted March 30, 2017 Share Posted March 30, 2017 What it says on the tin. Won't compile no matter what I try (though I'm probably not trying the right things). Oh, do note that the functions IsInWorkshopMode() and GetCurrentHighlightedRef() are functions defined by an F4SE plugin. I know it works properly, so I can rule out those two functions being the cause. Here's the script I need help with: Scriptname ScrapEverythingCoreScript Extends Quest Import Game ScrapEverythingCoreScript Property CoreScript Auto ScrapEverythingStartupScript Property StartScript Auto CoreSearchForObjectQuestScript Property CoreSearchScript Auto AutomatronSearchForObjectScript Property AutomatronSearchScript Auto FarHarborSearchForObjectScript Property FarHarborSearchScript Auto VaultTecWorkshopSearchForObjectScript Property VaultTecWorkshopSearchScript Auto NukaWorldSearchForObjectScript Property NukaWorldSearchScript Auto Bool Property HasAutomatron Auto Bool Property HasFarHarbor Auto Bool Property HasVaultTecWorkshop Auto Bool Property HasNukaWorld Auto Int Property DLCID Auto ;1=Base Game, 2=Automatron, 3=Far Harbor, 4=Nuka World, 5=Vault-Tec Workshop, 6=Unknown Formlist Property SS_NoScrapList Auto Formlist ListToChange CustomEvent SearchCoreLists CustomEvent SearchAutomatronLists CustomEvent SearchFarHarborLists CustomEvent SearchVaultTecWorkshopLists CustomEvent SearchNukaWorldLists Function RegisterCustomEvents(Quest QuestToRegister, Bool bRegister) If (bRegister == 0) QuestToRegister.RegisterForCustomEvent(CoreScript, "SearchCoreLists") QuestToRegister.RegisterForCustomEvent(CoreScript, "SearchAutomatronLists") QuestToRegister.RegisterForCustomEvent(CoreScript, "SearchFarHarborLists") QuestToRegister.RegisterForCustomEvent(CoreScript, "SearchVaultTecWorkshopLists") QuestToRegister.RegisterForCustomEvent(CoreScript, "SearchNukaWorldLists") Else QuestToRegister.UnregisterForCustomEvent(CoreScript, "SearchCoreLists") QuestToRegister.UnregisterForCustomEvent(CoreScript, "SearchAutomatronLists") QuestToRegister.UnregisterForCustomEvent(CoreScript, "SearchFarHarborLists") QuestToRegister.UnregisterForCustomEvent(CoreScript, "SearchVaultTecWorkshopLists") QuestToRegister.UnregisterForCustomEvent(CoreScript, "SearchNukaWorldLists") EndIf EndFunction Function CheckFormForDLC() Int ObjFormID = StartScript.FormToFind.GetFormID() Bool HasDLC01 = Self.GetPropertyValue(HasAutomatron) As Bool Bool HasDLC03 = Self.GetPropertyValue(HasFarHarbor) As Bool Bool HasDLC04 = Self.GetPropertyValue(HasNukaWorld) As Bool Bool HasDLC06 = Self.GetPropertyValue(HasVaultTecWorkshop) As Bool If (GetFormFromFile(ObjFormID, "Fallout4.esm") != None) Self.SetPropertyValue(DLCID, 1) Else If (HasDLC01 == 1) && (GetFormFromFile(ObjFormID, "DLCRobot.esm") != None) Self.SetPropertyValue(DLCID, 2) Else If (HasDLC03 == 1) && (GetFormFromFile(ObjFormID, "DLCCoast.esm") != None) Self.SetPropertyValue(DLCID, 3) Else If (HasDLC04 == 1) && (GetFormFromFile(ObjFormID, "DLCNukaWorld.esm") != None) Self.SetPropertyValue(DLCID, 4) Else If (HasDLC06 == 1) && (GetFormFromFile(ObjFormID, "DLCWorkshop03.esm") != None) Self.SetPropertyValue(DLCID, 5) Else Self.SetPropertyValue(DLCID, 6) EndIf EndIf EndIf EndIf EndIf EndFunction Function SearchLists() Int FormType = Self.GetPropertyValue(DLCID) As Int If (FormType == 1) ;Base Game CoreSearchScript.ObjectSearchCoreLists(StartScript.FormToFind) Else If (FormType == 2) ;Automatron AutomatronSearchScript.ObjectSearchAutomatronLists(StartScript.FormToFind) Else If (FormType == 3) ; Far Harbor FarHarborSearchScript.ObjectSearchFarHarborLists(StartScript.FormToFind) Else If (FormType == 4) ;Nuka World NukaWorldSearchScript.ObjectSearchNukaWorldLists(StartScript.FormToFind) Else If (FormType == 5) ;Vault-Tec Workshop VaultTecWorkshopSearchScript.ObjectSearchVaultTecWorkshopLists(StartScript.FormToFind) Else If (FormType == 6) ;Unknown Debug.Messagebox("The object you have selected is not supported by Scrap Everything. Please choose another object and try again.") EndIf EndIf EndIf EndIf EndIf EndIf EndFunction Event CoreScript.SearchCoreLists(CoreSearchScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.") EndEvent Event CoreScript.SearchAutomatronLists(AutomatronSearchScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.") EndEvent Event CoreScript.SearchFarHarborLists(FarHarborSearchScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.") EndEvent Event CoreScript.SearchNukaWorldLists(NukaWorldSearchScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.") EndEvent Event CoreScript.SearchVaultTecWorkshopLists(VaultTecWorkshopSearchScript akSender, Var[] SearchResults) ListToChange = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToChange) Debug.Messagebox("The formlist of your object is now unable to be scrapped.") EndEvent Event CoreScript.OnControlDown(String control) If (control == "Sneak") If (IsInWorkshopMode() == 1 && StartScript.FormToFind != None) CheckFormForDLC() SearchLists() Else Return EndIf EndIf EndEvent Event CoreScript.OnKeyDown(Int keyCode) If (keyCode == 8) If (IsInWorkshopMode() == 0 && (!Utility.IsInMenuMode)) SS_NoScrapList.RemoveAddedForm(ListToChange) Debug.Messagebox("The most recent formlist you made unable to be scrapped is now able to be scrapped.") EndIf EndIf EndEvent And here are the errors the compiler spits out at me: ScrapEverythingCoreScript.psc(103,50): unknown type coresearchscript ScrapEverythingCoreScript.psc(103,0): corescript is not a known script type and therefore cannot be the source of the searchcorelists event ScrapEverythingCoreScript.psc(109,62): unknown type automatronsearchscript ScrapEverythingCoreScript.psc(109,0): corescript is not a known script type and therefore cannot be the source of the searchautomatronlists event ScrapEverythingCoreScript.psc(115,60): unknown type farharborsearchscript ScrapEverythingCoreScript.psc(115,0): corescript is not a known script type and therefore cannot be the source of the searchfarharborlists event ScrapEverythingCoreScript.psc(121,60): unknown type nukaworldsearchscript ScrapEverythingCoreScript.psc(121,0): corescript is not a known script type and therefore cannot be the source of the searchnukaworldlists event ScrapEverythingCoreScript.psc(127,74): unknown type vaulttecworkshopsearchscript ScrapEverythingCoreScript.psc(127,0): corescript is not a known script type and therefore cannot be the source of the searchvaulttecworkshoplists event ScrapEverythingCoreScript.psc(133,0): corescript is not a known script type and therefore cannot be the source of the oncontroldown event ScrapEverythingCoreScript.psc(146,45): a property cannot be used directly on a type, it must be used on a variable ScrapEverythingCoreScript.psc(146,45): IsInMenuMode is not a property on script utility or one of its parents ScrapEverythingCoreScript.psc(144,0): corescript is not a known script type and therefore cannot be the source of the onkeydown event No output generated for ScrapEverythingCoreScript, compilation failed. I'll post the other scripts if you all want, but those compile fine. It's only this one that's giving me trouble. Some more info: ScrapEverythingCoreScript is a script attached to a quest, ScrapEverythingStartupScript is a script attached to a reference alias (the player) as a Quest Alias on the same quest. The rest of the scripts are all attached to different quests. Link to comment Share on other sites More sharing options...
scrivener07 Posted March 30, 2017 Share Posted March 30, 2017 The problem is the way you have defined your CustomEvent declaration! The event declaration expects the fully qualified type name. In the script above you have defined the property name. The first parameter of a CutomEvent also needs to be the type of the sending script where the CustomEvent is declared. Also your remote event declarations for Key/ControlDown seem wrong as the fully qualified type name is on ScriptObject. I put a little snippet on how to type check the sender if that's required for your usage. Scriptname ScrapEverythingCoreScript Extends Quest Import Game ScrapEverythingCoreScript Property CoreScript Auto ScrapEverythingStartupScript Property StartScript Auto CoreSearchForObjectQuestScript Property CoreSearchScript Auto AutomatronSearchForObjectScript Property AutomatronSearchScript Auto FarHarborSearchForObjectScript Property FarHarborSearchScript Auto VaultTecWorkshopSearchForObjectScript Property VaultTecWorkshopSearchScript Auto NukaWorldSearchForObjectScript Property NukaWorldSearchScript Auto Bool Property HasAutomatron Auto Bool Property HasFarHarbor Auto Bool Property HasVaultTecWorkshop Auto Bool Property HasNukaWorld Auto Int Property DLCID Auto ;1=Base Game, 2=Automatron, 3=Far Harbor, 4=Nuka World, 5=Vault-Tec Workshop, 6=Unknown Formlist Property SS_NoScrapList Auto Formlist ListToChange CustomEvent SearchCoreLists CustomEvent SearchAutomatronLists CustomEvent SearchFarHarborLists CustomEvent SearchVaultTecWorkshopLists CustomEvent SearchNukaWorldLists Function RegisterCustomEvents(Quest QuestToRegister, Bool bRegister) If (bRegister == 0) QuestToRegister.RegisterForCustomEvent(CoreScript, "SearchCoreLists") QuestToRegister.RegisterForCustomEvent(CoreScript, "SearchAutomatronLists") QuestToRegister.RegisterForCustomEvent(CoreScript, "SearchFarHarborLists") QuestToRegister.RegisterForCustomEvent(CoreScript, "SearchVaultTecWorkshopLists") QuestToRegister.RegisterForCustomEvent(CoreScript, "SearchNukaWorldLists") Else QuestToRegister.UnregisterForCustomEvent(CoreScript, "SearchCoreLists") QuestToRegister.UnregisterForCustomEvent(CoreScript, "SearchAutomatronLists") QuestToRegister.UnregisterForCustomEvent(CoreScript, "SearchFarHarborLists") QuestToRegister.UnregisterForCustomEvent(CoreScript, "SearchVaultTecWorkshopLists") QuestToRegister.UnregisterForCustomEvent(CoreScript, "SearchNukaWorldLists") EndIf EndFunction Function CheckFormForDLC() Int ObjFormID = StartScript.FormToFind.GetFormID() Bool HasDLC01 = Self.GetPropertyValue(HasAutomatron) As Bool Bool HasDLC03 = Self.GetPropertyValue(HasFarHarbor) As Bool Bool HasDLC04 = Self.GetPropertyValue(HasNukaWorld) As Bool Bool HasDLC06 = Self.GetPropertyValue(HasVaultTecWorkshop) As Bool If (GetFormFromFile(ObjFormID, "Fallout4.esm") != None) Self.SetPropertyValue(DLCID, 1) Else If (HasDLC01 == 1) && (GetFormFromFile(ObjFormID, "DLCRobot.esm") != None) Self.SetPropertyValue(DLCID, 2) Else If (HasDLC03 == 1) && (GetFormFromFile(ObjFormID, "DLCCoast.esm") != None) Self.SetPropertyValue(DLCID, 3) Else If (HasDLC04 == 1) && (GetFormFromFile(ObjFormID, "DLCNukaWorld.esm") != None) Self.SetPropertyValue(DLCID, 4) Else If (HasDLC06 == 1) && (GetFormFromFile(ObjFormID, "DLCWorkshop03.esm") != None) Self.SetPropertyValue(DLCID, 5) Else Self.SetPropertyValue(DLCID, 6) EndIf EndIf EndIf EndIf EndIf EndFunction Function SearchLists() Int FormType = Self.GetPropertyValue(DLCID) As Int If (FormType == 1) ;Base Game CoreSearchScript.ObjectSearchCoreLists(StartScript.FormToFind) Else If (FormType == 2) ;Automatron AutomatronSearchScript.ObjectSearchAutomatronLists(StartScript.FormToFind) Else If (FormType == 3) ; Far Harbor FarHarborSearchScript.ObjectSearchFarHarborLists(StartScript.FormToFind) Else If (FormType == 4) ;Nuka World NukaWorldSearchScript.ObjectSearchNukaWorldLists(StartScript.FormToFind) Else If (FormType == 5) ;Vault-Tec Workshop VaultTecWorkshopSearchScript.ObjectSearchVaultTecWorkshopLists(StartScript.FormToFind) Else If (FormType == 6) ;Unknown Debug.Messagebox("The object you have selected is not supported by Scrap Everything. Please choose another object and try again.") EndIf EndIf EndIf EndIf EndIf EndIf EndFunction Event ScrapEverythingCoreScript.SearchCoreLists(ScrapEverythingCoreScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.") EndEvent Event ScrapEverythingCoreScript.SearchAutomatronLists(ScrapEverythingCoreScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.") EndEvent Event ScrapEverythingCoreScript.SearchFarHarborLists(ScrapEverythingCoreScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.") EndEvent Event ScrapEverythingCoreScript.SearchNukaWorldLists(ScrapEverythingCoreScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.") EndEvent Event ScrapEverythingCoreScript.SearchVaultTecWorkshopLists(ScrapEverythingCoreScript akSender, Var[] SearchResults) ListToChange = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToChange) Debug.Messagebox("The formlist of your object is now unable to be scrapped.") EndEvent ;REMOTE, NOT A CustomEvent Event ScriptObject.OnControlDown(ScriptObject akSender, String control) If (akSender is ScrapEverythingCoreScript) ; check if the sender IS of the expected type Else return EndIf If (control == "Sneak") If (IsInWorkshopMode() == 1 && StartScript.FormToFind != None) CheckFormForDLC() SearchLists() Else Return EndIf EndIf EndEvent ;REMOTE, NOT A CustomEvent Event ScriptObject.OnKeyDown(ScriptObject akSender, Int keyCode) If (keyCode == 8) If (IsInWorkshopMode() == 0 && (!Utility.IsInMenuMode)) SS_NoScrapList.RemoveAddedForm(ListToChange) Debug.Messagebox("The most recent formlist you made unable to be scrapped is now able to be scrapped.") EndIf EndIf EndEvent Link to comment Share on other sites More sharing options...
shadowslasher410 Posted March 30, 2017 Author Share Posted March 30, 2017 Thank you, thank you, THANK YOU! You have saved me from SO much headache! And finally made version 3.0 of Scrap Everything possible! EDIT: Here's the final script for anyone interested Scriptname ScrapEverythingCoreScript Extends QuestImport GameImport ScriptObjectImport UtilityScrapEverythingStartupScript Property StartScript AutoCoreSearchForObjectScript Property CoreSearchScript AutoAutomatronSearchForObjectScript Property AutomatronSearchScript AutoFarHarborSearchForObjectScript Property FarHarborSearchScript AutoVaultTecWorkshopSearchForObjectScript Property VaultTecWorkshopSearchScript AutoNukaWorldSearchForObjectScript Property NukaWorldSearchScript AutoBool Property HasAutomatron AutoBool Property HasFarHarbor AutoBool Property HasVaultTecWorkshop AutoBool Property HasNukaWorld AutoInt Property DLCID Auto ;1=Base Game, 2=Automatron, 3=Far Harbor, 4=Nuka World, 5=Vault-Tec Workshop, 6=UnknownFormlist Property SS_NoScrapList AutoFormlist ListToChangeCustomEvent SearchCoreListsCustomEvent SearchAutomatronListsCustomEvent SearchFarHarborListsCustomEvent SearchVaultTecWorkshopListsCustomEvent SearchNukaWorldListsFunction RegisterCustomEvents(Quest QuestToRegister, Bool bRegister) If (bRegister == 0) QuestToRegister.RegisterForCustomEvent(Self, "SearchCoreLists") QuestToRegister.RegisterForCustomEvent(Self, "SearchAutomatronLists") QuestToRegister.RegisterForCustomEvent(Self, "SearchFarHarborLists") QuestToRegister.RegisterForCustomEvent(Self, "SearchVaultTecWorkshopLists") QuestToRegister.RegisterForCustomEvent(Self, "SearchNukaWorldLists") Else QuestToRegister.UnregisterForCustomEvent(Self, "SearchCoreLists") QuestToRegister.UnregisterForCustomEvent(Self, "SearchAutomatronLists") QuestToRegister.UnregisterForCustomEvent(Self, "SearchFarHarborLists") QuestToRegister.UnregisterForCustomEvent(Self, "SearchVaultTecWorkshopLists") QuestToRegister.UnregisterForCustomEvent(Self, "SearchNukaWorldLists") EndIfEndFunctionFunction CheckFormForDLC() Int ObjFormID = StartScript.FormToFind.GetFormID() Bool HasDLC01 = Self.GetPropertyValue(HasAutomatron) As Bool Bool HasDLC03 = Self.GetPropertyValue(HasFarHarbor) As Bool Bool HasDLC04 = Self.GetPropertyValue(HasNukaWorld) As Bool Bool HasDLC06 = Self.GetPropertyValue(HasVaultTecWorkshop) As Bool If (GetFormFromFile(ObjFormID, "Fallout4.esm") != None) Self.SetPropertyValue(DLCID, 1) Else If (HasDLC01 == 1) && (GetFormFromFile(ObjFormID, "DLCRobot.esm") != None) Self.SetPropertyValue(DLCID, 2) Else If (HasDLC03 == 1) && (GetFormFromFile(ObjFormID, "DLCCoast.esm") != None) Self.SetPropertyValue(DLCID, 3) Else If (HasDLC04 == 1) && (GetFormFromFile(ObjFormID, "DLCNukaWorld.esm") != None) Self.SetPropertyValue(DLCID, 4) Else If (HasDLC06 == 1) && (GetFormFromFile(ObjFormID, "DLCWorkshop03.esm") != None) Self.SetPropertyValue(DLCID, 5) Else Self.SetPropertyValue(DLCID, 6) EndIf EndIf EndIf EndIf EndIfEndFunctionFunction SearchLists() Int FormType = Self.GetPropertyValue(DLCID) As Int If (FormType == 1) ;Base Game CoreSearchScript.ObjectSearchCoreLists(StartScript.FormToFind) Else If (FormType == 2) ;Automatron AutomatronSearchScript.ObjectSearchAutomatronLists(StartScript.FormToFind) Else If (FormType == 3) ; Far Harbor FarHarborSearchScript.ObjectSearchFarHarborLists(StartScript.FormToFind) Else If (FormType == 4) ;Nuka World NukaWorldSearchScript.ObjectSearchNukaWorldLists(StartScript.FormToFind) Else If (FormType == 5) ;Vault-Tec Workshop VaultTecWorkshopSearchScript.ObjectSearchVaultTecWorkshopLists(StartScript.FormToFind) Else If (FormType == 6) ;Unknown Debug.Messagebox("The object you have selected is not supported by Scrap Everything. Please choose another object and try again.") EndIf EndIf EndIf EndIf EndIf EndIfEndFunctionEvent ScrapEverythingCoreScript.SearchCoreLists(ScrapEverythingCoreScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.")EndEventEvent ScrapEverythingCoreScript.SearchAutomatronLists(ScrapEverythingCoreScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.")EndEventEvent ScrapEverythingCoreScript.SearchFarHarborLists(ScrapEverythingCoreScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.")EndEventEvent ScrapEverythingCoreScript.SearchNukaWorldLists(ScrapEverythingCoreScript akSender, Var[] SearchResults) Formlist ListToRemove = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToRemove) Debug.Messagebox("The formlist of your object is now unable to be scrapped.")EndEventEvent ScrapEverythingCoreScript.SearchVaultTecWorkshopLists(ScrapEverythingCoreScript akSender, Var[] SearchResults) ListToChange = SearchResults[0] as Formlist SS_NoScrapList.AddForm(ListToChange) Debug.Messagebox("The formlist of your object is now unable to be scrapped.")EndEvent;REMOTE, NOT A CustomEventEvent ScriptObject.OnControlDown(ScriptObject akSender, String control) If (akSender is ScrapEverythingCoreScript) ; check if the sender IS of the expected type Else return EndIf If (control == "Sneak") If (IsInWorkshopMode() == 1 && StartScript.FormToFind != None) CheckFormForDLC() SearchLists() Else Return EndIf EndIfEndEventEvent ScriptObject.OnKeyDown(ScriptObject akSender, Int keyCode) If (keyCode == 8) If (IsInWorkshopMode() == 0 && (IsInMenuMode() == 0)) SS_NoScrapList.RemoveAddedForm(ListToChange) Debug.Messagebox("The most recent formlist you made unable to be scrapped is now able to be scrapped.") EndIf EndIfEndEvent Link to comment Share on other sites More sharing options...
Recommended Posts