#how would I go about making a quest system just the main componets?
30 messages · Page 1 of 1 (latest)
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
yeah, modules are a great way to handle quest stuff
yea I was thinking they would be
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
yea I was just wondering how would I make the game know what script the player is on?
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:
ah ok
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
yea
man module scripts are so nice
you can just change values without having to dig through lines of code
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?
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
yep
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