Page 1 of 1

There's something wrong with the subtraction of counters

Posted: Fri Jan 14, 2022 7:11 am
by startfromzero
I set up a counter for a task that uses messages to add or subtract. "Modify by parameter" is used to set the conditions for receiving A message to increase by 1 (the parameter is 1) and receiving B message to decrease by 1 (the parameter is -1). The initial value is 1 and the condition is reduced to 0 or below. The increase was fine, but the decrease never took effect. I changed "modify by parameter" to "set to parameter" and the condition passed.

I checked it so many times that I didn't know what was wrong, and it bothered me.

Re: There's something wrong with the subtraction of counters

Posted: Fri Jan 14, 2022 7:50 am
by startfromzero

I found that if the automatic start parameter is the same as the one set in the counter, the task will increment the count at the same time it starts, which is not what I want. What I want is for the first message to trigger the task to start and for the messages after that to increment the count.

I need some help

Re: There's something wrong with the subtraction of counters

Posted: Fri Jan 14, 2022 9:20 am
by Tony Li
Hi,

Is this your current question?
startfromzero wrote: Fri Jan 14, 2022 7:50 amI found that if the automatic start parameter is the same as the one set in the counter, the task will increment the count at the same time it starts, which is not what I want. What I want is for the first message to trigger the task to start and for the messages after that to increment the count.
If you have other questions about this, please let me know. For now I'll assume your question is that, when the quest automatically starts, you want the counter to start at zero.

To do that, add a Set Counter Value action to the quest's States > Active > Actions to set the counter value to zero. If you prefer, you can add the Set Counter Value action to the Start node.

Re: There's something wrong with the subtraction of counters

Posted: Fri Jan 14, 2022 8:04 pm
by startfromzero
If do this, the mission is an immediate success.Because the conditions for success are zero or less.
To avoid immediate success, I set the initial value to 1.what I want is that counter to start at 1.And I tried what you said, and it still didn't work.
Looks like "Set Counter Value to one" was executed first,then increment the counter.So it's still going to be 2.

Re: There's something wrong with the subtraction of counters

Posted: Fri Jan 14, 2022 11:54 pm
by Tony Li
I'll give this some thought and get back to you. It's an unusual setup.

Re: There's something wrong with the subtraction of counters

Posted: Sat Jan 15, 2022 12:28 am
by startfromzero
look forward

Re: There's something wrong with the subtraction of counters

Posted: Sat Jan 15, 2022 9:54 am
by Tony Li
Hi,

Import this package and add a "Reset Counter" quest action to the Start node's True section:

QM_ResetCounterQuestAction_2022-01-15.unitypackage

Select your counter and set the value to 1.