Jump to content

Dialogue OnEnd event not running.


Dakpyro2

Recommended Posts

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.png
http://i1097.photobucket.com/albums/g358/Tim_Finnegan/debugging%203_zpsjytgdzuz.png
http://i1097.photobucket.com/albums/g358/Tim_Finnegan/debugging1_zpsbrzdqy2v.png
Edited by Dakpyro2
Link to comment
Share on other sites

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 placeholder

Compile that and a script will be created.

Click the advanced tab and you should see several more buttons

Click the button for properties, add the property that you need

Click 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 compile

Click OK to close out of your open records, save your plugin and test it.

Link to comment
Share on other sites

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 placeholder

Compile that and a script will be created.

Click the advanced tab and you should see several more buttons

Click the button for properties, add the property that you need

Click 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 compile

Click 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 by Dakpyro2
Link to comment
Share on other sites

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 reference

Skyrim 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

 

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 placeholder

Compile that and a script will be created.

Click the advanced tab and you should see several more buttons

Click the button for properties, add the property that you need

Click 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 compile

Click 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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...