How does the project format in Rojo compare to the standard format used within studio

I am trying to understand how to properly use Rojo to improve my workflow and be able to use my preference for external editor (VSCode).

Currently I am able to make a project in rojo, use the cli, and have an understanding of the docs, but I do not understand certain things. Lets say, for example, I wanted to kill the player on collision with a part. In studio I would have a script on the part waiting for a player to collide before killing them. On Rojo, doing the same thing is difficult due to how the workspace works. Am I doing this wrong or is there simply a different way of doing things with rojo?

I have been browsing the docs, multiple articles, and other devforum posts. None have answered my question on how to “properly” use rojo in situations such as that.

I would appreciate if somebody could explain to me how to use rojo in a suitable way.

2 Likes

In general, placing scripts inside parts or models in the hierarchy is an inflexible way to give behavior to your game objects. Of course, this approach does not present any problem, but when a project grows, much more flexibility is required. What is usually done is to put all the behavior of the game objects in modules (in ServerStorage and/or ReplicatedStorage) and use tags on the game objects to give them behavior. In this way, the game logic is centralized in modules.

Now you can use Rojo to edit your modules and your main scripts.

2 Likes

Thanks for the response. My understanding of this is that all scripts for parts should usually be put inside of a module script inside of rojo. When I want to use that script, I just use a tag to do so. My only question is how would I go about making tags. Is there a service designed to do so?

1 Like

Yes there is! It’s called CollectionService

1 Like

If you’re just getting started there’s also some other tools that complement rojo well and they all have VSCode extensions.
EDIT: They are also all open-source and on github.

  • Selene for linting
  • Roblox LSP for intellisense
  • Stylua for formatting your code
1 Like

You can use CollectionService, at the bottom of the page there is an example on how to use it. It is simple to use and it is widely used in roblox games.

You can also create your own tag system, but only if you really need something more sophisticated than CollectionService.

1 Like

Attributes are a perfect solution for when you need to tie more complex data to instances (they also replicate to the client as value objects do). That should really be a last resort.

Yep to addon to what @MillaGamerF and @D1CEL said here is the plugin which makes managing collection services tags a lot easier and visually nice:

and here is a dev forum tutorial which I found useful on how to use the collection services.

1 Like