Difference between revisions of "Custom Factions"

From Holdfast: Nations At War
Jump to navigation Jump to search
(New update for custom factions)
Line 1: Line 1:
FThis page refers to a community made workshop mod created by [[User:Elf]] . For support using the mod, you can request support on the [https://discord.com/invite/holdfastgame official holdfast discord] in #Server-Owners.  
+
This page refers to a community made workshop mod created by [[User:Elf]] . For support using the mod, you can request support on the [https://discord.com/invite/holdfastgame official holdfast discord] in #Server-Owners.  
 +
 
 +
AGS / Harper have provided a template for creating Custom Factions to support this mod. 
 +
 
  
  
Line 14: Line 17:
 
== Replacing Factions ==
 
== Replacing Factions ==
 
With a new mod created and files downloaded from the Github page, your folder should look like this:
 
With a new mod created and files downloaded from the Github page, your folder should look like this:
 +
[[File:Custom factions modfolder.png|border|none|thumb|Custom faction Mod folder structure]]
  
  
Line 21: Line 25:
 
* The official templates provided by Harper and AGS can be used as references to create custom faction images.  
 
* The official templates provided by Harper and AGS can be used as references to create custom faction images.  
 
* The scene file is what will be used to create the mod.
 
* The scene file is what will be used to create the mod.
 
+
[[File:Custom factions folder structure.png|none|thumb]]
 
# Open up the scene file. In the scene is an object called "[Manager]" click this to open the inspector in the right hand side of Unity. Top right click the padlock to fix it in place.
 
# Open up the scene file. In the scene is an object called "[Manager]" click this to open the inspector in the right hand side of Unity. Top right click the padlock to fix it in place.
 
# Click the plus button to create your first custom faction. You can repeat this process to create multiple custom factions on the same mod.
 
# Click the plus button to create your first custom faction. You can repeat this process to create multiple custom factions on the same mod.
 +
# Fill the references in. Use the templates provided and the table as reference material
 +
# Build and upload the mod. Make sure the scripts are inside the build folder otherwise it will not work.
 +
[[File:Custom factions inspector.png|border|none|thumb|Inspector]]
 +
[[File:Custom factions empty referecnes.png|none|thumb|References]]
 +
[[File:Custom factions full references.png|border|none|thumb|Filled in references]]
 
#  
 
#  
  
Line 83: Line 92:
 
|[[File:Custom factions topflag.png|thumb|153x153px|Rhein Top Image]]
 
|[[File:Custom factions topflag.png|thumb|153x153px|Rhein Top Image]]
 
|}
 
|}
 +
== Configuration Settings ==
  
 
== Configuration Settings ==
 
  
  
By default the mod will assign one Custom faction to one existing factions. However sometimes you may need more faction replacements than factions which exist in the game. For example the naval gamemode only has two ingame factions. Therefore by the config you can define which faction to override based on the attacker and defender name.  
+
By default the mod will assign one Custom faction to one existing factions. However sometimes you may need more faction replacements than factions which exist in the game. For example the naval game mode only has two in game factions. Therefore by the config you can define which faction to override based on the attacker and defender name.  
  
  
 
This will use custom factions based on ID instead of faction.<pre>
 
This will use custom factions based on ID instead of faction.<pre>
mod_variable xmg_rating:UseCustomFactions:true
+
mod_variable custom_factions:UseCustomFactions:true
 
</pre>This will replace <code><faction ID></code> for the attacking or defending faction. <pre>
 
</pre>This will replace <code><faction ID></code> for the attacking or defending faction. <pre>
mod_variable xmg_rating:CustomAttackerFactionID:<faction ID>
+
mod_variable custom_factions:CustomAttackerFactionID:<faction ID>
mod_variable xmg_rating:CustomDefenderFactionID:<faction ID>
+
mod_variable custom_factions:CustomDefenderFactionID:<faction ID>
 
</pre>
 
</pre>
  
 
=== Example ===
 
=== Example ===
 
For the melee community, a mod allows different national teams to be selected. The mod has 10+ factions which would not be possible without custom ID's. The following will replace the attacking faction with the NA custom faction and the defending faction with the Scandinavia custom faction. <pre>
 
