How to Fish
You are viewing a potentially older version of this package. View Latest Version
Install

Details

Date Uploaded
yesterday
Downloads
318
Size
33KB
Dependency string
hiccup-MoreFishAPI-1.0.0

MoreFishAPI

An API for mod authors who want to add custom fish to How to Fish.

This mod adds no fish on its own. Install it because a fish mod asked you to.

For players

Install it and it does nothing visible until you also install a fish mod. Custom fish are caught, sold, cooked and journalled like any other.

  • Everyone in a lobby should have the same fish mods. A player without a mod simply will not see those fish.
  • Removing a fish mod is safe. Items from a missing fish mod are skipped when a save loads, instead of taking the rest of your inventory with them.

For mod authors

A custom fish is not a prefab you build from scratch. The game's Item, Creature and NetworkObject components carry code generated by FishNet when the game itself is compiled, so they cannot be authored in your own Unity project. MoreFishAPI clones one of the game's own creatures at load time and grafts your artwork onto it.

You choose which creature with Template, and that decides body physics, how it fights on the line, and whether it is hostile. You supply the look, the stats and the rarity.

[BepInDependency("dazed.howtofish.morefishapi", BepInDependency.DependencyFlags.SoftDependency)]
public class Plugin : BaseUnityPlugin
{
    private void Awake()
    {
        AssetBundle bundle = MoreFish.LoadBundle(Path.Combine(Paths.PluginPath, "yourfish.bundle"));

        MoreFish.Register(new FishDefinition
        {
            Id       = "you.yourmod.anglerfish",
            Prefab   = bundle.LoadAsset<GameObject>("Anglerfish"),
            Template = "Cod",
            Worth    = 400,
            Rarity   = 0.3f,
            Health   = 120,
        });
    }
}

Register from Awake. Item ids and the network prefab list are built once at startup, and registering after that returns false.

A true return only means your arguments were valid. Check Live after OnFishRebuilt to confirm your fish actually made it in.

Full documentation

Everything else, including all 38 fish with their real measurements, and the Blender and Unity workflow lives in the documentation repository

Configuration

BepInEx/config/dazed.howtofish.morefishapi.cfg

Key Default Meaning
TemplateFish Cod Creature used when a fish does not name its own Template
AddToJournal true List custom fish in the journal. Turning this off overrides every fish
RarityMultiplier 1 Scales how often custom fish are caught. 0 stops them appearing

Compatibility

Custom fish take item ids from a reserved range, so 123 can exist across all installed fish mods at once. Each fish keeps the same id as long as the set of installed fish mods does not change, and the log warns when an id moves.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.