Serious Sam: The First Encounter: Difference between revisions
DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Croteam}} |Publishers = {{Game.InfoBox.Publisher|Gathering of Developers}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|March 1, 2001}} |Genres = {{Game.InfoBox.Genre|Indie}} {{Game.InfoBox.Genre|Shooter}} | PCGamingWiki = Serious_Sam:_The_First_Encounter }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = Bin/SeriousSam.exe|Arguments = |WorkingDirectory...") |
DoctorDalek (talk | contribs) No edit summary |
||
Line 9: | Line 9: | ||
{{Game.InfoBox.ReleaseDate|Windows|March 1, 2001}} | {{Game.InfoBox.ReleaseDate|Windows|March 1, 2001}} | ||
|Genres = | |Genres = | ||
{{Game.InfoBox.Genre|Indie}} | {{Game.InfoBox.Genre|Indie}}{{Game.InfoBox.Genre|Shooter}} | ||
{{Game.InfoBox.Genre|Shooter}} | |PCGamingWiki = Serious_Sam:_The_First_Encounter}} | ||
| PCGamingWiki = Serious_Sam:_The_First_Encounter | |||
}} | |||
{{Game.ActionBox | {{Game.ActionBox | ||
|Actions = | |Actions = | ||
{{Game.ActionBox.Row|Name = Play|Path = Bin/SeriousSam.exe|Arguments = |WorkingDirectory = |Primary = True}} | {{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\Bin/SeriousSam.exe|Arguments = |WorkingDirectory = |Primary = True}} | ||
}} | }} | ||
{{Game.Scripts. | |||
|Name = | {{Game.Scripts.Install | ||
|Name = Install Script | |||
|Description = | |Description = | ||
|RequiresAdmin = False | |RequiresAdmin = False | ||
|Contents = <syntaxhighlight lang="powershell" line> | |Contents = | ||
$ | <syntaxhighlight lang="powershell" line> | ||
$ | # Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height | ||
$Display = Get-PrimaryDisplay | |||
# Use regex to replace text within a file. Quotes are escaped by double quoting ("") | |||
Write-ReplaceContentInFile -Pattern '^persistent extern INDEX sam_iScreenSizeI=\(INDEX\)(\d+);' -Substitution "persistent extern INDEX sam_iScreenSizeI=(INDEX)$($Display.Bounds.Width);" -FilePath "$InstallDirectory\Scripts\PersistentSymbols.ini" | |||
Write-ReplaceContentInFile -Pattern '^persistent extern INDEX sam_iScreenSizeJ=\(INDEX\)(\d+);' -Substitution "persistent extern INDEX sam_iScreenSizeJ=(INDEX)$($Display.Bounds.Height);" -FilePath "$InstallDirectory\Scripts\PersistentSymbols.ini" | |||
# Might need to set FOV | |||
$FOV = 90 | |||
if (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 9)) { | |||
$FOV = 105 | |||
} elseif (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 10)) { | |||
$FOV = 100 | |||
} | } | ||
Write-ReplaceContentInFile -Pattern '^persistent extern user FLOAT plr_fFOV=\(FLOAT\)(\d+);' -Substitution "persistent extern FLOAT plr_fFOV=\(FLOAT\)$FOV;" -FilePath "$InstallDirectory\Scripts\PersistentSymbols.ini" | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
{{Game.Scripts. | {{Game.Scripts.NameChange | ||
|Name = | |Name = Name Change Script | ||
|Description = | |Description = | ||
|RequiresAdmin = False | |RequiresAdmin = False | ||
|Contents = <syntaxhighlight lang="powershell" line> | |Contents = | ||
<syntaxhighlight lang="powershell" line> | |||
# Converts a string to a UTF16-encoded byte array. This looks like ASCII characters separated by 0x00 in most cases. | |||
$ | $nameBytes = ConvertTo-StringBytes -Input $NewPlayerAlias -MaxLength 11 -MinLength 11 | ||
$teamBytes = ConvertTo-StringBytes -Input "Vintage" -MaxLength 7 -MinLength 7 | |||
Copy-Item -Path "$InstallDirectory\ProfileTemplate" -Destination "$InstallDirectory\Players\Player0.plr" | |||
Edit-PatchBinary -FilePath "$InstallDirectory\Players\Player0.plr" -Offset 0x8 -Data $nameBytes | |||
Edit-PatchBinary -FilePath "$InstallDirectory\Players\Player0.plr" -Offset 0x17 -Data $teamBytes | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} |
Latest revision as of 21:54, 8 January 2024
Developers | |
---|---|
Croteam | |
Publishers | |
Gathering of Developers | |
Release Date | |
Windows: March 1, 2001 | |
Genres | |
IndieShooter | |
View at PCGamingWiki |
Actions
Name | Path | Arguments | Working Directory | Primary |
---|---|---|---|---|
Play | {InstallDir}\Bin/SeriousSam.exe | True |
Install Script
# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay
# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^persistent extern INDEX sam_iScreenSizeI=\(INDEX\)(\d+);' -Substitution "persistent extern INDEX sam_iScreenSizeI=(INDEX)$($Display.Bounds.Width);" -FilePath "$InstallDirectory\Scripts\PersistentSymbols.ini"
Write-ReplaceContentInFile -Pattern '^persistent extern INDEX sam_iScreenSizeJ=\(INDEX\)(\d+);' -Substitution "persistent extern INDEX sam_iScreenSizeJ=(INDEX)$($Display.Bounds.Height);" -FilePath "$InstallDirectory\Scripts\PersistentSymbols.ini"
# Might need to set FOV
$FOV = 90
if (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 9)) {
$FOV = 105
} elseif (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 10)) {
$FOV = 100
}
Write-ReplaceContentInFile -Pattern '^persistent extern user FLOAT plr_fFOV=\(FLOAT\)(\d+);' -Substitution "persistent extern FLOAT plr_fFOV=\(FLOAT\)$FOV;" -FilePath "$InstallDirectory\Scripts\PersistentSymbols.ini"
Name Change Script
# Converts a string to a UTF16-encoded byte array. This looks like ASCII characters separated by 0x00 in most cases.
$nameBytes = ConvertTo-StringBytes -Input $NewPlayerAlias -MaxLength 11 -MinLength 11
$teamBytes = ConvertTo-StringBytes -Input "Vintage" -MaxLength 7 -MinLength 7
Copy-Item -Path "$InstallDirectory\ProfileTemplate" -Destination "$InstallDirectory\Players\Player0.plr"
Edit-PatchBinary -FilePath "$InstallDirectory\Players\Player0.plr" -Offset 0x8 -Data $nameBytes
Edit-PatchBinary -FilePath "$InstallDirectory\Players\Player0.plr" -Offset 0x17 -Data $teamBytes