• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - D&D Scripts keep disappearing

Hello everyone,

Huge newbie here, literally just started today so please, talk to me like I'm stupid so I understand :D

I've been following Slyddar's tutorials on Youtube to make a game on GameMaker and, at some point, it is recommended to cut/paste your lines of code you've written in your object into scripts so you can easily use them for other objects (sounds legit).

So I did that, except that everytime I create a new script and paste the code into it, what I pasted into the previous script gets deleted, it says it is empty after the "Declare a new function". From what I understand, there was an update where you had to paste your code next to the new function instead of under, so that's what I did and I thought it'd solve the problem, but after rewriting my code for the 4th time, it's gone again! The only one left is the last script I pasted and now my game doesn't work (obviously).

I don't know what I'm doing wrong and I'm getting tired of having to rewrite code all the time. Is there maybe a magic save button I just haven't noticed that locks in my scripts? If someone has an answer to this, I would really appreciate it because I'm this close to tearing my hair out...

Thank you everyone!
 

Attachments

Slyddar

Member
I've been following Slyddar's tutorials...
Same problem here. Scripts always disappearing. Even I saved the project frequently.
Hey guys,

Yes it's a current known bug with DnD. I've logged a job on it and Yoyo have acknowledged the bug. It's very frustrating as whole scripts can get deleted when you rename, or create a new script, and since Gamemaker saves at that point as well, you can't even go to the source files and retrieve, they are just gone. The good news is it is fixed in the current beta, as noted in this patch note.

  • DnD Editor: Renaming a script file will erase the contents of the script if Declare node's name still matches the script name

If you don't have access to the beta, the only thing I can say is maybe duplicate your scripts as you work with them, so if it happens you can get your code back through the copy. Or just work around the problem as mentioned in the fix above. It's a bug that has stopped me making more DnD tutorials for now, as it really messes with your workflow to have scripts vanish. When the current Beta gets released as Retail we should be back in business though.
 
Top