Documentation
Updated a week agoLoading assets with Lure
Lure allows you to load asset paths with 3 different prefixes:
mod://
searches for assets starting from the folder of the mod_id you gave to the function.res://
searches for assets the classic way, in case you wanna search for base game assets.mods/<mod_id>://
<u>searches for assets inside a specific mod</u>'s folder
<u>if you use</u> mods/<mod_id>://
<u>make sure you add the mod you're searching in as a dependency inside your mod's manifest.json
to make sure its already loaded when searching inside it's files.</u>
Examples
(we gave the function we're calling example_mod
as the mod_id argument)
mod://asset.file
would search forasset.file
insideexample_mod
's folder.res://Assets/asset.file
would search forasset.file
inside the base game's Assets folder.mods/other_mod://asset.file
would search forasset.file
inside the folder of a mod calledother_mod
.
Initialization Functions
Make sure you call these functions on the _ready()
function of your mod.gd
!
Custom Species
Lure.assign_species_voice(your_mod_id
, species_id
, bark_sound_path
, growl_sound_path
, whine_sound_path
)
Allows you to assign bark, growl and whine sounds to a specific species, growl and whine are optional, if any of the two are missing they'll get assigned the bark sound.
Lure.assign_face_animation(your_mod_id
, species_id
, animation_path
)
Allows you to assign a face offsets animation to a modded species, so you can adjust the eye, mouth and nose positions. You can make and edit offset animations by selecting the node inside the player_face.tscn
scene that you can find in the res://Scenes/Entities/Player/Face
folder when opening the decompiled game with the godot editor, then select either the cat_face
or the dog_face
animation in the animation timeline tab, click the button and select 'Duplicate', name your new animation and save with "OK". After you're done editing the offsets, click again and select "Save As", this is the file you'll need to load with the function.
Cosmetics
Lure.assign_pattern_texture(your_mod_id
, pattern_id
, species_id
, texture_path
)
Allows you to assign a texture to a specific pattern for a specific species, this allows you to add base game pattern support to modded species, add vanilla species support for modded species or add other people's modded species support to your modded patterns.
Lure.assign_cosmetic_mesh(your_mod_id
, cosmetic_id
, species_id
, mesh_path
)
Allows you to assign an alternative mesh to a specific cosmetic for a specific species, for example if you make a mask accessory, you'll need to make an alternative version for the dog, so its not clipping through the head, this is optional to make your cosmetics work but its heavily encouraged, this function works for both vanilla and modded species/cosmetics.
Props and Modded Map Entities
Lure.add_actor(mod_id
,actor_id
,tscn_path
)
Allows you to add a new 'actor' to the game, actors are basically entities. With this you can store the scenes for your modded props for example, or register things that can be networked on your custom maps
If you load your entity on your modded map with Network's _sync_create_actor function make sure the first argument is mod_id.actor_id
, not only the actor_id else you WILL crash. you prob already know this by know considering this is how all Lure ids work
When calling 'add_content' to a new prop item Lure will automatically turn the prop_code
variable (the actor id that the prop is gonna spawn) from the prop's ItemResource
to mod_id.prop_code
so if the prop item you're assigning the scene to is not from your mod, make sure you call add_actor
with the mod_id
being the id of the mod that adds the prop item.
Items
Lure.register_action(your_mod_id
,action_id
,node_that_holds_the_function
,name_of_the_function_we_are_calling
)
Allows you to register an action for any modded item to use, you'll have to give it the node that holds the function you're calling (for example, if you call this function on your main.gd
file and the function you want to link is in it as well you can just write self
as the third argument) and the name of the function the node has that we're gonna call through the action.
the way you would call the custom action is by setting the action or release_action variables of your modded item's resource file as mod_id.action_id
like everything else with Lure.
Maps
Lure.add_map(mod_id
,map_id
,scene_path
,optional_map_name
)
Adds a new map to the game, if the map is not missing it will get added to the map list of the 'create' section of the lobby list, no tutorials on how to make maps as of yet but here's a couple of steps of how to setup your new map without crashing the game in the testing process:
-
Open
main_map.tscn
and then duplicate it usingScene > Save Scene As..
, name it however you want. -
Right click the
main_map
node of the scene and clickAttach Script
, then in theInherits
field write"res://Scenes/Map/main_map.gd"
(with the quotes) -
Rename the
main_map
node to whatever you want, this is optional. -
Delete the
main_zone
node, we're gonna make our own. -
Open
main_zone.tscn
and then duplicate it usingScene > Save Scene As..
-
Rename
lake_zone
tomain_zone
-
Feel free to remove all the nodes inside the new zone you're making, just keep in mind the following are important:
points
(Removing it WILL crash the game)NPCs
contains well, the npcs.lake_water
andocean_water
are important, but keep in mind thatfish_zones
contains the areas that actually decide the 'loot pool' of fish you'll get when fishing inside the area!!portals
are basically the teleporters/doorsbounce_shrooms
contains the jumping mushroomschalk_zones
contains the areas you can draw on, don't scale these because it will break the position of the chalk when drawing, no idea.sonud_ambient_zones
yup, you read that right, it has a typo. basically the background noise.invis_walls
is where your invisible barriers will set up
-
Go back to your new map's scene, add the new zone you created inside the
zones
node, remember, it must be calledmain_zone
else it will crash. -
Save your map and load it with lure using the
add_map
function Lure provides. -
Enjoy!
NOTE: Avoid using OBJ files on your custom map, they are SUPER buggy, please use GLB/GLTF instead !!
Emotes
add_emote(mod_id,emote_id,animation_path,icon_path,optional_emotion_name)
adds a new emote into the game, no tutorial on how to achieve this atm.
export the rig from Zea's template with new animations made with animations saved with the non-linear animation editor in blender (don't forge the NLA + animation settings when exporting) then open the glb in godot and with the animationplayer selected choose the animation u made and export it separately, the path to the .tres is the animation_path argument if you don't know what that means look up a tutorial on youtube idk
Loading the Items, Props and Cosmetics...
Lure.add_content(your_mod_id
,resource_id
,item_or_cosmetic_path
,flags
)
Loads a new cosmetic/item into the game, the final identifier of the cosmetic/item will be your_mod_id.the_resource_id
, this is to avoid mods cosmetics/items overriding other mods' so keep this in mind when using function that require a resource's identifier. <u>Make sure you run this function last if you need to use any of the previously mentioned assign functions!</u>
for example, if your mod's id is awesome
and you're adding an item that's called sauce
the final id of the item will be awesome.sauce
, you only have to do this for modded resources since base game resources use their file name without the .tres
extension.
flags
is an optional array argument that Lure uses to toggle certain functionality on your new content, here's a list of flags and their uses:
Lure.loot_table(loot_table_name)
is a special flag that lets you set a non-vanilla loot table to a fish, that way custom maps can have specific types of fish show up. This allows you to for example add new fish to other people's custom maps if they have a special loot_table!
the following 2 flags will add your new cosmetic/tool/prop to your inventory automatically, but with different conditions
FREE_UNLOCK
will make the cosmetic/item/prop remain unlocked forever.LOCK_AFTER_SHOP_UPDATE
will make the cosmetic/item/prop remain unlocked until the modded item shop integration update is out, it will lock them after that update drops and the flag will become obsolete.
The following flags are not implemented yet, but you can add them if you want your content to be future proof:
SHOP_POSSUM
adds the cosmetic or item to the possum's shop.SHOP_FROG
adds the cosmetic or item to the frog's shop.SHOP_BEACH
adds the cosmetic or item to the shop at the beach.VENDING_MACHINE
adds the cosmetic or item to the vending machine.
keep in mind that to access the flags you need to reference them inside Lure's FLAGS
enum, so a real example would look like this:
[Lure.LURE_FLAGS.SHOP_POSSUM, Lure.LURE_FLAGS.FREE_UNLOCK]
Utility Functions
Lure.get_other_mod_asset_path(path
)
gives you the absolute res://
path of another mod's asset, you're probably not gonna use this but i wanted to add it just in case, make sure the given path uses the mods/<mod_id>://
prefix mentioned above.
**Lure.loot_table(,loot_table_name
)
lets you add a new loot table into the game call this function as argument inside the array of add_content. Only 1 loot table per fish atm, i guess you can register_content twice?