Translations:Modding:Preparing For Code Mods/11/en: Difference between revisions

From Vintage Story Wiki
(Importing a new version from external source)
 
(No difference)

Latest revision as of 10:45, 20 May 2024

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Modding:Preparing For Code Mods)
When you have your game folder open in Windows file explorer, you need to open this folder in powershell. '''Ensure you do not have a file or folder selected,''' and click 'File' in the menu bar, then click 'Open Windows PowerShell'.
[[File:OpenVintageStoryFolderInPowershell.png|center|frameless|388x388px]]
Powershell will open with your current file path. Ensure that the file path stated does not include the '<nowiki/>''assets''<nowiki/>', '<nowiki/>''mods''<nowiki/>', or '''lib''<nowiki/>' folders. Paste the following line into powershell, and press enter to run it.<syntaxhighlight lang="powershell">
[Environment]::SetEnvironmentVariable("VINTAGE_STORY", ($pwd.path), "User")
</syntaxhighlight>This will create the environment variable called "VINTAGE_STORY", and set its value to be the current working directory (the Vintage Story folder). The "user" parameter simply stores this variable as a user-only environment variable, meaning other users on your PC will not be able to use this variable.
{| class="wikitable mw-collapsible mw-collapsed"
|Test your environment variable
|-
|To ensure your environment variable has been created correctly, run the following command in the opened powershell:<syntaxhighlight lang="powershell">
echo $env:VINTAGE_STORY
</syntaxhighlight>This should print the full path to your vintage story directory. If it does not, then repeat this section.
|}
When you have set a new environment variable, it is recommended to restart your PC. This will ensure that all programs are using your updated environment variables.

When you have your game folder open in Windows file explorer, you need to open this folder in powershell. Ensure you do not have a file or folder selected, and click 'File' in the menu bar, then click 'Open Windows PowerShell'.

OpenVintageStoryFolderInPowershell.png

Powershell will open with your current file path. Ensure that the file path stated does not include the 'assets', 'mods', or 'lib' folders. Paste the following line into powershell, and press enter to run it.

[Environment]::SetEnvironmentVariable("VINTAGE_STORY", ($pwd.path), "User")

This will create the environment variable called "VINTAGE_STORY", and set its value to be the current working directory (the Vintage Story folder). The "user" parameter simply stores this variable as a user-only environment variable, meaning other users on your PC will not be able to use this variable.

Test your environment variable
To ensure your environment variable has been created correctly, run the following command in the opened powershell:
echo $env:VINTAGE_STORY
This should print the full path to your vintage story directory. If it does not, then repeat this section.

When you have set a new environment variable, it is recommended to restart your PC. This will ensure that all programs are using your updated environment variables.