Hello Developers Once Again! Its been around 15 days since this post, and I think I have finally figured out the good way of managing multi-placed game with some help of Noble_Draconian on Discord!
So to work with games where multiple places takes spot, the best setup of the rojo File will be something like this:
Basically, Have 1 Server, Shared, and Client to store scripts that is shared across every place. This will be synced into every place file via Rojo.
Meanwhile, for the place-specific scripts you will need to setup a individual folder representing each place.
Naming Convention Example: âserverâ ⌠place name, âclientâ ⌠place name
Finally, to the most important part which is to create a Project JSON file.
By having a individual json file, you will be able to sync a specific files dedicated to each place.
Example of JSON File:
--(JSON File for Place1)
{
"name": "Place1",
"servePort": number --(Have different number for serveport, so u can sync multiple project files without being mixed up
"servePlaceIds": [place id] --(rojo will avoid syncing if the place id does not match with the id here)
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"Shared": { --The Folder will be available as ReplicatedStorage.Shared
"$path": "src/shared"
}
},
"ServerScriptService": {
"$className": "ServerScriptService",
"ServerShared": { --Will Be Available As ServerScriptService.ServerShared. This is where you want to store server scripts that is shared across all place
"$path": "src/server"
},
"ServerLocal": { --Will Be Available As ServerScriptService.ServerLocal. This is where u want to store place1-specific scripts
"$path": "src/serverPlace1"
}
},
"StarterPlayer": {
"$className": "StarterPlayer",
"StarterPlayerScripts": {
"$className": "StarterPlayerScripts",
"ClientShared": { --Will be available as LocalPlayer.PlayerScripts.ClientShared. Store Client Scripts That Needs to be Shared Across All Places
"$path": "src/client"
},
"ClientLocal": { --Will Be Available as LocalPlayer.PlayerScripts.ClientLocal. Store Client Scripts That is Place1-Specific.
"$path": "src/clientPlace1"
}
}
}
}
}
--Place File for Place2
{
"name": "Place2",
"servePort": number --(Have different number for serveport, so u can sync multiple project files without being mixed up
"servePlaceIds": [place id] --(rojo will avoid syncing if the place id does not match with the id here)
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"Shared": { --The Folder will be available as ReplicatedStorage.Shared
"$path": "src/shared"
}
},
"ServerScriptService": {
"$className": "ServerScriptService",
"ServerShared": { --Will Be Available As ServerScriptService.ServerShared. This is where you want to store server scripts that is shared across all place
"$path": "src/server"
},
"ServerLocal": { --Will Be Available As ServerScriptService.ServerLocal. This is where u want to store place2-specific scripts
"$path": "src/serverPlace2"
}
},
"StarterPlayer": {
"$className": "StarterPlayer",
"StarterPlayerScripts": {
"$className": "StarterPlayerScripts",
"ClientShared": { --Will be available as LocalPlayer.PlayerScripts.ClientShared. Store Client Scripts That Needs to be Shared Across All Places
"$path": "src/client"
},
"ClientLocal": { --Will Be Available as LocalPlayer.PlayerScripts.ClientLocal. Store Client Scripts That is Place2-Specific.
"$path": "src/clientPlace2"
}
}
}
}
}
Now that all the project files is set up, its Time to sync it into roblox places!
In order to sync the place project file, you will need to specify the JSON file we made above so rojo can sync from there. Shift + Right Click in the project folder (shortcut to open powershell from the directory you are in), and type following to start Syncing!
Editďź
I also found that you can press ctrl + @ to open the powershell within VSCode
--For Place1
rojo serve Place1.project.json
--For Place2
rojo serve Place2.project.json
Example Project File: https://github.com/Yuuwa0519/Multi-Place-Template/