Garry's Mod

Garry's Mod

Quest and dialogue system (with in-game editor!)
Denneisk 2022 年 10 月 28 日 下午 7:25
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://psteamcommunity.yuanyoumao.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://psteamcommunity.yuanyoumao.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://psteamcommunity.yuanyoumao.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://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2881271227
    https://psteamcommunity.yuanyoumao.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://psteamcommunity.yuanyoumao.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://psteamcommunity.yuanyoumao.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://psteamcommunity.yuanyoumao.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.
最后由 Denneisk 编辑于; 2022 年 10 月 31 日 上午 8:14
< >
正在显示第 1 - 15 条,共 18 条留言
Thanks! i was wondering how to do the shop like they did in the video.
Denneisk 2022 年 10 月 28 日 下午 7:55 
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  [开发者] 2022 年 10 月 28 日 下午 8:16 
the "shop" in the video enables certain dialogue lines after you collect items
T639493 2022 年 10 月 29 日 上午 7:37 
How do i exactly make him a merchant?
Denneisk 2022 年 10 月 29 日 下午 4:32 
引用自 MONOLITH
How do i exactly make him a merchant?
By not making him a quest-giver.
T639493 2022 年 10 月 30 日 上午 6:24 
引用自 Denneisk
引用自 MONOLITH
How do i exactly make him a merchant?
By not making him a quest-giver.
Alright, got it.
Willybeater16 2022 年 10 月 31 日 上午 1:58 
how do i make a merchant though
Mertt 2022 年 10 月 31 日 上午 4:58 
how to see my reputation?
Denneisk 2022 年 10 月 31 日 上午 6:24 
引用自 Irvin
how do i make a merchant though
引用自 Denneisk
By not making him a quest-giver.



引用自 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.
DUD3_P0ST4L 2022 年 11 月 4 日 下午 5:46 
E
Terolinx 2022 年 11 月 27 日 下午 4:56 
how do you exactly make quests repeatable?
Terolinx 2022 年 11 月 27 日 下午 5:39 
nevermind
ArlieBBoy 2022 年 12 月 9 日 下午 7:29 
Your a LEGEND!
anewpickaxe 2023 年 7 月 12 日 下午 11:46 
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 2023 年 7 月 31 日 下午 8:49 
how to pay darkrp money ?
< >
正在显示第 1 - 15 条,共 18 条留言
每页显示数: 1530 50