[Early Preview] Studio Script Sync

I spoke about this a little above

The answer is, it’s not something we’re working on at the moment. We are thinking about the other content types that could benefit from syncing though.

3 Likes

Hi, I been using this feature for 2 months now. Honestly it feels great, being able to use great tools inside VSCode for developing my game almost seamlessly, I would like to give ideas on some quality life improvements this feature could have:

  • Remember the last path location of the script file.
  • Not overwritting the file when you re-sync the script from an existing file.
  • Make suport for the Next Gen Explorer.

This feature for some reason made coding for me very enjoyable, it’s just those 3 things that could smooth things up a ton even if they are just small.


Potential bug

If you sync the script from Roblox Studio and it has characters like (ó, í, ñ …) the moment it overwrittes the file from resync, those characters become <?> inside VSCode. Like the 2nd picture here:
[Early Preview] Studio Script Sync - #102 by sanosuke298

Thank you for trying it out and giving us your feedback!

Good news, we’re actively working on this! The idea is when you restart Studio, everything resumes syncing.

Our plan here is to ask you if you want to use the file’s contents, or overwrite it when you start syncing. We have a quick mock up for this in the original post under ‘Starting sync from the state on disk, rather than the state in Studio’

Yeah, we’re sorry about this! This one slipped through the cracks. We’ll be fixing this in January but until then you’ll have to disable the Next Gen Explorer to use Script Sync.

2 Likes

Unfortunately, that is a known bug. We have a fix for this, but we didn’t finish it in time for the code freeze. This one will go out in Jan.

2 Likes

I love this, this was one of the main things that was tickling me a little but is good to hear it is being worked.

That’s perfect, I really appreciate the answers. I hope you and the team happy holidays. :heart:

1 Like

Wondering how Script Sync will handle my situation:

I really like and am comfortable with using the Studio text editor. It has improved a lot and now I have no complaints. (And that’s coming from someone who using the paid version of Sublime Text for everyone other than Roblox dev).

What I really want is to be able to use git with scripts created in Studio. Currently I use rbxlx files which are a bit unwieldy, but do work with version control. My team is not a good fit for Rojo, and currently Team Create forces use of binary rbxl files (the option to use rbxlx exists but it just gives you a binary file anyway with Team Create only).

Basically I want a Team Create compatible option that allows me to use git locally for scripts with a nice 100% Studio workflow. At least I think that’s what I want - you tell me!

Edit: when I say 100% Studio workflow just to be clear, I mean everything except local git. Not asking for a Studio git integration. I always prefer git standalone compared to IDE integrations. But the scripting features within Studio are now too good and timesaving (particularly having gotten very comfortable with typed Luau) for me to consider using an external editor for Roblox.

Don’t know if someone’s asked this already, but how would scripts inside scripts sync?
In Studio, I usually put ModuleScripts that will only be used in a script inside of the script, not in another folder. But you can’t put a file inside a file - only a file inside a folder.
I was originally thinking something like every script being its own folder, and it just has a file called “script.luau” in each one. But that’d get confusing very fast.

1 Like

Maybe I am misunderstanding something but why would git not work?

Happy new year :slight_smile: Great question!

Mechanically, all you need to use git for code with an otherwise 100% Studio workflow is an ability to move files bidirectionally between the file system and Roblox Studio. Bi-directionality here is important because to check changes into git, you need changes to move from Studio to disk. And to pull new changes, you need changes to move from disk to Studio.

Studio Script Sync supports syncing in both directions, but currently sync can only be started from the Studio state. That means when you hit ‘Start Sync’, it will overwrite the file on disk with the state in Studio. Additionally, we don’t support syncing folders yet so when a new script was created in a commit you would need to manually create it in Studio before you could sync it. As you can see in the original post, we have plans to address both of these limitations.

However, it sounds like what you are really looking for is a one click ‘commit my script changes to git’ button in Studio. Technically, this could be built as a Studio plugin without involving Script Sync. I wonder if anyone has tried this…

2 Likes

The jury is still deliberating on this one.

Rojo adopts the ‘init.luau’ pattern but there’s some ongoing debate with the Luau language about what ‘pattern’ the language should support.

