Garry's Mod

Garry's Mod

Quest and dialogue system (with in-game editor!)
Denneisk 28 Oct, 2022 @ 7:25pm
Making a shop
So you want to let the player buy things, huh? Well, there's one way you can do it: using the fancy thing called reputation:

quest_list version
  1. Make a Talker that you will not use to give quests. It would look weird for your shop to do both.
  2. Create a dialogue to access quest_list on your merchant.
    https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2881271216
  3. Create quests on the merchant that have a reputation requirement. The reputation will be your currency.
    Make sure the quests are repeatable and that you have set up the rewards properly.
  4. Set the quest to give whatever you want to sell (either as a task or a reward).
  5. Add a timer task in the quest that is 0 seconds long and completes the quest when it ends.
    https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2882544313
  6. Set the quest reward to remove reputation equal to the price you want to sell for. Note: you can only remove up to 999 reputation, so make multiple removes if you need more.
    https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2882544736
  7. That's it! Your shop should now work. Test him out and see how it goes. Make sure to reset the blacklist.
    https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2881271227
    https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2881271235

quest_by_id version
This is similar to quest_list version but allows you to categorize your shop items.
  1. Make a Talker that you will not use to give quests. If your talker is going to give quests, then you will have to use the same quest_by_id tactic to emulate quest_list.
  2. Create quests on the merchant that have a reputation requirement. The reputation will be your currency.
    Make sure the quests are repeatable and that you have set up the rewards properly.
  3. Set the quest to give whatever you want to sell (either as a task or a reward).
  4. Add a timer task in the quest that is 0 seconds long and completes the quest when it ends.
    https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2882544313
  5. Set the quest reward to remove reputation equal to the price you want to sell for. Note: you can only remove up to 999 reputation, so make multiple removes if you need more.
    https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2882544736
  6. Create a dialogue tree with the categories and purchases you want, with quest_by_id pointing to your purchases.
    https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2882566479
  7. That's it! Your shop should now work. Test him out and see how it goes. Make sure to reset the blacklist.
Last edited by Denneisk; 31 Oct, 2022 @ 8:14am
< >
Showing 1-15 of 18 comments
Thanks! i was wondering how to do the shop like they did in the video.
Denneisk 28 Oct, 2022 @ 7:55pm 
Originally posted by Coalition Fortress The 2nd:
Thanks! i was wondering how to do the shop like they did in the video.
I believe the shop in that one is based on quest items. I should see if there's a way to track quest items like money, but I don't think it'd work.
hoobsug  [developer] 28 Oct, 2022 @ 8:16pm 
the "shop" in the video enables certain dialogue lines after you collect items
T639493 29 Oct, 2022 @ 7:37am 
How do i exactly make him a merchant?
Denneisk 29 Oct, 2022 @ 4:32pm 
Originally posted by MONOLITH:
How do i exactly make him a merchant?
By not making him a quest-giver.
T639493 30 Oct, 2022 @ 6:24am 
Originally posted by Denneisk:
Originally posted by MONOLITH:
How do i exactly make him a merchant?
By not making him a quest-giver.
Alright, got it.
Ashot 31 Oct, 2022 @ 1:58am 
how do i make a merchant though
Mertt 31 Oct, 2022 @ 4:58am 
how to see my reputation?
Denneisk 31 Oct, 2022 @ 6:24am 
Originally posted by Irvin:
how do i make a merchant though
Originally posted by Denneisk:
By not making him a quest-giver.



Originally posted by Mertt:
how to see my reputation?
You can't currently, but any quests that you don't have enough reputation for will show up greyed out.
Gu3st_1337 4 Nov, 2022 @ 5:46pm 
E
Terolinx 27 Nov, 2022 @ 4:56pm 
how do you exactly make quests repeatable?
Terolinx 27 Nov, 2022 @ 5:39pm 
nevermind
ArlieBBoy9 9 Dec, 2022 @ 7:29pm 
Your a LEGEND!
anewpickaxe 12 Jul, 2023 @ 11:46pm 
I just found this but for me its not grayed out its whited out,that's not the part im worried about, if theirs one that is wiped than next time i enter i have to reset as it wont let me leave the text as other options are gone and even if i have the requirements.
Lekr0 31 Jul, 2023 @ 8:49pm 
how to pay darkrp money ?
< >
Showing 1-15 of 18 comments
Per page: 1530 50