Hello!
I’ve been having this issue recently where I felt like whenever I script alot of different things in one game, it gets chaotic and messy. I got to learn of different ways to organize code and folders to make things more clean. I also got to learn more about OOP and the use of module scripts to clean up code, but still, I cannot figure out how to properly make good code from the beginning of when I start on new projects.
Usually, when I script a few things and I didn’t make a good system from the beginning of, I start over again. I get burned out of doing that all the time and want a good way to create all features in a game.
What I want is to let all of my scripts be able to communicate with eachother using an underlying framework or something similar. For example, lets say I script a door with a proximity prompt, I have a module script for the door with functions that open/close the door. The door will be an object created using the OOP features of Lua. However, when creating some other feature, I want those other features to be able to communicate with the door system. E.g. open/close a door from a menu in addition to its proximity promt.
Here is what I have tried.
I have tried to make one module script which its sole purpose is to require all the other module scripts I make. The issue with this is that I cannot figure out how to manipulate objects (in my case, i cannot figure out how to access the door object that is already created in a server script at a whole different place)
I hope this all give sense, and I have not been able to figure out how to do this and it has been a real issue to me.