Dakpyro2 Posted June 22, 2016 Share Posted June 22, 2016 (edited) So, I'm trying to make it so that when a dialogue option in my quest is selected, an actor's sneak skill has five added to it, and then a debug notification runs showing the current sneak stat. The dialogue itself works, but the event does not. I cannot use a papyrus fragment in this instance because I need to reference a specific instance of an Actor. Here's my script, which is attached to the last info in my branch. I'll also attach some pictures of my dialogue setup. I cannot for the life of me figure out why the script will not run, so I'd appreciate any input. Scriptname ChooseSneak extends TopicInfo Actor Property debugApprentice Auto EVENT OnEnd(ObjectReference akSpeakerRef, bool abHasBeenSaid) float CheckSneak = debugApprentice.GetActorValue("sneak") debugApprentice.SetActorValue("sneak", CheckSneak + 5) debug.notification("Sneak is now " + (debugApprentice.GetActorValue("sneak") As String)) ENDEVENT http://i1097.photobucket.com/albums/g358/Tim_Finnegan/debugging%202_zpslsk7aotx.pnghttp://i1097.photobucket.com/albums/g358/Tim_Finnegan/debugging%203_zpsjytgdzuz.pnghttp://i1097.photobucket.com/albums/g358/Tim_Finnegan/debugging1_zpsbrzdqy2v.png Edited June 22, 2016 by Dakpyro2 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 22, 2016 Share Posted June 22, 2016 Dialog uses script fragments rather than a full fledged script. This allows you to use scripting in both the Begin and End portions of the dialog and for them to be automatically combined into a single script file by the Creation Kit. Going by memory so its possible some steps have been omitted:Remove the script that you added.Put a placeholder in the papyrus fragment box underneath End: ;on end code placeholderCompile that and a script will be created.Click the advanced tab and you should see several more buttonsClick the button for properties, add the property that you needClick the papyrus fragment tab and add the following: float CheckSneak = debugApprentice.GetActorValue("sneak") debugApprentice.SetActorValue("sneak", CheckSneak + 5) debug.notification("Sneak is now " + (debugApprentice.GetActorValue("sneak") As String)) Click compileClick OK to close out of your open records, save your plugin and test it. Link to comment Share on other sites More sharing options...
Dakpyro2 Posted June 22, 2016 Author Share Posted June 22, 2016 (edited) Dialog uses script fragments rather than a full fledged script. This allows you to use scripting in both the Begin and End portions of the dialog and for them to be automatically combined into a single script file by the Creation Kit. Going by memory so its possible some steps have been omitted:Remove the script that you added.Put a placeholder in the papyrus fragment box underneath End: ;on end code placeholderCompile that and a script will be created.Click the advanced tab and you should see several more buttonsClick the button for properties, add the property that you needClick the papyrus fragment tab and add the following: float CheckSneak = debugApprentice.GetActorValue("sneak") debugApprentice.SetActorValue("sneak", CheckSneak + 5) debug.notification("Sneak is now " + (debugApprentice.GetActorValue("sneak") As String)) Click compileClick OK to close out of your open records, save your plugin and test it.Ah, so you CAN use properties in script fragments. I guess this was an issue with my own ignorance in terms of the Creation Kit. What's the purpose of OnEnd or OnStart, then? The wiki says that they're used to run a script when dialogue starts or ends. Why won't those work, when the fragments do? Also, I appreciate your helpfulness! Edited June 22, 2016 by Dakpyro2 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 22, 2016 Share Posted June 22, 2016 OnStart and OnEnd are events added to Papyrus with Fallout 4. They are not in the Skyrim version of Papyrus. At least that is my guess based upon looking at the following:Fallout 4 scripting referenceSkyrim scripting reference If you scroll down to the listing of functions and events, you'll find OnEnd and OnStart in the Fallout 4 version but not in the Skyrim version. Link to comment Share on other sites More sharing options...
Dakpyro2 Posted June 22, 2016 Author Share Posted June 22, 2016 Dialog uses script fragments rather than a full fledged script. This allows you to use scripting in both the Begin and End portions of the dialog and for them to be automatically combined into a single script file by the Creation Kit. Going by memory so its possible some steps have been omitted:Remove the script that you added.Put a placeholder in the papyrus fragment box underneath End: ;on end code placeholderCompile that and a script will be created.Click the advanced tab and you should see several more buttonsClick the button for properties, add the property that you needClick the papyrus fragment tab and add the following: float CheckSneak = debugApprentice.GetActorValue("sneak") debugApprentice.SetActorValue("sneak", CheckSneak + 5) debug.notification("Sneak is now " + (debugApprentice.GetActorValue("sneak") As String)) Click compileClick OK to close out of your open records, save your plugin and test it.Ah, so you CAN use properties in script fragments. I guess this was an issue with my own ignorance in terms of the Creation Kit. What's the purpose of OnEnd or OnStart, then? The wiki says that they're used to run a script when dialogue starts or ends. Why won't those work, when the fragments do? Also, I appreciate your helpfulness! Ahhh. That is SOOOOO annoying. A lot of the hyperlinks on the Skyrim page lead to the Fallout 4 page, so I can never tell what belongs to which. Hopefully Bethesda will properly separate the two wikis. Link to comment Share on other sites More sharing options...
Recommended Posts