Tutorials:Name Change Scripts: Difference between revisions
DoctorDalek (talk | contribs) (Created page with "== Overview == Name change scripts are executed on the client's machine whenever they change their name from the Playnite extension or directly after the install script has executed. These scripts are dedicated solely to renaming a player's in-game name to ensure a consistency in multiplayer games. Handling a name change primarily depends on how the game handles player saves. Game engines that store player names in plain text (e.g. Source,...") |
DoctorDalek (talk | contribs) No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Tutorials]] | |||
== Overview == | == Overview == | ||
Name change scripts are executed on the client's machine whenever they change their name from the Playnite extension or directly after the [[Tutorials:Install Scripts|install script]] has executed. These scripts are dedicated solely to renaming a player's in-game name to ensure a consistency in multiplayer games. | Name change scripts are executed on the client's machine whenever they change their name from the Playnite extension or directly after the [[Tutorials:Install Scripts|install script]] has executed. These scripts are dedicated solely to renaming a player's in-game name to ensure a consistency in multiplayer games. | ||
There are a few guidelines that are recommended to follow when implementing a name change script for a game: | |||
* The script should only replace the current name and should not touch anything outside of the player's profile | |||
* Avoid leaving residual files on name changes. For instance, some games may have an entire file dedicated to a player's profile. This file should be renamed/altered to reflect the new name instead of a straight copy to a new profile. | |||
* Review the [[Tutorials:PowerShell_Variables#Name_Change_Scripts|name change script variables]] for more information available during script execution | |||
* Many games have a limit on the amount of characters a player name can have. Make sure to trim or pad your player names if required. This is especially crucial for games that store the player name in a binary file. Read [[Tutorials:PowerShell_Cmdlets]] for helper cmdlets that may help in these scenarios. | |||
Handling a name change primarily depends on how the game handles player saves. Game engines that store player names in plain text (e.g. Source, id Tech X, Unreal, etc.) are easily replaceable by using [https://en.wikipedia.org/wiki/Regular_expression regular expressions] (regex). Older games may have save files that need a [[Tutorials:Binary Patch|binary patch]]. Others may just use a registry key. | Handling a name change primarily depends on how the game handles player saves. Game engines that store player names in plain text (e.g. Source, id Tech X, Unreal, etc.) are easily replaceable by using [https://en.wikipedia.org/wiki/Regular_expression regular expressions] (regex). Older games may have save files that need a [[Tutorials:Binary Patch|binary patch]]. Others may just use a registry key. | ||
== | == Variables == | ||
When executing a name change script, the new name is available as a variable <code>$NewPlayerAlias</code>. The old name (not available when executed on install) is another variable that may be accessed using <code>$OldPlayerAlias</code>. | |||
For a list of documented name change scripts, see [[:Category:Games With Name Change Scripts]]. |
Latest revision as of 23:07, 27 December 2023
Overview
Name change scripts are executed on the client's machine whenever they change their name from the Playnite extension or directly after the install script has executed. These scripts are dedicated solely to renaming a player's in-game name to ensure a consistency in multiplayer games.
There are a few guidelines that are recommended to follow when implementing a name change script for a game:
- The script should only replace the current name and should not touch anything outside of the player's profile
- Avoid leaving residual files on name changes. For instance, some games may have an entire file dedicated to a player's profile. This file should be renamed/altered to reflect the new name instead of a straight copy to a new profile.
- Review the name change script variables for more information available during script execution
- Many games have a limit on the amount of characters a player name can have. Make sure to trim or pad your player names if required. This is especially crucial for games that store the player name in a binary file. Read Tutorials:PowerShell_Cmdlets for helper cmdlets that may help in these scenarios.
Handling a name change primarily depends on how the game handles player saves. Game engines that store player names in plain text (e.g. Source, id Tech X, Unreal, etc.) are easily replaceable by using regular expressions (regex). Older games may have save files that need a binary patch. Others may just use a registry key.
Variables
When executing a name change script, the new name is available as a variable $NewPlayerAlias
. The old name (not available when executed on install) is another variable that may be accessed using $OldPlayerAlias
.
For a list of documented name change scripts, see Category:Games With Name Change Scripts.