Hello! How do I…
Use variables to make a quest system for my game?
What I want to happen
I want to make a quest system revolving variables if possible.
I want the player to be able to:
Talk to the Farmer(NPC)
Dialogue happens.
Player has option to accept or decline quest.
If he accepts, he gets a dialogue saying “Thank you” or something. (I also want this to be permanently accepted even when I change scenes because when I change scenes, the quest somehow resets. I’m sure this is fixable by variables but I have no idea how they work.)
If he declines, he gets a dialogue saying “Ah… well, come back whenever you want.”
Once quest is accepted, I want to make a game mechanic where player goes near the TrashSprite, presses E and then a big version of the TrashSprites fades into the screen along with two trash bins. On the left, is the RedTrashBin (Biodegradable) and on the right is a GreenTrashBin(Non-Biodegradable). I want the player to click LMB to throw trash into RedTrashBin and RMB to throw trash into GreenTrashBin. If player gets it right, it gets Tween animated into the supposed TrashBin and if they get it wrong the screen shakes and there’s a yellow outline that pops the tell them they got it wrong.
What I’ve tried before
I tried using the yarn system to make a quest, but I just can’t seem to connect Yarn into the actual quest mechanic which is said above.
“FarmerQuestDialogue” Node:
<<if $FarmerQuest1 == true>>
NPC
Did you finish sorting that trash yet?
[[Yes!|CropsDone]]
[[Not yet.|CropsNotDone]]
else
NPC
Hey kid! Did you read your “Grandmother’s Note”?
Player
Yeah, I did!
NPC
I see.
NPC
For a while now, these other kids in the neighborhood have been leaving trash near my crops.
NPC
I just need you to help pick those trash up and sort them into their respective trash bins.
NPC
Do you think you could do that for me?
[[Help.|FarmerAcceptQuest]]
[[Don’t help.|FarmerDeclineQuest]]
endif
“FarmerAcceptQuest” Node:
<<set $FarmerQuest1 = true>>
NPC
Thank you so much, Player!`
“FarmerDeclineQuest” Node:
NPC
Oh… well, come back if you change your mind.
“CropsDone” Node:
<<if $FarmerQuest1solved == true>>
NPC
Ahh… It’s a lot cleaner now.
NPC
I can finally work on planting the crops, thank you.
else
NPC
Please finish sorting and cleaning the trash, you might be late to your class.
endif
“CropsNotDone” Node:
NPC
Please finish sorting and cleaning the trash, you might be late to your class.
-Sorry, I had to remove <<>> for the post because it doesn’t show for some reason-
Related screenshots
P.S.
I really need this for my Capstone Project so I need help! TvT
