You can find information in here about it,
There’s a companion plugin and within the extension settings.
You can find information in here about it,
There’s a companion plugin and within the extension settings.
Thanks for sharing the feedback!
This is an interesting one.
When we first started digging into this problem, we focused on ‘manual’ sync. The challenge with that mode of work is that every sync operation is essentially a merge operation, as the state on disk and Studio are allowed to freely diverge.
It’s definitely possible to build reasonable workflows around this, but they require extra input or rules for the user to manage. When thinking about ‘manual’ operations to move data between files and Studio, the following operations come to mind:
We need to think more about these operations for scripts - but it might be import, export and reload operations are useful for your use case. Let us know what you think!
This use case makes sense to me. One way you could unlock it today with the current feature is you could sync a ModuleScript that’s parented to a ModuleScript that is not being synced. Then with a Studio plugin you could set up a change listener that reads the synced script, mutates it, then writes to the non-synced script. This probably isn’t the exact ergonomics you’re looking for. More thought is needed on the interfaces we expose to plugins.
This sounds interesting, can you give me some examples here of where GetPropertyChangedSignal("Source")
would be insufficient here?
Great question! Here are some tools that you may find helpful (note, these are all made by the community)
I was under the impression that Source
wasn’t guaranteed to be up to date and we shouldn’t be using it for this stuff. Especially in Team Create. Is this not the case?
This is a great question (thanks!) and one I get quite a lot. So I wanted to break down our thoughts a little more here.
The core challenge is, although the DataModel is hierarchical, it is not a file system. Some differences:
That’s not to say a Roblox project can’t be represented on the file system in such a way that it can be translated to a DataModel later, but doing this requires a lot of opinions and potentially configuration. Questions like this start to pop up:
The Rojo devs have spent a lot of time on this problem, and has built a project format that adopts enough opinions to make this work great for their use cases. However - the range of use cases for external tools is enormous. We aren’t sure every use case needs (or benefits from) a file system source of truth, nor that the rules / conventions Rojo adopts are suitable for every workflow involving external tools.
We think we can best serve the community by:
Now… that being said. On our upcoming features list for Script Sync is Folder Sync, this will let you sync a Folder to a directory on disk. When you add a script to the Folder, it’ll automatically create the file on disk and vice-versa. The idea here being letting you sync code bases, not just individual scripts. This may address some of your use cases.
PS: Sorry for the word wall - we’re super passionate about this stuff!
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.
Are there plans on adding actual git to Roblox in the future? Pretty much every other SDK that I use has this built it right out of the box.
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.
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
- 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?
- If I gave the file to someone else, would the script also sync with their edits?
Thanks for your questions!
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).
Exporting source maps
- This is crucial, so you can use awesome tools like JonnyMorgan’z Luau LSP with your editor
The ability to sync folders + their script descendants
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.
YESS, THIS WILL BE AWESOME, FINALLY THANK YOU SO MUCH ROBLOX
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.
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
Not 100% correct, you will still need to publish the other experiences under the universe still.
Because they don’t have a code editor and use a file based system
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.
You can do
require(id)
once you publish an update to the module with that id the scripts will automatically require the new version
We need to think more about these operations for scripts - but it might be import, export and reload operations are useful for your use case. Let us know what you think!
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.)
One way you could unlock it today with the current feature is you could sync a ModuleScript that’s parented to a ModuleScript that is not being synced. Then with a Studio plugin you could set up a change listener that reads the synced script, mutates it, then writes to the non-synced script.
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?
This sounds interesting, can you give me some examples here of where
GetPropertyChangedSignal("Source")
would be insufficient here?
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!