Difference between revisions of "Custom Factions"

From Holdfast: Nations At War
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
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.  
 
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. 
 +
  
  
 
This mod allows for players to replace the in-game assets to create custom factions by overriding existing factions.  
 
This mod allows for players to replace the in-game assets to create custom factions by overriding existing factions.  
  
== Setting up the Mod ==
+
== Installing the mod ==
 
+
Before you can start creating custom factions, you must get your SDK setup.
 
# Install the [[SDK User Guide|Holdfast SDK]]
 
# Install the [[SDK User Guide|Holdfast SDK]]
# Install a code editor (eg [https://visualstudio.microsoft.com/ Visual Studio]) . This is required for the SDK to correctly build script-based mods.  
+
# Install a code editor (eg [https://visualstudio.microsoft.com/ Visual Studio]) . This is required for the SDK to correctly build script-based mods.
# 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.  
+
# 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.
# Create a new empty mod.  
+
# Create a new empty mod.
# 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.  
+
# Download and copy files from [https://github.com/LoganBlinco/BaseCustomFactionMod GitHub] into the mod folder. The scripts '''MUST''' be in the mods folder or they will not be included in the build.
  
 
== Replacing Factions ==
 
== Replacing Factions ==
 +
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]]
 +
 +
 +
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.
 +
[[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.
 +
# 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]]
 +
#
 +
 
{| class="wikitable"
 
{| class="wikitable"
 
|+
 
|+
!Property Name
+
!Property
 
!Type
 
!Type
 
!Description
 
!Description
Line 32: Line 54:
 
|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 62:
 
|
 
|
 
|-
 
|-
|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
+
|Flag replacement Image
|Texture2D
+
|Texture
|Texture used when replacing in-game flag objects (eg capture points).
+
|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]]
|-
 
|Map Voting Sprite
 
|sprite
 
|Emblem used for the faction when map voting.
 
|
 
 
|}
 
|}
 +
== 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>

Latest revision as of 10:26, 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