Hello, I’ve been developing my game for almost two years now and the code has become quite massive.
I regularly come up against a major, annoying problem: I find myself having to keep correcting code that’s been affected by misclicks and other accidental changes.
Just as with scene objects, it would be great to be able to lock groups of events or lines of code to protect them from accidental changes.
It’s really frustrating to realise, some time later, that code has been changed by accident… Last time, I actually deleted some code by mistake and spent hours recreating it. That wouldn’t have happened if the code had been locked.
Thank you very much for reading !
FR :
Bonjour, je crée mon jeu depuis presque 2 ans et le code est devenu assez titanesque.
Je rencontre régulièrement un gros problème désagréable : je recorrige du code qui a fait l’objet de miss-click et d’autres mauvaises manipulations.
Au même titre que les objets de scène, ce serait bien de pouvoir verrouiller des groupes d’évènements ou des lignes de codes pour les protéger des manipulations involontaires.
En effet, c’est très embêtant de constater X temps plus tard que du code a été modifié involontairement… La dernière fois, j’ai carrément supprimé du code par erreur et j’ai passé des heures à le recréer. Cela ne serait pas arriver si le code avait été verrouillé.
You can simply collapse the parts that are finished into an event group. That prevents you from accidentally deleting anything.
Alternatively, you can create external events separately and simply call them up in the desired scene. This is particularly useful for games with many levels, as it allows you to easily call up recurring snippets in any scene you like—for example, by creating the controls as a separate external event and then simply calling that event within a specific level. It saves a lot of code.
Hello, I understand what you’re saying and I’m already doing all that, but despite that, I sometimes still make mistakes when editing. Or sometimes I even confuse my code with other similar lines.
I think my idea of locking code and using a colour to indicate locked code would be a big plus.
That could have advantages here and there. Personally, however, I would always use external events for larger, self-contained code sections—rather than putting them directly into the scene’s code. That way, you can effectively reuse the code by initializing it in any scene you want. Just a tip: it makes the scene code much cleaner and easier to manage.
people tend to start arguments here whether they intended to or not, so i think you should stop here. Its a valid feature request, and this argument could go on forever without any resolution. its a feature request, either it gets added or it doesnt
I don’t know how much I’d use this feature but I think it’s worth considering. I really don’t like it that the toggle disabled shortcut is D. In my mind I get it confused with Delete which somewhere in GD history used to be triggered by … the D key for something, can’t remember what. For me it would make sense to be something else or even the J key which is what we use to invert things.
Anyway, moving on, about three times in the last week I have accidentally deleted a folded event group instead of disabling/re-enabling it. If it hadn’t been a group with its colour heading, and instead just a normal event, I might not have even noticed the visual change to the screen when it got deleted.
Also, I really don’t understand when people reply that it’s a good idea but they don’t give it a heart. It makes the request look like very few people are interested in supporting it unless the dev team read through everything thoroughly. Right now it has two hearts, one from me and one from a person who hasn’t posted here.