#how would I go about making a quest system just the main componets?

30 messages · Page 1 of 1 (latest)

lime kayak
#

really depends how you want the quest system to be

keen idol
#

well what I was thinking was like you touch a part then a quest gui pops up telling what the player would do

#

I probably would make a module script for that right?

#
local module = {
    ["Quest1"] = {
        ["Text"] = "Collect 5 grapes, 4 Bannanas, and 7 apples"
    }
}

return module
lime kayak
#

yeah, modules are a great way to handle quest stuff

keen idol
#

yea I was thinking they would be

lime kayak
#

you could have a big module to track whatever in the player - maybe you give certain objectives names like GrapesCollected, then when you collect a grape you +1 to it

keen idol
#

yea I was just wondering how would I make the game know what script the player is on?

lime kayak
#

every time an objective is increased you could call a function which checks whether the quest is complete or not

#

i mean, you can organise it however you want

#

i usually have a PlayerData module that stores all players data like this:

keen idol
#

ah ok

lime kayak
#
local playerData = {}

playerData[player] = {
  Quests = {
   ["Grape Collection Service"] = {
      Progress = {
        GrapesCollected = 5
        BananasCollected = 0
        ApplesCollected = 5
      }
  }
}

return playerData
#

and maybe youd have a separate module for each quest giving the max values, so you can compare it pretty easily

keen idol
#

yea

#

man module scripts are so nice

#

you can just change values without having to dig through lines of code

lime kayak
#

agreed

#

no need to find a bajillion value objects

keen idol
#

also

#

while you are here would making a system to keep track of kills be hard not like the datastore part but like to add the kill?

lime kayak
#

nah it should be pretty straightforward i think

#

id include that in PlayerData personally, but handle it however you want

#

maybe just a 'Kills' dictionary, with the names of enemies as the key and +1 to the value when one is killed

keen idol
#

yep

lime kayak
#

like

local playerData = {}

playerData[player] = {
  Quests = {
   ["Grape Collection Service"] = {
      Progress = {
        GrapesCollected = 5
        BananasCollected = 0
        ApplesCollected = 5
      }
  }
  Kills = {
    ["Ogre"] = 5,
    ["Goblin"] = 1
  }
}

return playerData
#

datastore part would be easy too, since you can just save the kills table directly

#

or the whole playerdata depending on what you have in it

keen idol
#

mhm

#

thank you