Difference between revisions of "HPL3/Modding/Mod Dependencies"

From Frictional Wiki
Jump to navigation Jump to search
Line 14: Line 14:
  
 
#Open the mod's entry [[HPL3/SOMA/Modding/Creating_a_Mod#Mod_Entry_File|entry file]].
 
#Open the mod's entry [[HPL3/SOMA/Modding/Creating_a_Mod#Mod_Entry_File|entry file]].
#Inside, add an attribute called <code>UID</code> and give it a name.:
+
#Inside, add an attribute called <code>UID</code> and give it a name:<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
 
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<Content Version="1.0"
 
<Content Version="1.0"
Line 29: Line 28:
 
/>
 
/>
 
</syntaxhighlight>
 
</syntaxhighlight>
 
  
 
==Using a Mod Dependency==
 
==Using a Mod Dependency==

Revision as of 20:30, 26 August 2020

Mod dependencies provide a solution sharing mod content across multiple other mods. A few mods could depend on a parent mod to derive assets and other content from, instead of including it in their own mod.

When to Use Mod Dependencies

A simple diagram showing the process of a mod dependency. Several mods take resources from one source. Both mods can use the castle assets pack.
  • The main occasion to use Mod Dependencies is when you want to distribute assets packs which include models, textures, materials, scripts, etc for people to use freely in their own mods.
  • Mod dependencies can help to reduce the mod size you want to distribute, as a big portion of the assets themselves are not actually included in the mod, but come from an external source.

Setting Up a Mod Dependency

In order to turn a regular mod into a mod dependency, the mod's entry file needs to have a special attribute called UID. This is used so other mods can reference your mod as a dependency. The convention of naming a UID is the form provider_name.mod_name. For example, if the mod creator is named steve and the mod name is called Castle Assets Pack, the UID for the mod will be steve.castle_assets_pack.

In order to set a UID manually for a mod:

  1. Open the mod's entry entry file.
  2. Inside, add an attribute called UID and give it a name:
    <?xml version="1.0" encoding="UTF-8"?>
    <Content Version="1.0"
    	Type="StandAlone"
    	Title="Your mod name here"
    	Author="Your name here"
    	Description="Mod description here"
        
        UID="steve.castle_assets_pack"
    	
    	LauncherPic="LauncherPic.png"
    	InitCfg="config/main_init.cfg"
    />
    

Using a Mod Dependency

just use it idk

See Also