How to change boolean variable at runtime through script?
Posted: Tue Apr 22, 2025 11:51 am
Hello,
I'm currently implementing a mechanic where the player can choose a card from their collection during a conversation. This temporarily switches to a separate conversation, which immediately branches based on if the card played was right for the active dialogue node at the time. This is done by comparing two strings; the chosen card's name and a custom CardRequired field in the node. If the strings match, variable CorrectCardChosen should become true, which enables one dialogue link and disables another. If the strings don't match, the variable stays false and directs to another dialogue node.
My problem is that I'm unable to change the variable which does the branching at runtime. I attempted to change this via the code attached below, and can confirm via Variable Viewer that not changing the bool is where the process stops.
What might I be doing wrong?
I'm currently implementing a mechanic where the player can choose a card from their collection during a conversation. This temporarily switches to a separate conversation, which immediately branches based on if the card played was right for the active dialogue node at the time. This is done by comparing two strings; the chosen card's name and a custom CardRequired field in the node. If the strings match, variable CorrectCardChosen should become true, which enables one dialogue link and disables another. If the strings don't match, the variable stays false and directs to another dialogue node.
My problem is that I'm unable to change the variable which does the branching at runtime. I attempted to change this via the code attached below, and can confirm via Variable Viewer that not changing the bool is where the process stops.
What might I be doing wrong?