[Early Preview] Studio Script Sync

Sorry to hear that. Try the following steps:

  1. Verify the Beta is feature is enabled ‘Studio Script Sync Early Preview’
  2. Create a Script
  3. Right click on that Script and select ‘Sync to disk’
  4. Pick a name / location for the file and hit save
  5. Open that file in a code editor VS Code
  6. Start editing

Let us know if you are having any problems!

1 Like

Is this an Emoji in the Script name? File systems often don’t support special characters like this.

1 Like

As a beginner on learning Coding in Studio… sometimes I like to compare 2 script versions.
I installed a plugin called Script Compare… but it falls short… does not align.

What I am looking for is something that compares like VSC… which will create blank lines on either script… so that the identical script lines do line up.

My question is… how can I achieve that in studio itself ?
What plugin are others using to achieve this … or if Studio itself can do this ?

I would love to get to the stage where I can Sync Studio, my PC file, VSC and GitHub all together… but being new to this… I have to start with comparisons first & filing 2nd… and then eventually Syncing.

Sorry to hear this! We’d love to find out more so we can help fix.

Could you give us an example of some text that is failing to sync correctly? Also, please confirm what encoding your script editor is using? In VS Code, this is shown in the bottom right corner of the window (in this case UTF-8):

image

1 Like

image
its a emoji inside the script, i think it only happens the first time i open it in vscode after that it saves emojis normally
image
image

4 Likes

This is in Roblox Studio:
Screenshot 2024-11-18 145632

Now, after syncing to disk, in VSC using UTF-8:
Screenshot 2024-11-18 145824

Then, VSC recommended changing to encoding Windows 1252, and it does seem to recognize the Latin characters, but not emojis:
Screenshot 2024-11-18 150901

1 Like

Great questions!

I think question (1) comes in two parts.

(1A) Will it be possible to sync the scripts from a folder that contains non-scripts?

We’re leaning towards supporting this right now, but it does come with some tradeoffs!

When syncing a Folder, if we ‘ignore’ non-Script Instances inside it, it complicates the version control story a little. When we support starting sync from disk state, will this cause confusion for creators who expect these Instances to be synced too?

Even if we do ‘ignore’ non Script Instances, there are some cases that would be really hard for us to support without extra data (like the script parented to a model case you describe). There’s an argument to be made that we should only support hierarchies in the DM that are 100% file system compatible, but for some users that may be overly restrictive.

More thought needed - welcome opinions on how you think this should work :slight_smile:

(1B) Will we sync non-script Instances to your disk too?

We are actively thinking about other standard file formats that we think Studio should provide great support for syncing (for example images).

That being said, we have no current plans to provide general sync for DataModel. I talk about why in more detail in my post above. We think tools like Rojo are best equipped to deliver this sort of feature, and we should focus on better supporting those tools rather than coming up with our own complex rules + opinions for this.

Our intention is to rely on convention. Rojo + the Luau spec provide broad conventions for a how a given hierarchy of Luau files maps to Instances, and we can safely adopt these without introducing new opinions.

Looking at your example:

* Folder
  * ScriptA
    * ScriptB
      * ScriptC

Would leverage the init.luau behavior in the Luau spec:

/Folder
    /ScriptA
        init.luau
        /ScriptB
            init.luau
            ScriptC.luau

The second example, how we support this really depends on the answer to (1A). It might be we opt not to support this at all and require you to Sync ScriptA and ScriptB separately. More thought needed.

* Folder (to sync)
  * ScriptA
  * Model
     * ScriptB

Please let us know your thoughts, we’d love feedback on how you’d expect this to work.

1 Like

Thanks for sharing the encoding issues @sanosuke298, @orangepineappel. We’re taking a look!

2 Likes

Developing a built-in version control system in Studio will be a significant effort, partly due to the different workflows and needs of scripters and builders.
To begin, we will focus on enhancing content versioning and introducing detailed place version history starting 2025. With that, you will be able to add place version notes, rename versions, filter versions, and search for specific content changes.

Will this impact the version number that’s returned from endpoints such as https://develop.roblox.com/v1/assets/{place_id}/versions? Or is it purely a semantic name that’s assigned to a version number?

1 Like

Hey @sanosuke298, @orangepineappel

We have identified the root cause for the encoding issue. Expect to see a fix out within a couple weeks.

Thanks for your helpful reports!

1 Like

Awesome!

(More words to satisfy the system: Of course doing a full git-like system would be difficult. Any improvement is appreciated.)

1 Like

There is currently a workflow-breaking issue when editing auto-saved files in VSC with multiple cursors.

How to recreate (possibly):

  1. Close the editing tab of a script in studio
  2. Sync the file to disk
  3. Open the file in VSC (i don’t know if this issue also occurs on other editors) and make sure the program is set to auto-save files on a time interval (mine is set to once every second)
  4. Edit the file with multiple cursors (10-20 simultaneously)

This errors should occur randomly when trying to write something to the file. Thing is, i remember editing a couple of lines without reopening the editing script tab in studio, and when i reopened the file again this morning i discovered that the edits I’ve done were not saved.

Apparently if i keep the script editor tab opened in studio this issue doesn’t seem to happen.

This looks bad! Good catch, we’re investigating now. We’ll keep you posted.

2 Likes

Thanks for this report!

We think that the issue is due to your “End of Line Sequence” setting being set to CRLF. Currently, we only support LF. Changing this setting should fix the issue for you. Please let us know if the issue persists.

We will work on addressing this.

I’d really like to start using VSCode for scripting so that I can have my code editor in a persistent window on my second monitor, but am really missing some Roblox-specific things like the automatic do-end block creation when you hit Enter. Any external tool pros here who have some tips to make it more like the Studio editor, or at least how I can get started on doing it myself?

Yes… having the Studio script editor open on the 2nd monitor is nice … until you do a test and it resets back into Studio on monitor #1 - Annoying indeed. :frowning:

1 Like

have you taken a look at luau-lsp? it has auto-completion options for things like do-end blocks.

Pretty neat feature but why would somebody want to use a third-party editor rather than Roblox’s provided script editor?

Quick update regarding Script Sync:

We have moved the Sync context-menu actions to a more suitable place.

You will see them in their own dedicated section, below “View Script Changes” and above “Save to File”

Happy Coding!

3 Likes