DairyProduct92 Posted May 22, 2020 Share Posted May 22, 2020 (edited) I'm trying to make an addon for a long-abandoned mod. Specifically, I want to take some functions and properties introduced in that mod's scripts and utilize them at the end of certain dialogue options. There is another mod that does the same thing, so I used champollion to decompile that mod's fragments so I might have an idea of how to go about it myself. What is confusing me though, is that I'm not quite sure how to reference the scripts containing the functions/properties I need. The decompiled source code of the addon I'm using as a reference point looks something like this (with the actual function/property I need replaced with [function] and [property] respectively: ;-- Properties --------------------------------------eventhandlerscript property EventHandlerQuest autoregistryscript property Manager auto ;-- Variables --------------------------------------- ;-- Functions --------------------------------------- ; Skipped compiler generated GetState ; Skipped compiler generated GotoState function Fragment_2(ObjectReference akSpeakerRef) actor akSpeaker = akSpeakerRef as actor EventHandlerQuest.[property] = 2ManagerQuest.[function](akSpeaker, game.getPlayer(), 1) endfunction So it looks to me like it's pulling the functions from the quests in which the desired scripts are attached, but when I try to compile something myself, the CK doesn't recognize "eventhandlerscript" or "registryscript" as a "known user-defined" type. I tried replacing both unknown types with "quest", but the CK wouldn't recognize the property or the function I need, spitting this out: G:\Games\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__02000D73.psc(14,10): [property] is not a property on script quest or one of its parentsG:\Games\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__02000D73.psc(14,9): type mismatch while assigning to a none (cast missing or types unrelated)G:\Games\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__02000D73.psc(15,9): [function] is not a function or does not exist I am super new to scripting, so I'm probably missing something simple and/or horribly misunderstanding something, and I hope I've conveyed enough information for a solution to be apparent. Edited May 22, 2020 by DairyProduct92 Link to comment Share on other sites More sharing options...
ReDragon2013 Posted May 22, 2020 Share Posted May 22, 2020 (edited) You are inside the Skyrim forum. The forum for Skyrim SE you'll find here: https://forums.nexusmods.com/index.php?c=4040,4045wiki pages (browser with cookies enabled!) papyrus: https://www.creationkit.com/index.php?title=Category:Papyrus scripting: https://www.creationkit.com/index.php?title=Category:Scripting the dialog fragment, that you posted: TIF__02000D73 ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment ;NEXT FRAGMENT INDEX 1 Scriptname TIF__02000D73 Extends TopicInfo Hidden ; https://forums.nexusmods.com/index.php?/topic/8735468-pulling-functionsproperties-from-another-script-into-a-dialogue-fragment/ ; filename ; source: "TIF__02000D73.psc" ; executable: "TIF__02000D73.pex" ;BEGIN FRAGMENT Fragment_2 Function Fragment_2(ObjectReference akSpeakerRef) Actor akSpeaker = akSpeakerRef as Actor ;BEGIN CODE ;;; EventHandlerQuest.[property] = 2 EventHandlerQuest.myQuestVar = 2 ;;; ManagerQuest.[function](akSpeaker, Game.GetPlayer(), 1) ManagerQuest.myQuestFunc(akSpeaker, Game.GetPlayer(), 1) ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment EventhandlerScript PROPERTY EventHandlerQuest auto RegistryScript PROPERTY ManagerQuest auto a missing script from mod you need as source: EventhandlerScript Scriptname EventhandlerScript extends Quest ; https://forums.nexusmods.com/index.php?/topic/8735468-pulling-functionsproperties-from-another-script-into-a-dialogue-fragment/ ; filename ; source: "EventHandlerScript.psc" ; executable: "EventHandlerScript.pex" Int PROPERTY myQuestVar auto ; sample [default=0] ; -- EVENTs -- ; -- FUNCTIONs -- a missing script from mod you need as source: RegistryScript Scriptname RegistryScript extends Quest ; https://forums.nexusmods.com/index.php?/topic/8735468-pulling-functionsproperties-from-another-script-into-a-dialogue-fragment/ ; filename ; source: "RegistryScript.psc" ; executable: "RegistryScript.pex" ; -- EVENTs -- ; -- FUNCTIONs -- ;---------------------------------------------------- FUNCTION myQuestFunc(Actor aRef, Actor player, Int i) ; sample ;---------------------------------------------------- ; some code here ENDFUNCTION Edited May 22, 2020 by ReDragon2013 Link to comment Share on other sites More sharing options...
Reneer Posted May 22, 2020 Share Posted May 22, 2020 I was going to post something, but ReDragon2013 has it from here it looks like. :smile: Link to comment Share on other sites More sharing options...
DairyProduct92 Posted May 22, 2020 Author Share Posted May 22, 2020 Ah, sorry for the mix up. I didn't realize I needed source scripts i Data/Source/Scripts, it's compiling now. Link to comment Share on other sites More sharing options...
Recommended Posts