If you ever wanted to load new changes from git, and you weren’t already syncing, the ability to hit ‘start sync’ and start from the state on disk rather than overwriting the state on disk would save you some manual steps.

One thing that would be usefull, would be a way to export all the scripts (modulescripts, localscript, script) from a project to your disk, while keeping all the folder structures intact. This is so I can more easily upload my scripts to git, so that I can have proper version control.

image

Maybe there should be an export button in the (FILE) menu in advanced where you can export all scripts from the project.

1 Like

I like the idea, but I would also like more than just scripts. We might need to require basic text files and the existing workarounds are fiddly. Being able to load text documents as assets, such as json files, would be very useful. I’d also like some kind of one way sync from VS to studio, with some way of calling the play button via external request. It would be handy for stuff like roblox-ts to write, compile, and execute in a single button.

1 Like

Yesterday we updated our preview of Script Sync to remember the scripts you are syncing when you restart Studio, this should save you a bunch of work re-syncing your scripts each session!

That ticks the first planned feature the our list.

Resuming your sync session when you restart Studio

In other news - we should have support for the new Explorer Beta in then next few weeks. Sorry for the delay there.

Happy 2025, and let us know if you have any feedback!

6 Likes

Will I be able to create scripts from vscode like this?
image
pressing “New File” and renaming it to “[ANYTHING].luau”

2 Likes

I’ve been having a weird issue with script syncing where sometimes I’ll save the file on my computer, and then in Studio I see an error like this:

  19:30:40.441  Can't sync ServerScriptService.Soccer.game.Client.UI.Playerlist.PlayerlistTeam to disk at //192.168.0.8/dev/soccer/PlayerlistTeam.luau: File not found  -  Studio

An important detail maybe worth noting is I’m saving these files to a shared network drive, though I was having these issues when saving directly to disk as well.

I can see the file still exists at this path, and when I try to stop syncing/delete the file my Studio crashes. I don’t know what causes it, but I can only edit files for a few minutes before one of them randomly breaks and I have to restart Studio. If it does crash, I have to manually delete the files and re-sync them in order to get it working again after restarting Studio. This bug makes it really difficult to use script sync :frowning:

The sync icon in the explorer also changes when this happens (the one with the yellow dot):
CleanShot 2025-02-11 at 19.35.51

These problems persist even after restarting Studio, and attempting to delete the files through the Studio prompt results in the files not actually being deleted. Sometimes when I try to rejoin the same team create session after crashing, I’ll crash on join and get this error on the next try:

  19:59:00.099  A crash occurred during sync auto-resume in the previous session: disabling for this session.  -  Studio

and

20:04:43.519  Unable to resume sync for 'ServerScriptService.Soccer.game.Client.UI.Playerlist.PlayerlistService': Contained errors in the previous session  -  Studio

EDIT: I noticed a workaround to prevent the crashing where if I resume the sync and save the file one more time, it will sometimes update the file in Studio. If I try to save it again after that it will output the same error.

5 Likes

Thanks for taking the time to break this down for us. Really sorry to hear you’re having problems! Let’s work together to see if we can get to the bottom of what’s going on :slight_smile:

This error is used when the file the script is syncing to is no longer present. Can you confirm you are not deleting, moving or renaming the file on your disk? It sounds from your message the answer is ‘no’, but I wanted to triple check. What happens when you do right click > show synced file location?

Thanks for calling this out! Syncing to a networked drive introduces a new challenge, as we have additional latency in the system. However, that doesn’t explain the error you are seeing here or why it also happens when you aren’t using a networked drive.

Out of curiosity - can you clarify your use case for syncing to a networked drive?

This is concerning and something we definitely want to debug. I’m going to start a DM thread on the DevForum with you. Can you please reply to that thread with your crash dump and log files.

Beyond this - any other information you have is helpful. What application you are using to save these files, the contents of these files, whether it’s the same script each time etc.

Thanks in advance for working with us on this!

2 Likes

