Hi there, I have a background generally in programming and development but am new to Roblox Studio. I'm working currently on something that would require a more detailed set of data per mission to resolve logic correctly, which I've shown below.
In other engines like Godot or Unity I would create a class or the like that would enforce the structure and limit human error from inputs. However, here I have everything inside of a ModuleScript (which is what from what I have seen has been the blanket solution) which I have below. This is a simple mock-up of a mission without any extensive writing for the descriptions, success_text or failure_text.
Just wanting to see what the general best practice is, if there's maybe a better way that I could represent this data that I'm unaware of, and any other advice. Thanks for reading!
local defaultMissionStorage = {
missions = {
["Mission_1"] = {
id = "Mission_1",
name = "Mission 1",
description = "Defeat 10 enemies",
image = "LINK",
options = {
["violence"] = {
name = "Choose Violence",
type = "Might",
required_stat = 5,
success_text = "You won!",
failure_text = "You lost."
},
["peace"] = {
name = "Choose Peace",
type = "Intellect",
required_stat = 5,
success_text = "You won!",
failure_text = "You lost."
},
}
}
}
}
return defaultMissionStorage