Skip to content
kylinator25 edited this page Mar 18, 2019 · 4 revisions

Welcome to the CustomFish wiki!

This section contains information on creating your own mods with the Fish Framework.

BE AWARE: CREATING MODS WITH THIS FRAMEWORK IS NOT NON-CODER FRIENDLY. YOU MUST HAVE A BASIC UNDERSTANDING OF HOW TO MAKE A MOD WITH QMODS BEFORE USING THIS

How to create your first mod

You've probably seen the example MinecraftFish included in this repo already, but if you haven't, take a look at that now!

If you have and still want more info on how to make your own fish, read on!

CustomFish class

This is the only class from the Fish Framework your mod will need to interface with to create your custom fish, how easy is that?

First off, you need to create an instance of the class: CustomFish fish = new CustomFish();.

Next, just assign the values in the class as described below:

Parameter name Type Description
id string The id to use when creating your fish. This should be unique.
displayName string The name of the creature that is displayed in game. This does not need to be unique.
tooltip string The short description of your creature shown in the inventory.
bundle AssetBundle The asset bundle to load your creature's prefab from. You need to create this bundle using Unity 2017.2.2f2 or less, otherwise it will not work.
fileName string The name of the prefab file within your asset bundle.
isPickupable bool Specifies whether the player can pick up your fish object.
isWaterCreature bool Specifies whether your creature will swim in water or walk on land. This will also affect it's spawning. Currently, land creatures aren't working properly, that will be fixed in a future update.
scale foat An optional value for you to define a custom size for your creature. This is useful if your model is too small or too large.
swimSpeed float The speed at which your fish will move.
swimRadius Vector3 The area in which the random swimming algorithm will search for a new position.
components List Optional list of components to add to your creature when it is created. Use this for custom behaviours on your creatures. All the types must derive from Component, otherwise they will not be added

Once you have assigned the above values to your liking, just call fish.Register()## , and it will be added into the game!

Spawning

The current spawning algorithm involves going through all the creatures spawned by the game, and giving a 10% chance for each one to also spawn a fish added using the Fish Framework.

I will likely add additional functionality in the future for spawning, such as an individual spawn chance for each fish.

Clone this wiki locally