Professional Documents
Culture Documents
<#
.SYNOPSIS
Starts Noita from a PowerShell prompt, optionally with a specific set seed
for a new game.
.DESCRIPTION
To use this function, copy and paste the complete function definition into
a PowerShell
session, and then invoke it with `Start-Noita`. Supply `-Seed somevalue` if
you would like
to run a specific seed (see the examples below).
.EXAMPLE
PS> Start-Noita
.EXAMPLE
PS> Start-Noita -Seed 1
.EXAMPLE
PS> Start-Noita -Seed 1 -Path C:\Noita\noita.exe
Starts Noita from the requested location with a fixed seed value of 1.
Use this form if your copy of Noita was not installed via Steam, or modify
the default
setting for $Path below before loading the function into your PowerShell
session.
.NOTES
If you want, you can load this function into your PowerShell profile as
follows:
1. Copy the entire function definition from top to bottom to your Windows
clipboard (Ctrl+C).
2. Run the following code in PowerShell:
[Parameter(ParameterSetName = 'Default')]
[switch]
$DevMode,
[Parameter(Mandatory, ParameterSetName = 'Unpack')]
[switch]
$UnpackData
)
$noitaArgs = @()
$noitaFolder = $Path | Split-Path -Parent
if ($Seed) {
$xml = [System.Xml.XmlDocument]::new()
$node = $xml.CreateElement('MagicNumbers')
$xml.AppendChild($node) > $null
$blank = $xml.CreateTextNode([Environment]::NewLine)
$node.AppendChild($blank) > $null
$node.SetAttribute('WORLD_SEED', $Seed)
$node.SetAttribute('_DEBUG_DONT_LOAD_OTHER_MAGIC_NUMBERS', 1)
$node.SetAttribute('_DEBUG_DONT_SAVE_MAGIC_NUMBERS', 1)
$noitaArgs = @(
'-no_logo_splashes'
'-magic_numbers', 'magic.txt'
)
}
elseif ($UnpackData) {
$noitaArgs = @(
'-wizard_unpak'
)
}
$filename = if ($DevMode) {
'noita_dev.exe'
}
else {
'noita.exe'
}
try {
Push-Location $Path
& $executable @noitaArgs
}
finally {
Pop-Location
}
}