[Early Preview] Studio Script Sync

doesn’t the module need to be public in order to do this?

There are a lot of replies in this thread that explain why someone may want to use an external IDE over the default Roblox code editor and this isn’t just for external code editing, you can also integrate with GitHub for version control and project management.

Really appreciate the early preview!

I’m hoping to get clarification on the following planned features:

  • The ability to sync folders + their script descendants
  • Starting sync from the state on disk, rather than the state in Studio

Two related questions:

  1. Will folders with instances other than scripts have the ability to sync?
  2. How will the hierarchy of a folder’s descendants in the DM translate to the hierarchy of a file system (Studio → Disk) and vice versa (Disk → Studio)?

For example, how would Studio Script Sync know what to do with the following:

Example 1:

  • Folder (to sync)
    • ScriptA
      • ScriptB
        • ScriptC

Example 2:

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

And whatever state these end up in on disk, how would Studio Script Sync know how to map the file system’s scripts back to the folder’s hierarchy in the DM?

Since syncing folders to and from disk are planned features, I’m assuming the answers to these questions are known. Any high level clarification is much appreciated, thanks!

2 Likes

when i sync a script with a emoji in it they get replaced with ??, not sure if its something in vscode or this

You can require private modules that you own on games that you own and subsequently you can require modules under a group in a game that is also under the group

My assumption to your question #2 is the UniqueId property.
image

This update is great and all, really excited to use it. But for some reason, whenever I sync my scripts from studio to Visual Studio Code, it doesn’t work, I tried many times yet I still can’t figure out how to make it work. I have my beta feature turned on and there’s no output in studio that the sync failed.

Could someone explain step by step or perhaps reply with a video on how the process works?

I’m having a problem with encoding.
To be fair, I use latin (á, é) characters just for commenting, but I also use emojis as .Text for different UI. Characters in both scripts (Roblox Studio and VSC) become unrecognizable each time I sync the script to the disk and open them in VSC.
I tried changing encoding in VSC, but didn’t find any suitable for displaying the characters correctly.

well one reason i would use it is because what @SharpSerious said for example if i dont have a variable for players service it will put it at the top of the script if i type Players which is really nice but i did learn theres a plugin that does something similar

that’s super cool and useful.

especially when Roblox is down, at least i hope that’s how it works. It would be useful if you won’t need to have Roblox Studio opened.

What about improving the UI and, perhaps, feature set of the already built-in versioning for places saved to roblox? It’s all but unusable outside emergencies where you’ll suffer whatever it takes to find something in a previous version. It’d be amazing if it were expanded with anything close to any other content versioning, and adding that wouldn’t require real files or any of the corresponding limitations. Theoretically you could have all the features of git but based on unique instance ids or whatever internal thing works, but honestly any improvement is welcome.

(Also, love this feature and the sync folder feature will cover exactly what I’ve wanted rojo to do all this time - I prototype a lot so setting up projects outside studio is a complete pain. I want to make a script in the data model using studio then open it up in VSC to edit)

2 Likes

Better integration with third-party or custom tools. For large teams, this is a huge win. For everyone else, this can be more complex than need be.

Largest benefit of them all is that I can continue working on a game (programmatically) when Roblox goes down. I don’t have to have a constant connection to Roblox.

For large games, the downtime window means they’re losing money. Lots and lots of time wasted if they have to wait for Roblox to come back online just to work on the game.

Code editor has gotten a lot better over the years and I often find myself asking the same question now. I appreciate Rojo for what it does but, more tools doesn’t always equal more power and more configuration can get in the way of creating the actual game.

You don’t need any of these tools to create or maintain a game.

Arguably, that’s how it should be.

3 Likes

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!

2 Likes

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

5 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