Skip to content

Items & World Objects

mikehixson edited this page Mar 1, 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 the asset EcoModKit/TemplateScene.unity to a folder outside of EcoModKit and rename it. (Don't change/save files inside the EcoModKit directory)

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. Select ModKit->Build Current Bundle to export your objects into an asset bundle. This will open a save file dialogue so you can export directly into your mod's server folder.

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 4

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.

EcoServer 0.7.2 adds options to continuously scan for mod changes in the ModKit tab or manually scan for changes under the ModKit menu so you don't need to restart the server for unity changes.

Step 5

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!