Jagged Alliance 2: Difference between revisions

From LANCommander
(Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Sir-Tech Canada}} |Publishers = {{Game.InfoBox.Publisher|TalonSoft}} {{Game.InfoBox.Publisher|Titan Computer}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|July 23, 1999}} |Genres = {{Game.InfoBox.Genre|Adventure}} {{Game.InfoBox.Genre|Turn-based strategy (TBS)}} {{Game.InfoBox.Genre|Strategy}} {{Game.InfoBox.Genre|Role-playing (RPG)}} {{Game.InfoBox.Genre|Tactical}} | PCGam...")
 
No edit summary
 
Line 5: Line 5:
{{Game.InfoBox.Developer|Sir-Tech Canada}}
{{Game.InfoBox.Developer|Sir-Tech Canada}}
|Publishers =
|Publishers =
{{Game.InfoBox.Publisher|TalonSoft}}
{{Game.InfoBox.Publisher|TalonSoft}}{{Game.InfoBox.Publisher|Titan Computer}}
{{Game.InfoBox.Publisher|Titan Computer}}
|Release Date =
|Release Date =
{{Game.InfoBox.ReleaseDate|Windows|July 23, 1999}}
{{Game.InfoBox.ReleaseDate|Windows|July 23, 1999}}
|Genres =
|Genres =
{{Game.InfoBox.Genre|Adventure}}
{{Game.InfoBox.Genre|Adventure}}{{Game.InfoBox.Genre|Turn-based strategy (TBS)}}{{Game.InfoBox.Genre|Strategy}}{{Game.InfoBox.Genre|Role-playing (RPG)}}{{Game.InfoBox.Genre|Tactical}}
{{Game.InfoBox.Genre|Turn-based strategy (TBS)}}
|PCGamingWiki = Jagged_Alliance_2}}
{{Game.InfoBox.Genre|Strategy}}
{{Game.InfoBox.Genre|Role-playing (RPG)}}
{{Game.InfoBox.Genre|Tactical}}
| PCGamingWiki = Jagged_Alliance_2
}}


{{Game.ActionBox
{{Game.ActionBox
|Actions =  
|Actions =  
{{Game.ActionBox.Row|Name = Play|Path = ja2.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\ja2.exe|Arguments = |WorkingDirectory = |Primary = True}}
}}
}}


{{Game.Scripts.Install
|Name = Install Script
|Description =
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
$Display = Get-PrimaryDisplay
Write-ReplaceContentInFile -Pattern '^SCREEN_RESOLUTION = .+' -Substitution "SCREEN_RESOLUTION = 24" -FilePath "$InstallDirectory\Ja2.ini"
Write-ReplaceContentInFile -Pattern '^EDITOR_SCREEN_RESOLUTION = .+' -Substitution "EDITOR_SCREEN_RESOLUTION = 24" -FilePath "$InstallDirectory\Ja2.ini"
Write-ReplaceContentInFile -Pattern '^CUSTOM_SCREEN_RESOLUTION_X = .+' -Substitution "CUSTOM_SCREEN_RESOLUTION_X = $($Display.Bounds.Width)" -FilePath "$InstallDirectory\Ja2.ini"
Write-ReplaceContentInFile -Pattern '^CUSTOM_SCREEN_RESOLUTION_Y = .+' -Substitution "CUSTOM_SCREEN_RESOLUTION_Y = $($Display.Bounds.Height)" -FilePath "$InstallDirectory\Ja2.ini"
</syntaxhighlight>
}}
           
{{Game.Scripts.NameChange
{{Game.Scripts.NameChange
|Name = Name Change Script
|Name = Name Change Script
|Description =  
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$NewName = $args[0]
<syntaxhighlight lang="powershell" line>
$InstallDir = $PSScriptRoot
if ($NewPlayerAlias.Length -gt 11) {
 
     $NewPlayerAlias = $NewPlayerAlias.Substring(0, 11)
if ($NewName.Length -gt 11) {
     $NewName = $NewName.Substring(0, 11)
}
 
function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}
}


Write-ReplaceContentInFile -Regex '^PLAYER_NAME = (.+)' -Replacement "PLAYER_NAME = $NewName" -FilePath "$InstallDir\Profiles\UserProfile_JA2113\Ja2_mp.ini"
Write-ReplaceContentInFile -Pattern '^PLAYER_NAME = (.+)' -Substitution "PLAYER_NAME = $NewPlayerAlias" -FilePath "$InstallDirectory\Profiles\UserProfile_JA2113\Ja2_mp.ini"
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 02:13, 6 January 2024

Developers
Sir-Tech Canada
Publishers
TalonSoftTitan Computer
Release Date
Windows: July 23, 1999
Genres
AdventureTurn-based strategy (TBS)StrategyRole-playing (RPG)Tactical
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play {InstallDir}\ja2.exe True

Install Script

$Display = Get-PrimaryDisplay

Write-ReplaceContentInFile -Pattern '^SCREEN_RESOLUTION = .+' -Substitution "SCREEN_RESOLUTION = 24" -FilePath "$InstallDirectory\Ja2.ini"
Write-ReplaceContentInFile -Pattern '^EDITOR_SCREEN_RESOLUTION = .+' -Substitution "EDITOR_SCREEN_RESOLUTION = 24" -FilePath "$InstallDirectory\Ja2.ini"
Write-ReplaceContentInFile -Pattern '^CUSTOM_SCREEN_RESOLUTION_X = .+' -Substitution "CUSTOM_SCREEN_RESOLUTION_X = $($Display.Bounds.Width)" -FilePath "$InstallDirectory\Ja2.ini"
Write-ReplaceContentInFile -Pattern '^CUSTOM_SCREEN_RESOLUTION_Y = .+' -Substitution "CUSTOM_SCREEN_RESOLUTION_Y = $($Display.Bounds.Height)" -FilePath "$InstallDirectory\Ja2.ini"

Name Change Script

if ($NewPlayerAlias.Length -gt 11) {
    $NewPlayerAlias = $NewPlayerAlias.Substring(0, 11)
}

Write-ReplaceContentInFile -Pattern '^PLAYER_NAME = (.+)' -Substitution "PLAYER_NAME = $NewPlayerAlias" -FilePath "$InstallDirectory\Profiles\UserProfile_JA2113\Ja2_mp.ini"