Best way to get Quest Counter from script at Realtime

Announcements, support questions, and discussion for Quest Machine.
Post Reply
TrueHumanSoul
Posts: 6
Joined: Thu Nov 30, 2023 10:00 am

Best way to get Quest Counter from script at Realtime

Post 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?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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");
Post Reply