StarCraft: Difference between revisions

From LANCommander
No edit summary
No edit summary
 
Line 9: Line 9:
{{Game.InfoBox.ReleaseDate|Windows|March 31, 1998}}
{{Game.InfoBox.ReleaseDate|Windows|March 31, 1998}}
|Genres =
|Genres =
{{Game.InfoBox.Genre|Real Time Strategy (RTS)}}
{{Game.InfoBox.Genre|Real Time Strategy (RTS)}}{{Game.InfoBox.Genre|Strategy}}
{{Game.InfoBox.Genre|Strategy}}
|PCGamingWiki = StarCraft}}
| PCGamingWiki = StarCraft
 
{{Game.ActionBox
|Actions =
{{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\StarCraft.exe|Arguments = |WorkingDirectory = |Primary = True}}
}}
}}


{{Game.Scripts.NameChange
 
|Name = Name Change Script
{{Game.Scripts.Install
|Name = Install Script
|Description =  
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$NewName = $args[0]
<syntaxhighlight lang="powershell" line>
$InstallDir = $PSScriptRoot
cd "$InstallDirectory\StarCraft Key Changer"


New-Item -ItemType Directory -Force -Path "$InstallDir\characters"
Start-Process "Change StarCraft Key.exe" -ArgumentList "$InstallDirectory" -Wait
Copy-Item -Path "$InstallDir\Default.mpc" -Destination "$InstallDir\characters\$NewName.mpc"
</syntaxhighlight>
</syntaxhighlight>
}}
}}
 
           
{{Game.Scripts.KeyChange
{{Game.Scripts.NameChange
|Name = Key Change Script
|Name = Name Change Script
|Description = StarCraft stores the CD key in the stardat.mpq archive. This is a custom archive format used by Blizzard in some older games. Applications such as [https://www.hiveworkshop.com/threads/ladiks-mpq-editor.249562/ Ladik's MPQ Editor] can manipulate this type of file, but there is currently no command-line-only way to change the key. This script will run an [https://www.autohotkey.com/ AutoHotkey] script that will launch a tool called [http://www.icyhell.net/2008/04/05/starcraft-cd-key-changer/ StarCraft CD-Key Changer] and automate the input of the allocated key. For ease of distribution, it is recommended that you compile the AutoHotkey script to an .exe executable. This will allow you to run the script without having AutoHotkey installed on the client machine.
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents =
|Contents =
=== AutoHotkey Script ===
<syntaxhighlight lang="ahk" line>
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#WinActivateForce  ; Recommended for new scripts due to its superior speed and reliability.
SetTitleMatchMode, 2
Run, SCKeyChanger.exe
WinWait, ahk_exe SCKeyChanger.exe
WinGetActiveTitle, ChangerTitle
Sleep, 100
Send, C
Send, Player{Tab}
key = %2%
StringMid, keyPart1, key, 1, 4
StringMid, keyPart2, key, 5, 5
StringMid, keyPart3, key, 10, 4
Send, %keyPart1%{Tab}
Send, %keyPart2%{Tab}
Send, %keyPart3%{Enter}
Sleep, 500
Send, %1%{Enter}
Sleep, 500
WinActivate, %ChangerTitle%
WinWaitActive, %ChangerTitle%
Send, X
return
</syntaxhighlight>
=== PowerShell Script ===
<syntaxhighlight lang="powershell" line>
<syntaxhighlight lang="powershell" line>
cd "$InstallDir\StarCraft Key Changer"
$NewPlayerAlias = $NewPlayerAlias.Split([IO.Path]::GetInvalidFileNameChars()) -join '_'


Start-Process "Change StarCraft Key.exe" -ArgumentList "$InstallDir","$args[0]" -Wait
New-Item -ItemType Directory -Force -Path "$InstallDirectory\characters"
Copy-Item -Path "$InstallDirectory\Default.mpc" -Destination "$InstallDirectory\characters\$NewPlayerAlias.mpc"
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 21:57, 8 January 2024

Developers
Blizzard Entertainment
Publishers
Blizzard Entertainment
Release Date
Windows: March 31, 1998
Genres
Real Time Strategy (RTS)Strategy
View at PCGamingWiki

Actions

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

Install Script

cd "$InstallDirectory\StarCraft Key Changer"

Start-Process "Change StarCraft Key.exe" -ArgumentList "$InstallDirectory" -Wait

Name Change Script

$NewPlayerAlias = $NewPlayerAlias.Split([IO.Path]::GetInvalidFileNameChars()) -join '_'

New-Item -ItemType Directory -Force -Path "$InstallDirectory\characters"
Copy-Item -Path "$InstallDirectory\Default.mpc" -Destination "$InstallDirectory\characters\$NewPlayerAlias.mpc"