Page 1 of 1

Best way to get Quest Counter from script at Realtime

Posted: Tue Apr 02, 2024 1:13 pm
by TrueHumanSoul
Good day!
Can you give me an advice, how can I get my Counter value from script on Realtime?

I`m creating my own delivery system and I want to know, how much supply was already delivered, so I can place on my character only cargo that was left. For example, I need to deliver 7 crates, but my character can take only 3 at the time, also he can left it or lose it. So "Delivery" zone must know, even after "Save and Load", how much crates was already delivered, so the last turn it gave only 1 crate instead of 3. (7 = 3+3+1)

I tried to use Quest.GetCounter, but it was always zero, which link I should use to make it work?

Re: Best way to get Quest Counter from script at Realtime

Posted: Tue Apr 02, 2024 7:22 pm
by Tony Li
Hi,

If the player can pick up and drop items from their inventory system, I recommend getting the count from your inventory system instead of from a quest counter. However, to get a quest counter value, use QuestMachine.GetQuestCounter(). For example:

Code: Select all

int numCarrots = QuestMachine.GetQuestCounter("harvestCarrots", "carrots");