Allows for exporting primitive objects in Unity scenes to use in SCP: Secret Laboratory.
Use the slocLoader plugin to load them in the game.
Before this project was started, I had no knowledge of the MapEditorReborn plugin.
This is not meant to be a clone of MER, but a different approach to be able to load Unity scenes in SCP: Secret Laboratory.
Check out MapEditorReborn here
sloc stands for Secret Laboratory Object Container.
An sloc file can contain various primitive Unity objects, including spheres, cubes etc., and also lights.
Note
Currently, only point lights are supported.
To create an sloc file, add the ObjectExporter script to an empty object. Select the path to export to and click Export Objects
sloc files are not text, but raw bytes. This means that opening one in a text editor will produce gibberish, since it's not meant to be interpreted as text. It is a sequence of integers and floats.
- Download the archive from the releases page
- Extract the archive to your Unity project's
Assets
folder - Build your scene using primitive objects ang lights
- On the toolbar, navigate to
sloc
, thenExport
- Enter the path to export to (or click Select File)
- Click
Export All
If you want to edit an existing sloc file, you can use the Importer.
- Navigate to
sloc
, thenImport
- Enter the path to the sloc file to import (or click Select File)
- Click
Import Objects
- If a material doesn't exist in your Assets folder, you will be asked if you want to create it, or skip the material; you can select an option to execute for all objects.
- The objects will be imported into the scene contained within an empty object in front of the camera.
For better positioning, download the room and structure assets you need
- Drag and drop the Unity packages into the Unity project.
- Put the room you need into the scene from the RoomPrefabs folder.
- Make sure the prefab's position is
0, 0, 0
- Position the objects accordingly.
- Ensure that the room's root object is tagged either as
Room
orslocExporter Ignored
- Export the objects as detailed in setup
Each exported sloc file has a version number.
Even if a new version of sloc is released, old sloc files will still be compatible with the current version of the plugin due to the versioning system.
All versions have their own object readers to read the objects from the sloc file. This way, no sloc file will be broken after a new version is released.
The collider behavior can be modified on primitives. To change the collider mode, add the Collider Mode Setter
script onto an object.
Multiple collider modes can be selected; information about the selected mode is shown in the Inspector.
For example, Trigger
mode will remove the client-side collider and add a collider on the server with isTrigger
set to true.
A non-spawned object means the object will not exist on the client at all.
Various actions can be added onto trigger colliders (or non-spawned triggers
) upon a specific trigger event (enter, stay, exit).
For example, TeleportToRoom
will find the room with that name and teleport the object interacting with it.
Room names differ from what you expect them to be, see references
To create a trigger action, add the Trigger Action
script to a primitive
Teleporter immunity is a special trigger action. It makes interacting objects immune to this or all teleporters for a specified amount of time.
A maximum of 60 seconds can be specified but this can be stacked by using the Add
duration mode.
WARNING: if you use the Add
duration mode in Stay
it may result in very long durations of teleporter immunity.
A way to clear immunity is by setting the duration mode to Absolute
and the duration to 0 seconds.
Add the imported prefab into the scene.
To mark another object as a structure, add the Structure Override
script. This can also be used to remove the default loot of lockers. Setting the type to None
on a prefab will retain the original object type.