Benjy D Posted March 10, 2025 Posted March 10, 2025 I am new to scripting so I'm hoping that anyone can share a bit of your wisdom on this issue I am having. I for the life of me cannot figure out how to trigger one of my functions in my mainscript at the end of the end of some dialogue. When I try to add my dialogue fragment to the end of my dialogue, creationkit autogenerates a TIF file, which prevents my added fragment from firing. But, if I edit the TIF file directly, then I am unable to correctly set up some required property definitions. Here is the function in my main script that I am trying to trigger at the end of dialogue... Function IntroDialogueEnd() Debug.Trace("[SexlabCollegeResearch] IntroDialogueEnd, starting up function") [This debug.trace does not show up in papyrus logs] Utility.Wait(1.0) ResearcherWalkAway() Utility.Wait(3.0) StartSexScene() Debug.Trace("[SexlabCollegeResearch] IntroDialogueEnd, StartSexScene fired") EndFunction And here is my fragment... ;BEGIN FRAGMENT CODE - Do not edit anything between this and the begin comment ;NEXT FRAGMENT INDEX 1 Scriptname SexlabCollegeResearchDialogueIntroEnd Extends TopicInfo Hidden ;BEGIN FRAGMENT Fragment_0 Function Fragment_0(ObjectReference akSpeakerRef) Actor akSpeaker = akSpeakerRef as Actor ;BEGIN CODE SLCR.IntroDialogueEnd() Debug.Trace("[SexlabCollegeResearch] Fragment DialogueIntroEnd triggered") [This debug.trace also does not show up in papyrus logs] ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment SexlabCollegeResearchQuestScript Property SLCR Auto And my reference script... Scriptname SexlabCollegeResearchQuestReference extends Quest SexlabCollegeResearchRoomQuestScript Property SLCR Auto I have scoured the internet, even tried using Google Gemini and Chatgpt, and I am unable, at the end of a dialogue, to trigger a function that is in my main script. Any wisdom or insight would be greatly appreciated. Thank you.
traison Posted March 10, 2025 Posted March 10, 2025 1 hour ago, Benjy D said: creationkit autogenerates a TIF file Unless the extension is tif, it's not a tif file. "TIF" in the file name probaly stands for TopicInfo Fragment. 1 hour ago, Benjy D said: which prevents my added fragment from firing Where did you get that from? 1 hour ago, Benjy D said: But, if I edit the TIF file directly, then I am unable to correctly set up some required property definitions. All the CK GUI does is write code. You can write the same code outside of the CK, usually ten times faster too. The only thing you can't do from outside the CK/xEdit is link script fragments to code functions. 1 hour ago, Benjy D said: And here is my fragment... ..and what does the Papyrus log have to say about this?
Swe-DivX Posted March 12, 2025 Posted March 12, 2025 In the next topic dialog box in CK, when CK generates the TIF file so start by just adding ; and then wait until CK has generated the script file. After that rename the file to your mod name and then formID MyMod_0x3434.pcs. After that you should restart CK. Now you can add properties to the topic. Sometimes CK bugs and properties are added but they don't show up. The problem is that the file is not created correctly when CK is run virtually. Do you know how to create the Properties in the topic?
traison Posted March 12, 2025 Posted March 12, 2025 6 hours ago, Swe-DivX said: After that rename the file to your mod name and then formID MyMod_0x3434.pcs. After that you should restart CK. Now you can add properties to the topic. That is assuming it can relink the script file to the topic. Renaming the file will break the link between the topic and the script fragments. This can be fixed easily in xEdit obviously, but I'm assuming we want to stick to the CK here. 6 hours ago, Swe-DivX said: Sometimes CK bugs and properties are added but they don't show up. In this case though the properties seemed to be there in the script. As long as the SLCR property is assigned, the script above should work. There is however one problem with it, and that is that the trace comes after the call to IntroDialogueEnd. This is why I said "what does the Papyrus log have to say about this". The trace wouldn't show up in the log like the OP said, if there was an issue with calling IntroDialogueEnd.
Swe-DivX Posted March 12, 2025 Posted March 12, 2025 1 hour ago, traison said: That is assuming it can relink the script file to the topic. Renaming the file will break the link between the topic and the script fragments. This can be fixed easily in xEdit obviously, but I'm assuming we want to stick to the CK here. CK will update the esp for you. Quote In this case though the properties seemed to be there in the script. I think this is a simple fix in the esp. It dose not connect the script property to the correct value.
MTB Posted March 13, 2025 Posted March 13, 2025 Not sure the comments of Swe-DivX and traison above already solved it for you & sorry if below is things you already know/tried but I'll add my 2cents just in case: I'm assuming by `your main script' you mean a SexlabCollegeResearchRoomQuestScript script placed on a quest called SexlabCollegeResearchRoomQuest if not adjust as needed. Open your topic & create a topic script: put ; in the topic-end box and compile so a script is created as Swe-DivX mentioned. (The TIF_... thing.) You can choose advanced - change name to rename the topic script to something more recognizable, such as SexlabCollegeResearchDialogueIntroEnd, if you want as Swe-DivX also mentioned. (So use the CK function to rename the script, renaming the file outside the CK will break the link as traison mentioned. Also make sure the file you rename to does not already exist.) Add a link to SexlabCollegeResearchRoomQuest Choose `add property', In type field put : SexlabCollegeResearchRoomQuestScript , in name field put : SexlabCollegeResearchRoomQuest The CK will auto fill with this quest. Now you can put: SexlabCollegeResearchRoomQuest.IntroDialogueEnd() in the topic-end box. Compile and you should be good to go. If the topic is actually on the SexlabCollegeResearchRoomQuest you don't need the property and can just use: (GetOwningQuest() as SexlabCollegeResearchRoomQuestScript).IntroDialogueEnd() Side remark - Sometimes if things are newly created you need to close the windows and reopen it first for things to take effect-some things the CK only does in memory so it can undo it if you press cancel...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now