Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Request: GetCurrentConversation - script function to return the currently active conversation

prwoprwo Member Posts: 65
edited May 2018 in Builders - Scripting
To my knowledge, there is no way to query the dialog (conversation) that is currently running.

There is a way to provide the desired dialog ResRef in BeginConversation and ActionStartConversation (overriding the default one set in the toolset), but there is no way to read out this provided ResRef or the defaulted one (in general: the one that is to be started or effectively already running), e.g. in the OnConversation script or in any script that is called from within the running conversation.

I'd like to request a function like this:
// * Returns the conversation ResRef oObject is currently in. Returns "" if oObject is currently not in a conversation. string GetCurrentConversation (object oObject)

This way a script could distinguish which conversation it is currently in and make choices depending on it.

Post edited by prwo on

Comments

  • antirelicantirelic Member Posts: 20
    Is there some reason you couldn't just set a local string called "currentconversation" with the convo resref each time you launch a convo dialogue?

  • prwoprwo Member Posts: 65
    Yes: that workaround would only work for manually overriden dialogs (when you already know the ResRef "outside" of the dialog before you script the commands to launch it using ActionStartConversation or BeginConversation), but not if the dialog is defaulted (e.g. when the PC clicks on an NPC).

    So you would have to implement another workaround to retrieve default dialogs, since, to my knowledge, there is no way to read out a creature's set Conversation either.
    -> Well, this would ask for another pair of useful functions:
    // * Returns the conversation that is currently assigned to oObject. string GetConversation (object oObject) // * Assigns a new conversation oObject. string SetConversation (object oObject, string sResRef)


    Maybe the second paragraph in my initial post was misleading: "There is a way to provide the desired dialog ResRef in BeginConversation and ActionStartConversation (overriding the default one set in the toolset), but there is no way to read out this provided ResRef". -> Actually I want to read out the dialog independently on how it was set. I corrected this in the initial post.

Sign In or Register to comment.