For the melee community, a mod allows different national teams to be selected. The mod has 10+ factions which would not be possible without custom ID's. The following will replace the attacking faction with the NA custom faction and the defending faction with the Scandinavia custom faction. <pre>
mod_variable_local xmg_rating:UseCustomFactions:true
+
mod_variable_local custom_factions:UseCustomFactions:true
mod_variable_local xmg_rating:CustomAttackerFactionID:NA
+
mod_variable_local custom_factions:CustomAttackerFactionID:NA
mod_variable_local xmg_rating:CustomDefenderFactionID:Scand
+
mod_variable_local custom_factions:CustomDefenderFactionID:Scand
 
</pre>
 
</pre>

Revision as of 10:22, 9 September 2023

This page refers to a community made workshop mod created by User:Elf . For support using the mod, you can request support on the official holdfast discord in #Server-Owners.

AGS / Harper have provided a template for creating Custom Factions to support this mod.


This mod allows for players to replace the in-game assets to create custom factions by overriding existing factions.

Installing the mod

Before you can start creating custom factions, you must get your SDK setup.

  1. Install the Holdfast SDK
  2. Install a code editor (eg Visual Studio) . This is required for the SDK to correctly build script-based mods.
  3. Make sure the SDK has your code editor linked. This can be found from edit -> Preferences -> External Tools and then selecting the correct External Script Editor.
  4. Create a new empty mod.
  5. Download and copy files from GitHub into the mod folder. The scripts MUST be in the mods folder or they will not be included in the build.

Replacing Factions

With a new mod created and files downloaded from the Github page, your folder should look like this:

Custom faction Mod folder structure


Inside this file are three two sub-directories and a scene file.

  • The scripts folder should not be touched since it is how the mod replaces the ingame assets.
  • The official templates provided by Harper and AGS can be used as references to create custom faction images.
  • The scene file is what will be used to create the mod.
Custom factions folder structure.png
  1. Open up the scene file. In the scene is an object called "[Manager]" click this to open the inspector in the right hand side of Unity. Top right click the padlock to fix it in place.
  2. Click the plus button to create your first custom faction. You can repeat this process to create multiple custom factions on the same mod.
  3. Fill the references in. Use the templates provided and the table as reference material
  4. Build and upload the mod. Make sure the scripts are inside the build folder otherwise it will not work.
Inspector
References
Filled in references
Property Type Description Template
Faction ID Name string ID used for the faction when not using faction based replacement
Faction to override enum enum of which base-game faction the faction will replace
Custom Name to Use string The faction name used in the Spawn menu and end of round screen
Custom Name Adjective string Adjective to describe players of the factions. For example "the british are victorious" instead of "the britain are victorious"
Faction Crest Sprite This is the crest image of the faction used in various menus.
Rhein Crest
Faction Emblem Sprite Emblem image used in the scoreboard and other menus.
Rhein Emblem
Faction Background Selection Sprite Background flag used on the "Select faction" screen. This flag is only half of the image with a fade applied. Harper has provided a template for this, I recommend you use it.
Rhein background
Faction Top Image Sprite Flag used for the Top bar panel where faction scores are contained.
Rhein Top image
Faction Map Voting Image Sprite Icon used for the map voting screen when a faction is selectable
Rhein Map voting Icon
Flag replacement Image Texture Texture used to replace in-game flags eg the flag shown in the spawn menu. I recommend using the Top Image for this.
Rhein Top Image

Configuration Settings

By default the mod will assign one Custom faction to one existing factions. However sometimes you may need more faction replacements than factions which exist in the game. For example the naval game mode only has two in game factions. Therefore by the config you can define which faction to override based on the attacker and defender name.


This will use custom factions based on ID instead of faction.

mod_variable custom_factions:UseCustomFactions:true

This will replace <faction ID> for the attacking or defending faction.

mod_variable custom_factions:CustomAttackerFactionID:<faction ID> mod_variable custom_factions:CustomDefenderFactionID:<faction ID>

Example

For the melee community, a mod allows different national teams to be selected. The mod has 10+ factions which would not be possible without custom ID's. The following will replace the attacking faction with the NA custom faction and the defending faction with the Scandinavia custom faction.

mod_variable_local custom_factions:UseCustomFactions:true
mod_variable_local custom_factions:CustomAttackerFactionID:NA
mod_variable_local custom_factions:CustomDefenderFactionID:Scand