How do I make a game in one place without tripping over my own code

I feel pretty discouraged. I made a game, wanted to make it in one place and then realized I couldn’t due to random bugs that should not even happen.

Basically:
it unloads all maps, and clones a certain map and parents it to a “LoadedMaps” folder. Then, i’d enable all scripts which means i already know what map is loaded. If i didn’t, i’d just do LoadedMaps:GetChildren()[1] (could’ve had a value but whatever it worked) but then i ran into an issue where a cutscene would just not work correctly afterwards. (server script fires a remote for the client script, and after the cutscene ends i clones the script and destroyed it to basically restart it but that made no difference)
how the hell do you not run into problems? i’ve already split the game and it’s probably too late to go back now.

3 Likes

I’m working on a project that has 16567 lines of code currently, and contains 5 huge puzzle components. I mean my code isn’t super efficient (working on doing that condensing though), but its how I organize it which has helped me.

For example, I have a remote event that controls cameras position for solving puzzles, and another system with remote events for a custom tools system. I think about what my game is going to do, and focus on condonsing that and making sure I can read and understand my own code in areas where my scripts will be used a lot!

Personally I try to not disable scripts and re-enable them too much, same with cloning scripts. As you can get in messy situations fast.

Only tip I have is consider reorganizing certain things, and maybe use different methods like for cutscenes and remake that system without any cloning of scripts or re-enabling them. But yes, even I have trouble with organizing, but just even a little bit is extremely helpful.

I mean thats all I got, sorry. I hoped it maybe helped a tad?

2 Likes

I have been dying back then when it comes to developing games and I never think that I’ll be able to successfully make a whole script of a system for my games until I have learned about these effers (for some reason I was under the rock) that saved my life. Consider checking out this too if you’re having variable issues.

It’s all about debugging and figuring out what tons of crap is blocking your code. Don’t give up if it doesn’t go on first try.

2 Likes