Skip to content

Items & World Objects

Sean Ater edited this page Feb 17, 2018 · 15 revisions

Mod Kit Usage Tutorial

Note: The Mod Kit is in early development. This tutorial should get you going adding new items and world objects.

Step 1

Follow the installation instructions to download and install the ModKit into a fresh Unity project.

Once you have finished the installation, copy ModKit/TemplateScene.unity and rename it. (here I moved it to Assets/Tutorial/Tutorial.unity) Select the new scene in the project tab and then at the bottom of the inspector tab add the scene to a bundle.

Step 2

Adding New Items

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.

Making Objects

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.

Step 3

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!

Step 4

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.

Step 5

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.

Step 6

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!