There’s a lot of scripts that I want to make but what’s holding me back is this constant thought in my head that I’m not exactly sure that I’ll be able to do it without external help and I’ll run into an error that I can’t solve in time which results in me procrastinating. I’m thinking maybe to alleviate this, I’ll just open up a doc and list out everything that I plan for the script and go step by step to layout how exactly it’s gonna work. But I don’t know. Do you plan out your scripts?
Sometimes I do. I don’t usually right them down or type them in notes though. I just think of it and type it.
A good habit is to start with the documentation and then fill in the implementation. This gives you a chance to make sure the functions work together. And, in the end your code is already documented. Plus, studio will show you the comment immediately before each function in the code completion.
This can be something simple like below or you can use a more formal documentation system. I usually start with a short description at the top, document each function by filling in its parameter types and return value, then work through implementing each function.
-- Round System - Handles starting and timing rounds in the game.
-- Initializes the system
local function init() : nil
end
-- Starts a round
-- Requires duration in seconds
-- Returns round index
local function start(duration : number) : number
end
-- Stops a round, requires round index
local function stop(index : number)
end
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.