Best practiecs to change variables mid-dialogue.
Posted: Fri Jul 04, 2025 8:03 pm
Hi, after going through the documentation, I can't seem to find a simple or straightforward way to accomplish this, that or my constant browsing is confusing me, so I figured it would be easier to ask here, also, I think I found a post trying to accomplish something similar, but it's around 6 years old, so I would like to know if a newer, more convenient solution is available now.
So, I'd want to be able to change a variable during a conversation, or to accomplish the same effect, run an arbitrary method mid-sentence while the type-writer effect is printing characters.
For example:
Variables: Pitch, default value = 0
Dialogue Text: Hello friend, ["Pitch" = 1 ] turns out I'm really happy!, ["Pitch" = 0 ] how about you?
Here I'd want to change the Variable Pitch mid-dialogue so that another piece of code elsewhere could adjust the actual pitch of the sound being played, it doesn't necessarily need to change the Variable as I could do that directly via a custom function, but I'm also unsure if calling an arbitrary function like that is possible.
I've looked into sequence messages and something like "SetVariable(Pitch, 1)@Message (happy);" could work, but again, I am unsure on how to call said message from the Dialogue Text.
Any other approach or suggestions are welcomed, I feel I'm over-complicating things or missing something crucial here.
So, I'd want to be able to change a variable during a conversation, or to accomplish the same effect, run an arbitrary method mid-sentence while the type-writer effect is printing characters.
For example:
Variables: Pitch, default value = 0
Dialogue Text: Hello friend, ["Pitch" = 1 ] turns out I'm really happy!, ["Pitch" = 0 ] how about you?
Here I'd want to change the Variable Pitch mid-dialogue so that another piece of code elsewhere could adjust the actual pitch of the sound being played, it doesn't necessarily need to change the Variable as I could do that directly via a custom function, but I'm also unsure if calling an arbitrary function like that is possible.
I've looked into sequence messages and something like "SetVariable(Pitch, 1)@Message (happy);" could work, but again, I am unsure on how to call said message from the Dialogue Text.
Any other approach or suggestions are welcomed, I feel I'm over-complicating things or missing something crucial here.