How to build a quest system

Hello, I now have 4 months of experiance and I would like to focus on complex systems, I would like to start with the quest system but I can not build it in my head
if anyone can give me an idea of how to build it!

  • How to build a quest system
  • I DON’T ASK TO BE DONE TO ME! I just want to know a little how to build the systeme

Thanks !

1 Like

Nice!

Okay lemme try to lay something out.

So first I’d suggest having a ModuleScript to uh make and hold quests like this for example:

local Quest = {}
Quest.__index = Quest

function Quest.new(player)
   local self = setmetatable({}, Quest)
   self.__index = Quest
   self.Player = player
   return Quest
end

function Quest:Complete()
   -- how you’d handle stuff here
end

Then you should store the amount of quests completed by the player in a datastore.

Now you’re gonna have to do the above of use another method because quests are usually not completable again (in a lot of games) like a cutscene that only shows up once.

Or an item you can only use once… so you can’t just do some verification like that

3 Likes

I don’t have a lot of experience but I’ve just been using the dialog choice to trigger certain stages in progression. I use a table to indicate what dialogs are left in the quest.

2 Likes

ohhh good Thanks for your reply !! (ps: i’m french devlopper lol)

I use that of 5uphis, to put all the Quete accomplished I must give it a name as well as put it in a table (in the dataBase)

1 Like

Thanks for your reply ! Yes the quest dialog its a realy good choice !

2 Likes
local Quest = {}
Quest.__index = Quest

function Quest.new(player: Player, name: string)
   local self = setmetatable({}, Quest)
   self.__index = Quest
   self.Player = player
   self.Name = name
   return Quest
end

function Quest:Complete()
   -- how you’d handle stuff here
end
1 Like

Oh nice Suphi has a good data module

Try it yourself and see how far you can get!

2 Likes

You’re a super cool perssone, I hope you go far! I will train to make this system and I will post a post to show what I managed to do

1 Like

Just had a question, the “player” is to assign the quest to the player?

1 Like

Yep, but you don’t have to do that if you don’t wanna

Thanks! And yeah I’ll prolly see it since I’m on here a lot

1 Like

If i have a ask can i ask you ?