-
Notifications
You must be signed in to change notification settings - Fork 24
Items & World Objects
Note: The Mod Kit is in early development. This tutorial should get you going adding new items and world objects.
Follow the installation instructions to download and install the ModKit into a fresh Unity project.
Once you have finished the installation, open the existing TemplateScene.unity scene.
The existing template scene comes with 2 sample items, "SampleItem" and "Sample2Item". To make a new item, it is easiest to simple copy + paste one of these existing items, give it a new name, and then tweak the properties of the newly copied game object.
Items must be named ending with "Item" at the end; this is how the mod kit finds items within your eventual asset bundle. Make sure all objects in your mod scene are disabled before exporting to the asset bundle. This ensures that once loaded in game, those objects won't spew errors due to being improperly configured.
You can change the Icon of the item by editing the "Icon" game object; for example one of the easiest tweaks would be to change the sprite in the foreground to your own sprite, or change the background color.
After you have made the items, you also need to add code server side that links to the same named item. Again, it is easiest to simply copy an existing similar item and modify that code. The name of the item class should match the name in the scene file.
Similar to items, there is a sample world object in the template scene that can be used as a template to make other world objects. Simply copy+paste that object to make your own. Objects should have collision and the WorldObject script attached to them to function correctly.
Objects must be named ending in "Object"; this is how the mod kit finds modded objects.
Mods for Eco are exported as asset bundles from within unity. The first step is assigning your scene to an asset bundle; you can use whatever name you wish, just ensure that ONLY the scene is tagged into an asset bundle and nothing else.
Once tagged, select ModKit->Build Bundles to export your objects into an asset bundle. Ensure that all objects in the scene are deactivated before exporting!
Install you mod into the Eco server. First, copy the exported asset bundle file, it will be located in the Assets/StreamingAssets folder of your unity project after you build the bundle.
Copy the MYMODNAME.unity3d file over to the Mods folder of the server. In general, you should make a new folder to hold all files needed for your mod, place both the unity3d file and any code files needed here.
Run the server. Mods are downloaded automatically when connecting to a server, so once the server has started running, simply connect to it and you will download the mod automatically.
Test out your new items by using admin commands to give yourself the items. If all has gone well, you should be well on your way to making more modifications.
Join the modding channel of the official Eco Discord if you have any further questions!
- Custom-Chat-Commands
- Generic-Authorization
- Item-Callbacks
- Modifying-the-World
- Save-Load
- Reacting to player events
- Debugging store interactions
- Creating skills
- Maintain mods automatically
- Overriding Translations
- Creating UIs for Mods
See all pages (above) for reference & usage tutorials.