Is there a better way to link the workspace with rojo?

Hello! I hope I am using the correct category for this, if not, please correct me.

I have recently been trying to learn rojo, but I managed to come across something super annoying. Basically, as usual, the workspace contains a lot of parts. Is there a way to kind of copy the roblox studio workspace and paste it into the rojo workspace? Another annoying thing is, whenever I create a part, I would have to manually refer to it in the actual default.project.json file.

I am aware about the "$ignoreUnknownInstances", but is there another way?

3 Likes

Also, if possible, how could I link a file from roblox and get the code of it and pass it onto rojo?

For more clarification, I am using VSC.

2 Likes

Sort of. If you export the object as an .rbxmx file and put that object in the folder where your Rojo project resides, Rojo will sync it up in Roblox. Additionally, since you’re using VSC, it’ll also show up in the workspace automatically. While this isn’t quite as easy as Ctrl + C and Ctrl + V, I do think it’ll be much easier than what you’re doing right now. Rojo can also take .rbxm files, but I’ve read somewhere that it tends to work better with the former.

Are you talking about scripts inside of other objects (eg. a script that is a child of a part)? If that’s the case, I’d recommend doing what the Rojo documentation says about it: don’t. I’ve found it really easy to stay organized by keeping the scripts separate anyway.

If instead you’re talking about the properties of an object, you can change them through .meta.json files or by altering those .rbxmx files I mentioned earlier. Aside from changing the properties of scripts through .meta.json files, I don’t know much about doing either method, so you should probably read up on instance descriptions if you want to give it a shot.

As a final tip, read up on the Rojo documentation. I’ve answered most of my own questions doing so and it’s good practice in reading documentation (if the Roblox ones aren’t already giving you a hard time). It’ll also most definitely answer some things I’ve left out for the sake of consistency (eg. what naming a file init would do).

1 Like

s

No. Basically, what I meant was, can you somehow get the code from a script in roblox and then LINK it to a script in Rojo.

The only times I have fixed it have been done so by actually copying the code, creating a script in VSC, and finally pasting the script in VSC.

Overall, thank you for the explanation, im not a big fan of reading actual documentations (even though I have tried) since most of the times I barely understand anything, which why I resort to getting explanations from people who understand better.

If you create a script in VSC, Rojo should sync it up in Studio, so long you did it correctly. For scripts, I do it by creating a new file in VSC and calling it foo.server.lua, and Rojo will create a script named “foo” in Studio. For local scripts, I’d name the VSC file foo.client.lua and for module scripts, simply foo.lua.

If you’re talking about pre-existing scripts before making the switch to Rojo, then use rbxlx-to-rojo, which the documentation says is the most reliable way at the moment.

I suspect I’m still misinterpreting what you’re saying, so if you’re talking about how the code in VSC isn’t updating when you’re scripting in Studio, that’s because, as far as I’m concerned, Rojo can’t sync from Studio to VSC (ie. Rojo can’t take code you write in Studio and sync it with code in VSC). I get around this by sucking it up and writing code in VSC. It’s worth noting that there is a setting in the Rojo plugin in Studio called Two-Way Sync that allows you to sync from Studio to VSC. However, when they say it’s experimental, they mean it; last time I tried it out, I had problems with it constantly scrolling to the bottom every time I typed something new. I don’t know if they’ve fixed it by now or if it’s just a problem for my workflow specifically, but you can give it a try if you want to stay in Studio.