Mods / Catch and Release LIB

Tags:
Author:
MortalityGames
Side:
Both
Created:
Mar 6th at 4:42 PM
Last modified:
2 days ago
Downloads:
972
Recommended download (for Vintage Story 1.22.0 - 1.22.3):
crlib_1.0.2.zip  1-click install

Shared library for Catch and Release: Butterflies and Catch and Release: Fish.

Contains common code for "cages" and storing creatures within those cages.

image   

 

 


Below is for modders who want to extend the mod or create their own caged creatures

 

TODO: Documentation on API. If anyone is interested in using this for further mods, come and discuss in Catch and Release post in the VS Discord.

Example how to setup new cages:

  1. Create shape + animations for caged creature entities
  2. Entity definition for caged creature(s). Including:
Caged creature behaviour snipped
behaviors: [
    {
        code: "taskai",
        aitasks: [{
            code: "crlib.CreatureCaged",
            priority: 0,
            movespeed: 0.6,            <- How fast caged creature moves
            turnspeed: 2.5,               <- How fast caged creature turns to target position
            moveAnim: "fly",             <- Name of animation for when moving
            restAnim: "feed",            <- Name of animation for when sleeping
            restTime: "Day",             <- Creature sleeps during "Day" "Night" or "None" (to not rest)
            restDaylightLevel: 0.7,   <- Daylight amount to trigger sleeping (basically, time of day)
            groundOnRest: true       <- When resting, does the creature find the ground first
        }]
    }
]
  1. Shape for your cage(s) (plus textures if needed)
  2. Custom cage block(s). Including:
Cage config attribute
attributes: {
    cageConfig: {
        cageName: "crbutterfly:cage_name",          <- Just some display test when refering to this type of cage
        fits: 4,                                                           <- How many creatures fit in the cage
        radius: 0.3,                                                   <- Size of the cage (for the purpose of determining creatures walking around)
        height: 0.5,                                                   <- Height of the cage (for the purpose of flying creatures - 0 for walking creatures)
        bottom: 0.05,                                                <- Offset the 'floor' of the cage
        validItems: "game:creature-butterfly-*",       <- What creature items can be placed in the cage
        dropsEntity: "game:butterfly-",                     <- What creature items fall out of a broken cage
        spawnEntity: "crbutterfly:cagedbutterfly-",   <- What creature entities 'wander' in the cage
        displays: 1                                                    <- How many items to display in a cage
    },
}
  1. Recipe(s) for cage(s)

 

Important Notes / Limitations

  1. Cages larger than 1 block currently only support liquid-holding cages (like aquariums)

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
1.0.2 crlib
1.22.0 - 1.22.3
294 2 days ago crlib_1.0.2.zip 1-click install

API: Added support for non-liquid multiblock cages.

Fixes issue introduced in v1.0.1.

1.0.1 crlib
1.22.0 - 1.22.3
6 2 days ago Release Retracted

Retraction Reason:

Possible multicage issue.

Changelog:

API: Added support for non-liquid multiblock cages.

1.0.0 crlib
1.22.0 - 1.22.3
672 6 days ago crlib_1.0.0.zip 1-click install

Initial release


0 Comments (oldest first | newest first) (threaded | flat)