[Early Preview] Studio Script Sync

You’ve caught me out! To the best of my knowledge ScriptEditorService.TextDocumentDidChange is the correct API for listening to open script documents, as it reflects the latest state as rendered in the script editor. ScriptEditorService also provides APIs for you to ‘submit’ transformations to the script document (even if others are writing to it) so if you want to write to a script it’s definitely encouraged you use this.

If you just want to listen to changes, subscribing to Script.Source should be fine. That being said, I don’t work on this stuff directly so if you see me delete this post later and change this that’s your signal I was wrong.

5 Likes

No plans at the moment. The challenge here is representing a Roblox project as files is non trivial. If you want a file based workflow, with your project checked into an external version control system, a tool like Rojo is the way to do this.

That being said - we know we need to do more work on the collaboration options that are built into Roblox Studio. Particularly when it comes to workflows where you want to isolate your work from each other. I can’t share any specific plans yet but this is something we’re actively thinking about.

2 Likes
  1. When this is fully released, Will changes made be pushed live into the production game or will it be in studio waiting to be published?
  2. If I gave the file to someone else, would the script also sync with their edits?

Additionally, syncing updates between places for games such as a tower defenses or generally ones with a lot of maps that might be split-up into places becomes easier with this as well.

Do you have experience in doing that? I’m currently trying to sync a few modules between games and I have difficulty finding premade tools.
My first thought was to import every module into it’s own git project and automatically update the other git projects when code gets pushed to one.
…But that may just be a bit overkill

1 Like

Thanks for your questions!

  1. These changes just write to the Studio state like any change you made in Studio. It’s still up to you when you hit save / publish.
  2. The other user would need to enable script sync to sync this file. We recommend against having two users attempt to sync to the same script at the same time. It’ll work, but if you aren’t careful you’ll overwrite each other’s work.
5 Likes

Okay, thank you for the reply. Really exciting update! I totally see why this isn’t straight forward for you. If I could give my humble opinion, I think attributes, tags etc. does not have to be shown in studio, but just have to appear in autocomplete, and then you have to edit the properties in studio (unless you do it via a script).

1 Like

Do you have an (estimated) timeframe for when these 2 would be available? Right now they are the only things holding back my studio from using this new feature.

You can take advantage of Roblox Packages for this. Whenever you’d update the code within your main place, these changes will automatically be updated across all instances as long as auto updating is enabled.

1 Like

This seems like a really great future and I excited to use it even though I am more of a gui designer not a coder :rofl:

1 Like

Not 100% correct, you will still need to publish the other experiences under the universe still.

1 Like

Because they don’t have a code editor and use a file based system

1 Like

You can do

require(id)

once you publish an update to the module with that id the scripts will automatically require the new version

1 Like

Import, Export and Reload operations would be sufficient for my workflow. Additionally, the icon for file sync in the explorer pane should reflect which Instances have been modified (either in Roblox or on the file system) and not synced. Please refer to my subsequent reply for an image of the Lync widget which contains these features (“Revert” = Reload, “Save” = Export.)

This achieves the result I’m aiming for. Only concern I have is how syncing raw file contents to a ModuleScript will create script errors. Perhaps the File instance could be modified to suit this purpose instead?

In the future, when more types of Instances can be synced, there must be a catch-all syncing/synced event; otherwise, it becomes tricky to listen to modifications to an instance tree of indeterminate composition, especially when some of the properties are inaccessible to plugins.

Additionally; listening to instance modifications won’t tell you if the change was made in Roblox or on the file system.


Thanks for the communication!

Take your time, we are all here waiting on it. We appreciate the transparency and this is looking super neat already. I already love Rojo and I can’t wait to see what you guys build with the deeper integration an official Roblox tool can provide.

To simplify the argument for external IDEs to a couple of sentences; A lot of the popular IDE programs like Visual Studio (and its sister program Visual Studio Code) are more robust when compared to what is provided by Roblox. When it comes to IDE programs such as the ones stated earlier, their entire purpose is to provide a good environment for development of scripts/code. This means that they generally are able to focus more on providing tools and features that Roblox realistically can’t since they have much more on their plate.

ooh NICEEE! This is partially offline mode, nice job!

Question, I see people in this post use github a lot. If I remember correctly, it saves your scripts to a cloud. To save my scripts I save them to file, especially if I’ve done any substantial scripting. Am I right about the cloud saving? & Are there any other features that make github useful to you?

For the most part; you’re right – however, GitHub has a lot of features that help with project management and helps with saving time.

Branches

Imagine different folders with your entire codebase in all these folders, allowing developers to work on stuff, fix stuff, etc without conflicting edits from other developers. It’s very normal for developers to use branches whenever making a new feature/fixing quite a few bugs at once. Oh, and when you’re ready you can merge these branches into others using pull requests.

Pull Requests

Pull requests are basically just gaining feedback and additional reviews from other developers on your team before pushing a piece of code (or a branch) to live production/to another branch. If I were to make a pull request changing a file, I could request reviewers, assign labels, etc. You can also keep track of all the pull requests you’ve made which helps with version control.

Teams

You can have your own teams on github, with access to certain repositories and actions, much like the in-built creator hub groups! This allows you to sync multiple repositories to certain games,external systems, etc. inside your organization ← (which are just glorified Roblox groups for development lol)

Repositories

This is literally just where your main code will be stored; can have a variety of repositories for different reasons though.

Workflow Integrations

Can sync your code with Rojo and work in external editors (such as the aforementioned Visual Studio Code) properly. Also allows support for Git (which you can read more about here! There’s alot more to this which would take way too long to unpack, but will let you find that out yourself if interested! One of my favorite things about VSC which ties in with Github are code snippets (might already be familiar with this, just leaving it incase you aren’t!)

Say you want a template for requiring a specific module but can’t remember exactly what the path was. Introducing, code snippets.

Instead of doing,

require(game.ReplicatedStorage.Codebase.SomePath.SomeSubFolder.SomeScript)

You can just write SomeScript and it will autofill the rest for you. Can read more about that here incase you’re interested.

That’s just the tip of the icerberg – lot more than that, feel free to shoot me a DM if interested!

3 Likes

Thanks for the reply. I definitely want to know more. My game is launching soon and I want to make sure I have seamless updates. Do I send a dm on this or discord? Ill send one on here anyway. I dont know anything about rojo either im very interested

I personally don’t see the point of having to use an external coding software to write roblox scripts. What even is the point?? The current script editor does the job well why would you need to overcomplicate things ?