Difference between revisions of "Custom Factions"

From Holdfast: Nations At War
Jump to navigation Jump to search
Line 1: Line 1:
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.  
+
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.  
  
  
Line 13: Line 13:
  
 
== Replacing Factions ==
 
== Replacing Factions ==
 +
With a new mod created and files downloaded from the Github page, your folder should look like this:
 +
 +
 +
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.
 +
 +
# 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.
 +
#
 +
 
{| class="wikitable"
 
{| class="wikitable"
 
|+
 
|+
!Property Name
+
!Property
 
!Type
 
!Type
 
!Description
 
!Description
Line 32: Line 45:
 
|Custom Name to Use
 
|Custom Name to Use
 
|string
 
|string
|The faction name used for the scoreboard or spawn menu.
+
|The faction name used in the Spawn menu and end of round screen
 
|
 
|
 
|-
 
|-
Line 40: Line 53:
 
|
 
|
 
|-
 
|-
|Top Bar Sprite
+
|Faction Crest
|sprite
+
|Sprite
|The flag icons used at the top of the screen showing faction score.
+
|This is the crest image of the faction used in various menus.  
|
+
|[[File:Custom factions crest.png|thumb|Rhein Crest]]
 
|-
 
|-
|Scoreboard Sprite
+
|Faction Emblem
|sprite
+
|Sprite
|Image used on the scoreboard for the faction
+
|Emblem image used in the scoreboard and other menus.
|
+
|[[File:Custom factions emlem.png|thumb|209x209px|Rhein Emblem]]
 
|-
 
|-
|Faction Selection Sprite
+
|Faction Background Selection
|sprite
+
|Sprite
|Image used for the faction selection screen
+
|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.
|
+
|[[File:Custom factions backgrouind.png|thumb|151x151px|Rhein background]]
 
|-
 
|-
|Faction Selection Disabled Sprite
+
|Faction Top Image
|
+
|Sprite
|Image used for the faction selection screen if spawning is not enabled for the faction (eg player limit reached)
+
|Flag used for the Top bar panel where faction scores are contained.
|
+
|[[File:Custom factions topflag.png|thumb|153x153px|Rhein Top image]]
 
|-
 
|-
|Square Round End Board Sprite
+
|Faction Map Voting Image
 
|Sprite
 
|Sprite
|Emblem used for the round end scoreboard
+
|Icon used for the map voting screen when a faction is selectable
|
+
|[[File:Custom factions mapvoting.png|thumb|178x178px|Rhein Map voting Icon]]
|-
 
|Flag Replacement Image
 
|Texture2D
 
|Texture used when replacing in-game flag objects (eg capture points).
 
|
 
 
|-
 
|-
|Map Voting Sprite
+
|Flag replacement Image
|sprite
+
|Texture
|Emblem used for the faction when map voting.
+
|Texture used to replace in-game flags eg the flag shown in the spawn menu. I recommend using the Top Image for this.  
|
+
|[[File:Custom factions topflag.png|thumb|153x153px|Rhein Top Image]]
 
|}
 
|}
  

Revision as of 09:38, 9 September 2023

FThis 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.


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:


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.
  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.
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 gamemode only has two ingame 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 xmg_rating:UseCustomFactions:true

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

mod_variable xmg_rating:CustomAttackerFactionID:<faction ID> mod_variable xmg_rating: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 xmg_rating:UseCustomFactions:true
mod_variable_local xmg_rating:CustomAttackerFactionID:NA
mod_variable_local xmg_rating:CustomDefenderFactionID:Scand