Thanks so much for taking the time to look into this! This feature has been a real game changer for my team and I, so we’re really excited to see how it progresses :slight_smile: Hopefully I can provide some helpful context. I am fairly confident it’s an issue with my editor + the networked drive, but I don’t know exactly what since it works with other editors like VSCode or Sublime Text.

Yeah as far as I’m aware the file shouldn’t be getting deleted/moved/renamed, at least not by me… When I show the synced file location it takes me to where I would expect, with the Windows explorer selecting the correct file. Opening the file shows the expected changes.

Very valid question… My setup is a bit unconventional and complicated:

I have a Windows PC that I use only for gaming + running Roblox Studio, and a Macbook that I use for everything else. Running Studio on an entirely separate computer and then using Parsec (low-latency remote desktop) leaves my Macbook—which runs everything else like my browser, chat apps, music, etc—with enough resources to basically never lag. I normally have multiple Studio instances open at once, so this separation makes my workflow really snappy since all of my other programs are unaffected by whatever I’m doing in Studio, and Studio is unaffected by other programs.

For the networked drive: it’s very useful with this setup, since it’s common for me to need to transfer files between the two computers (e.g. I make something in Photoshop on my Macbook, then upload it directly from Studio on my PC). Normally when working on projects I serve Rojo from my Macbook over the network (e.g. rojo serve --address 192.168.0.2) and connect to that IP with the plugin from Studio. In this case, I’m trying to recreate that workflow by syncing the files from Studio to a folder on the networked drive from my PC, and then edit them from my editor on my Macbook.

The editor I use is Neovim. I tested this with Neovim, VSCode, and Sublime Text and was able to consistently trigger the “File not found” error by saving the file with Neovim to the networked drive (add comment in VSCode → save & check Studio → remove comment in Neovim → save & check → sync breaks). Saving to the networked drive with VSC/Sublime both seemed to work consistently.

This seems to be reproducible with a default Neovim (and Vim) configuration (nvim --clean or vim --clean).

Another reason I believe it makes sense that it’s my editor because this was happening to me when trying to save directly to the disk. I was having this problem around December when I was travelling with my Macbook (also using Neovim), however I could not reproduce it today and it seems to be stable.

Last thing, while testing I noticed that Studio would only crash if I attempted to stop syncing broken and working files at the same time. If I individually stopped syncing/delete the broken ones only it wouldn’t crash. I must have ran into this since it was faster to select all children → sync to disk.

Sent! Thank you again!

We’re still digging into this!

Our working assumption is that the ‘file not found’ error you are seeing is a combination of two factors:

  1. Some editors, including Vim & Neovim handle saves by renaming the file (ie script.luau > script.luau~), writing to it, then renaming back to the original name.
  2. Your setup has extra latency, because you have a networked drive sitting between Studio and the text editor.

In our tests with Vim etc, this didn’t cause any issues as by the time Studio checks the file it has been restored. It’s possible the latency in your system is causing some flakiness where Studio picks up on the rename before it picks up on the restore.

Script Sync ‘pauses’ sync when it detects a rename, as it does not want you to continue to do work thinking your script is syncing if it is not. There’s a couple of ways we could mitigate this (for example by adding a delay before we pause syncing) or adding special handling for the tidle suffixed files vim generates.

Our next big update is ‘folder sync’, where you can sync a folder and all of its children (including their creations, renames and deletes) sync automatically. Your system wouldn’t error in this case, but it might cause some weird quirks (like a script being deleted and re-created unnecessarily).

There’s not an obvious right answer here, but we are thinking about the right way to support :slight_smile:

One of the things that is tricky about this product is we are not just supporting the link between Studio and the various file systems out there… we’re supporting an end to end journey between Studio, those file systems, and the tools the user wants to use. There’s a lot of combinations out there! Extra latency in the system makes all of these interactions harder to support predictably. File watching is hard!

VS Code, to our knowledge, does not have this rename behavior so should not be impacted.

Last thing, while testing I noticed that Studio would only crash if I attempted to stop syncing broken and working files at the same time.

We’re actively investigating this! We’ll keep you posted on progress.

1 Like

Good news! Script Sync is now supported in the new Studio Explorer :slight_smile:

2 Likes