Hi, I want to have a system where:
1. Conversation for player and NPC to negotiate for an item
2. Player has to key in a price
3. Conversation continues depending on whether it is too low/high
I have a Continue()@Message(NegotiationContinue)
This will then check against two nodes using a Success boolean.
Right now, in my script I have:
DialogueLua.SetVariable("Success", true);
Sequencer.Message("NegotiationContinue");
But using the debugger, it seems like the Sequencer is running a continue BEFORE the DialogueLua.SetVariable
I expected:
1. Success bool = true
2. Sequencer message to continue
3. Proceed to "Okay, that will do."
but instead it was:
1. Sequencer message to continue
2. Proceed to "That is too expensive."
3. Success bool = true
4. Linked back to empty node
5. Proceed to "Okay that will do."
Any workaround/correct usage for this?
Race condition for SetVariable and Sequencer.Message
-
- Posts: 2
- Joined: Wed May 12, 2021 10:55 am
Race condition for SetVariable and Sequencer.Message
- Attachments
-
- dialoguesystem1.png (607.37 KiB) Viewed 138 times
Re: Race condition for SetVariable and Sequencer.Message
Hi,
Add an empty node between node 3 and the two conditional nodes.
See: Conversations Evaluate Conditions One Extra Level Ahead
Add an empty node between node 3 and the two conditional nodes.
See: Conversations Evaluate Conditions One Extra Level Ahead
-
- Posts: 2
- Joined: Wed May 12, 2021 10:55 am
Re: Race condition for SetVariable and Sequencer.Message
That worked! Thank you!
Re: Race condition for SetVariable and Sequencer.Message
Glad to help!