Skip to content

Conversation Parameters and PW?

Gooday to ya,

Is it safe to use Conversation Parameters in a Persistent World Module?

Thank you for your time,

DJ-WoW

Comments

  • MelkiorMelkior Member Posts: 204
    If you mean Custom Tokens, then you need to remember that they are module-wide, so they can be problematic if more than one conversation using the same tokens can be active at the same time.
    What you need to do is find a way to make tokens unique to each conversation, which generally means you have to write a new conversation file which uses different Custom Tokens for each NPC, even if the conversation is otherwise identical.
  • DJ_WoWDJ_WoW Member Posts: 51
    Gooday to ya,

    I was thinking about the scripts with GetScriptParam and variables set in the individual nodes. I see if someone exits the conversation or escapes out of it Parameter scripts might be left in place. Could this bleed into another PC's, or the PC who exited the conversation only to renew it again Conversation, tainting their data.

    Thank you for your time,

    DJ-WoW
  • MelkiorMelkior Member Posts: 204
    I haven't used the script parameters enough to comment on that. Hopefully, someone else who has more experience will comment.
  • ProlericProleric Member Posts: 1,316
    edited November 2023
    As I understand it, parameters set in conversation (or script) only persist for the next script instance called. So, for example, if plsyer 1 in conversation C sets parameter P before calling script S1, then S1 calls S2, P has a value in S1 but is undefined in S2.

    If player 2 starts a different instance of conversation C, P is undefined unless C assigns a value, which need not be the same as the first player's.

    I'm no expert on PW, but I can't see a case where using parameters could lead to conflict.

  • DJ_WoWDJ_WoW Member Posts: 51
    Gooday all,

    Wanted to thank you for your insightful info. It is greatly appreciated.

    DJ-WoW
  • ForSeriousForSerious Member Posts: 466
    edited November 2023
    When I first started using conversation parameters, I remember something giving me the idea that they would be stored in some global stash and any next script would try to use them.
    That seems like a very bad design.
    I'm guessing that that is not how it works. More likely they are limited to the scope of the conversation. So just like SetScriptParam passes the param only to the next call of ExecuteScript or ExecuteScriptChunk within the same script, it won't 'bleed' to another conversation going on elsewhere the the PW.

    I would not be surprised if the conversation params are just a wrapper script that adds a SetScriptParam for the parameter and then calls ExecuteScript.
Sign In or Register to comment.