Difference between revisions of "Sandbox"

From BTAWiki
Jump to navigation Jump to search
m (Some tweaks)
(New Linux guide)
Line 1: Line 1:
== Installation Guide: ==
+
<div id="" class="" style="clear: right; margin: -1em 0 0 10px; float: right; padding: 10px; background: transparent; width: 200px; ">__TOC__</div>
'''Please note:''' Linux users will not be able to run BattleTech using the "Launch BTA 3062" button in the BTA launcher. You will have to open it through Steam or by running the BattleTech executable file.
+
 
 +
This guide assumes you are using the native Linux version of BattleTech. If you installed the Windows version, got it running with Proton, and successfully installed BTA, please write up a document similar to this one for your scenario.
 +
 
 +
= 1. Prepare =
 +
 
 +
== 1.1. Set some vars we’ll need later to avoid typos ==
 +
 
 +
Double-check these paths with your local installation, they may be different.
 +
 
 +
$ BTA_ROOT="$HOME/src/BATTLETECH/BTA"
 +
=== Steam on Debian ===
  
=== 1. Prep work. ===
 
 
: '''1a.''' Set some vars we’ll need later to avoid typos
 
 
$ BTA_SOURCE="$HOME/src/BATTLETECH/BTA"
 
 
  $ BT_ROOT="$HOME/.steam/debian-installation/steamapps/common/BATTLETECH"
 
  $ BT_ROOT="$HOME/.steam/debian-installation/steamapps/common/BATTLETECH"
: '''1b.''' Ensure dependencies are installed
+
=== Steam on other distros ===
 +
 
 +
Check your <code>$HOME/.steam</code> directory and modify the above environment variable assignment accordingly.
 +
 
 +
=== GOG ===
 +
 
 +
$ BT_ROOT="$HOME/GOG Games/BATTLETECH"
 +
== 1.2. Ensure dependencies are installed ==
 +
 
 +
{| class="wikitable"
 +
! Package*
 +
! Purpose
 +
|-
 +
| wine
 +
| run the installer
 +
|-
 +
| unzip
 +
| unzip the installer package
 +
|-
 +
| jq
 +
| allow pathfinder.sh to parse JSON
 +
|}
 +
 
 +
<nowiki>*</nowiki> Package name may differ on your distribution.
  
:: Package managers vary from distro to distro, so it’s assumed you know how to navigate the distro you’re using.
+
=== Debian &amp; Friends (Ubuntu, Mint, Pop_OS!, PureOS) ===
:: I’m using Pop_OS!, which is of Debian lineage, so that’s what this how-to will use.
 
  
 
  $ sudo apt install wine unzip jq
 
  $ sudo apt install wine unzip jq
wine -- to run the installer<br>
+
=== RedHat &amp; Friends (Fedora, SuSe) ===
unzip -- to unzip the mod package<br>
+
 
jq -- to allow the pathfinder.sh mod path fixer to parse mod JSON files
+
$ sudo dnf install wine unzip jq
+
=== Arch &amp; Friends (Manjaro, GamerOS) ===
: '''1c.''' Prepare a Wine prefix for the BTA installer.
+
 
+
$ sudo pacman -S wine unzip jq
  $ mkdir -p "${BTA_SOURCE}"
+
== 1.3. Prepare Wine prefix for the BTA installer. ==
  $ cd "${BTA_SOURCE}"
+
 
 +
The wine-mono package listed here is for reference only. You can get the most recent version from https://dl.winehq.org/wine/wine-mono/.
 +
 
 +
  $ mkdir -p "${BTA_ROOT}"
 +
  $ cd "${BTA_ROOT}"
 
  $ wget https://dl.winehq.org/wine/wine-mono/6.1.0/wine-mono-6.1.0-x86.msi
 
  $ wget https://dl.winehq.org/wine/wine-mono/6.1.0/wine-mono-6.1.0-x86.msi
  $ WINEPREFIX="${BTA_SOURCE}/wine64" WINEARCH=win64 wine msiexec /i wine-mono-6.1.0-x86.msi
+
  $ WINEPREFIX="${BTA_ROOT}/wine64" WINEARCH=win64 wine msiexec /i wine-mono-6.1.0-x86.msi
: '''1d.''' Download the BTA Installer and Extract the .zip into ${BTA_SOURCE}
+
== 1.4. Download the BTA installer and Extract the .zip into <code>${BTA_ROOT}</code> ==
+
 
:: You’ll have to manually download the installer from NexusMods; then:
+
You’ll have to manually download the installer from NexusMods. Save it to your <code>${BTA_ROOT}</code>. Then unzip it.
+
 
  $ unzip "BattleTech Advanced 3062 Installer-452-v8-5-2-1613256258.zip"
+
  $ unzip 'BattleTech Advanced 3062 Installer-452-v8-5-2-1613256258.zip'
: '''1e.''' Prepare the Mods directory
+
== 1.5. Prepare the Mods directory ==
 +
 
 +
If you try to run BTA alongside other mods, problems are likely. If the Mods directory already exists, back it up (optional), and delete it.
  
:: If you try to run BTA alongside other mods, you are likely to have a bad time. 
+
Clean up and create the Mods directory:
:: If the Mods directory already exists, delete it.  Then (re)create it.
 
  
 
  $ rm -rf "${BT_ROOT}/Mods"
 
  $ rm -rf "${BT_ROOT}/Mods"
 
  $ mkdir -p "${BT_ROOT}/Mods"
 
  $ mkdir -p "${BT_ROOT}/Mods"
 +
== 1.6. Collect paths for the BTA installer ==
  
=== 2. Run the installer ===
+
The installer needs to know where to install to. It does not know how to browse into Linux “hidden” paths (such as $HOME/.steam). Instead, you must copy and paste paths into the installer’s file/directory chooser after clicking the “Browse” button.
 
$ WINEPREFIX=$HOME/src/BATTLETECH/BTA/wine64 WINEARCH=win64 wine BTAdvancedLauncher.exe
 
=== 3. Configure the installer ===
 
: '''3a.''' Click the "Advanced Mode" button.
 
: '''3b.''' Collect the installer paths
 
 
 
:: The installer needs to know where to install to. It cannot seem to browse into "hidden" paths (such as $HOME/.steam). Instead, you must copy and paste paths into the installer’s file/directory chooser after clicking the "Browse" button.
 
:: To add further complication, the installer seems unable to parse forward-slash-delimited paths. You must convert to back-slash-delimited paths. You also must include the Windows drive letter "Z:".
 
:: And so, let’s
 
 
: '''3c.''' Get those Windows paths:
 
 
:: Install Target path
 
$ echo "Z:${BT_ROOT}/Mods" | sed -e 's#/#\\#g'
 
:: The output should look like:
 
Z:\home\indigo\.steam\debian-installation\steamapps\common\BATTLETECH\Mods
 
:: Checkout Workspace path
 
$ echo "Z:${BTA_SOURCE}" | sed -e 's#/#\\#g'
 
:: BattleTech.exe Binary path
 
$ echo "Z:${BT_ROOT}/BattleTech" | sed -e 's#/#\\#g'
 
: '''3e.''' Input the Install Target path
 
:: Click the "Browse" button next to Install Target and copypasta the output into the "Filename" field of the file picker.
 
 
: '''3f.''' Input the Checkout Workspace path
 
:: Click on the "Browse" button next to Checkout Workspace and do like you did in 3e.
 
 
=== 4. Install BTA ===
 
Click the "Install and Update BTA" button. Pay attention to any popups or instructions.
 
 
: '''4a.''' Wait for it.
 
:: At some point the installer will complain that it cannot find BattleTech.exe and ask you for help. Remember that "BattleTech.exe Binary path" we generated earlier?  Give it that.
 
 
=== 5. Ensure all the paths and symlinks are correct ===
 
'''Note:''' This step is optional, depending on distribution.
 
 
 
At this point the installation for Windows is complete.  However, HBS was kind enough to provide us with a native binary, so we have to change the Windows mod paths to POSIX VFS semantics.
 
  
Thankfully some magical creature named "b2cc" has already written a script to do this for us.  The script is called "pathfinder.sh".  Let’s download and run pathfinder.sh now.
+
Also, the installer cannot parse Linux paths. You must convert them to Windows paths and include the Windows drive letter <code>Z:</code>, which is where wine mounts the Linux filesystem as if it were a Windows filesystem.
 
$ cd $HOME/.steam/debian-installation/steamapps/common/BATTLETECH
 
$ wget https://gist.githubusercontent.com/b2cc/c312bec251aaecbfedd07e4d4bda512e/raw/f7fdaa5bc458372b421a6a207e93c4d9ea257901/pathfinder.sh
 
$ bash pathfinder.sh -c
 
You should see a lot of console spam and green happy words.
 
 
=== 6. Okay, that’s it. ===
 
All done.  Go stomp.
 
Get your dakka dakka pew pew on.
 
  
== Troubleshooting ==
+
Collect those Windows paths:
  
The game loads but the main menu doesn’t say "BattleTech ADVANCED - 3062" and the ModTek version doesn’t show up under the game version next to the CREDITs button.
+
=== Install Target path ===
 
Cause #1: ModTek isn’t patched into the game correctly.
 
 
This can happen if mono is incorrectly installed or was not installed before the BTA installer was run the first time.
 
 
Solution: (re)run the ModTek Injector.  It should look like this if it worked correctly:
 
 
$ cd $HOME/.steam/debian-installation/steamapps/common/BATTLETECH/Mods/ModTek
 
$ WINEPREFIX=$HOME/src/BATTLETECH/BTA/wine64 WINEARCH=win64 wine ModTekInjector.exe
 
ModTek Injector
 
---------------
 
 
Assembly-CSharp.dll backed up to Assembly-CSharp.dll.orig
 
Injecting Assembly-CSharp.dll with ModTek.Injection.LoadModTek at BattleTech.Main.Start
 
Writing back to Assembly-CSharp.dll...
 
Injection complete!
 
If you have any issues, feel free to ping @Indigo on the [https://discord.com/invite/g5nCYAV BTA Discord channel].
 
  
 +
Examples:
  
 +
$ echo "Z:${BT_ROOT}/Mods" | sed -e 's#/#\\#g'
 +
Z:\home\indigo\.steam\debian-installation\steamapps\common\BATTLETECH\Mods
 +
=== Checkout Workspace path ===
  
= Gear Index =
+
$ echo "Z:${BTA_ROOT}" | sed -e 's#/#\\#g'
Gauss Rifle
+
Z:\home\indigo\src\BATTLETECH\BTA
 +
=== BattleTech.exe Binary path ===
  
=== EWAR ===
+
$ echo "Z:${BT_ROOT}/BattleTech" | sed -e 's#/#\\#g'
 +
Z:\home\indigo\.steam\debian-installation\steamapps\common\BATTLETECH\BattleTech
 +
= 2. Install BTA =
  
[[ECM]] (Guardian ECM, cGuardian ECM, Angel ECM, EWS (Electronic Warfare Suite), Experimental EWS, Proto EWS)
+
== 2.1. Run the installer ==
  
[[Active Probes]] (BAP, cAP, cLight AP, Boosted BAP, Bloodhound AP)
+
$ WINEPREFIX=${BTA_ROOT}/wine64 WINEARCH=win64 wine BTAdvancedLauncher.exe
 +
== 2.2. Click the “Advanced Mode” button. ==
  
[[C3]] (C3 Slave, C3 Master, C3i)
+
'''''Click'''''
  
=== TTS ===
+
== 2.3. Input the Install Target and Checkout Workspace paths ==
[[Apollo]]
 
  
[[Artemis IV]]
+
Click the “Browse” button next to each path and copy/paste the Windows paths you made in step 1.6 into the “Filename” field of the file picker.
  
[[FCS Adv TC]]
+
== 2.4. Run the install ==
  
[[TTS Called Shot]]
+
Click the “Install and Update BTA” button. Pay attention to any popups or instructions.
  
[[TTS MultiTrac]]
+
== 2.5. Choose your Advanced Configuration Options ==
  
[[TTS Ballistic]] (Ballistic, Ballistic+, Ballistic Evasion+, Ballistic Evasion++)
+
Select all the things you want to install. Make sure Fire Option for Linux Users is set to “Old Fire for Linux Users”
  
[[TTS Energy]] (Energy, Energy+, Energy Evasion+, Energy Evasion++)
+
== 2.6. Wait for it. ==
  
[[TTS Indirect]] (Indirect, Indirect+, Indirect++)
+
After installing the mod, the installer will install ModTek. ModTek needs to know where your BattleTech binary lives. The installer cannot find BattleTech.exe and will ask you where to find it. Give it the “BattleTech.exe Binary path” collected earlier. It will not complain when there is not <code>.exe</code> extension on the filename.
  
[[TTS Missile]] (Missile, Missile+, Missile Evasion+, Missile Evasion++)
+
== 2.7. Ensure all the paths and symlinks are correct ==
 +
'''Note:''' This step is optional, depending on your distribution.
  
=== Cockpit Slot ===
+
At this point the installation for Windows is complete. However, you’re not done. Because HBS was kind enough to provide us with a native binary, and because BTA’s installer runs as if it were a Windows program, we have to create some symlinks to make sure BattleTech can see all the mod files.
  
[[DNI Cockpit]]
+
Thankfully some magical creature named “b2cc” has written a script to do this for us. The script is called “pathfinder.sh”. Download and run it.
  
[[Primitive Cockpit]]
+
$ cd ${BT_ROOT}
 +
$ wget https://gist.githubusercontent.com/b2cc/c312bec251aaecbfedd07e4d4bda512e/raw/f7fdaa5bc458372b421a6a207e93c4d9ea257901/pathfinder.sh
 +
$ less pathfinder.sh  # its up to you to make sure script doesn't do anything naughty!
 +
$ bash pathfinder.sh -c
 +
You should see a lot of console spam and green success words.
  
[[Armored Cowl]] (Armored Cowl, Armored Cowl+, Armored Cowl++)
+
If you do not, ask for help.
  
[[Command Console]]
+
= 3. Okay, that’s it. =
  
 +
All done. Run the game. Assuming all went well, you can go stomp around and get your dakka dakka pew pew on.
  
=== Bottom Sensor Slot ===
+
If for whatever reason things are not working, check the Troubleshooting section.
  
[[Comms Suite]] (Comms Suite, Comms Suite+, Comms Suite++, Comms Suite+++) (Occupies bottom sensor slot)
 
  
 +
= Troubleshooting =
  
=== Top Sensor Slot ===
+
== Issue: The game loads but the main menu doesn’t say “BattleTech ADVANCED - 3062” and the ModTek version doesn’t show up under the game version next to the CREDITs button ==
  
[[Rangefinder]] (Rangefinder, Rangefinder+, Rangefinder++, Rangefinder+++) (Occupies bottom sensor slot)
+
Likely cause: ModTek isn’t patched into the game correctly.
  
=== Actuators ===
+
This can happen if mono is incorrectly installed or was not installed before the BTA installer was run the first time.
[[Foot Actuators]]
 
  
[[Leg Actuators]]
+
Solution: (re)run the ModTek Injector. It should look like this if it worked correctly:
  
[[Hip Actuators]]
+
$ cd ${BT_ROOT}/Mods/ModTek
 +
$ WINEPREFIX=${BTA_ROOT}/wine64 WINEARCH=win64 wine ModTekInjector.exe
 +
ModTek Injector
 +
---------------
 +
 +
Assembly-CSharp.dll backed up to Assembly-CSharp.dll.orig
 +
Injecting Assembly-CSharp.dll with ModTek.Injection.LoadModTek at BattleTech.Main.Start
 +
Writing back to Assembly-CSharp.dll...
 +
Injection complete!
 +
== Issue: BattleTech refuses to launch/crashes to desktop immediately ==
  
[[Hand Actuators]]
+
Likely cause: Libc library conflict. The system libc is likely newer than, and incompatible with, the libc included in BattleTech’s native Linux distribution.
  
[[Lower Arm Actuators]]
+
Solution: Remove libc.so.6 from the BattleTech game directory. This forces BattleTech to use the system libc.
  
[[Upper Arm Actuators]]
+
$ mkdir -p "${BTA_ROOT}/../BattleTech_Data/Plugins/x86_64/"
 +
$ mv "${BT_ROOT}/BattleTech_Data/Plugins/x86_64/libc.so.6" "${BTA_ROOT}/../BattleTech_Data/Plugins/x86_64/"
 +
== Issue: Not listed here ==
  
[[Shoulder Actuators]]
+
There are a few Linux users on the [https://discord.com/invite/g5nCYAV BTA Discord channel], you can ask for help in General Chat or open a support ticket with #ticketbot to get help resolving issues with BTA. For general issues with BattleTech on Linux, there are several forums available by searching your favorite search engine.

Revision as of 09:28, 2 April 2021

This guide assumes you are using the native Linux version of BattleTech. If you installed the Windows version, got it running with Proton, and successfully installed BTA, please write up a document similar to this one for your scenario.

1. Prepare

1.1. Set some vars we’ll need later to avoid typos

Double-check these paths with your local installation, they may be different.

$ BTA_ROOT="$HOME/src/BATTLETECH/BTA"

Steam on Debian

$ BT_ROOT="$HOME/.steam/debian-installation/steamapps/common/BATTLETECH"

Steam on other distros

Check your $HOME/.steam directory and modify the above environment variable assignment accordingly.

GOG

$ BT_ROOT="$HOME/GOG Games/BATTLETECH"

1.2. Ensure dependencies are installed

Package* Purpose
wine run the installer
unzip unzip the installer package
jq allow pathfinder.sh to parse JSON

* Package name may differ on your distribution.

Debian & Friends (Ubuntu, Mint, Pop_OS!, PureOS)

$ sudo apt install wine unzip jq

RedHat & Friends (Fedora, SuSe)

$ sudo dnf install wine unzip jq

Arch & Friends (Manjaro, GamerOS)

$ sudo pacman -S wine unzip jq

1.3. Prepare Wine prefix for the BTA installer.

The wine-mono package listed here is for reference only. You can get the most recent version from https://dl.winehq.org/wine/wine-mono/.

$ mkdir -p "${BTA_ROOT}"
$ cd "${BTA_ROOT}"
$ wget https://dl.winehq.org/wine/wine-mono/6.1.0/wine-mono-6.1.0-x86.msi
$ WINEPREFIX="${BTA_ROOT}/wine64" WINEARCH=win64 wine msiexec /i wine-mono-6.1.0-x86.msi

1.4. Download the BTA installer and Extract the .zip into ${BTA_ROOT}

You’ll have to manually download the installer from NexusMods. Save it to your ${BTA_ROOT}. Then unzip it.

$ unzip 'BattleTech Advanced 3062 Installer-452-v8-5-2-1613256258.zip'

1.5. Prepare the Mods directory

If you try to run BTA alongside other mods, problems are likely. If the Mods directory already exists, back it up (optional), and delete it.

Clean up and create the Mods directory:

$ rm -rf "${BT_ROOT}/Mods"
$ mkdir -p "${BT_ROOT}/Mods"

1.6. Collect paths for the BTA installer

The installer needs to know where to install to. It does not know how to browse into Linux “hidden” paths (such as $HOME/.steam). Instead, you must copy and paste paths into the installer’s file/directory chooser after clicking the “Browse” button.

Also, the installer cannot parse Linux paths. You must convert them to Windows paths and include the Windows drive letter Z:, which is where wine mounts the Linux filesystem as if it were a Windows filesystem.

Collect those Windows paths:

Install Target path

Examples:

$ echo "Z:${BT_ROOT}/Mods" | sed -e 's#/#\\#g'
Z:\home\indigo\.steam\debian-installation\steamapps\common\BATTLETECH\Mods

Checkout Workspace path

$ echo "Z:${BTA_ROOT}" | sed -e 's#/#\\#g'
Z:\home\indigo\src\BATTLETECH\BTA

BattleTech.exe Binary path

$ echo "Z:${BT_ROOT}/BattleTech" | sed -e 's#/#\\#g'
Z:\home\indigo\.steam\debian-installation\steamapps\common\BATTLETECH\BattleTech

2. Install BTA

2.1. Run the installer

$ WINEPREFIX=${BTA_ROOT}/wine64 WINEARCH=win64 wine BTAdvancedLauncher.exe

2.2. Click the “Advanced Mode” button.

Click

2.3. Input the Install Target and Checkout Workspace paths

Click the “Browse” button next to each path and copy/paste the Windows paths you made in step 1.6 into the “Filename” field of the file picker.

2.4. Run the install

Click the “Install and Update BTA” button. Pay attention to any popups or instructions.

2.5. Choose your Advanced Configuration Options

Select all the things you want to install. Make sure Fire Option for Linux Users is set to “Old Fire for Linux Users”

2.6. Wait for it.

After installing the mod, the installer will install ModTek. ModTek needs to know where your BattleTech binary lives. The installer cannot find BattleTech.exe and will ask you where to find it. Give it the “BattleTech.exe Binary path” collected earlier. It will not complain when there is not .exe extension on the filename.

2.7. Ensure all the paths and symlinks are correct

Note: This step is optional, depending on your distribution.

At this point the installation for Windows is complete. However, you’re not done. Because HBS was kind enough to provide us with a native binary, and because BTA’s installer runs as if it were a Windows program, we have to create some symlinks to make sure BattleTech can see all the mod files.

Thankfully some magical creature named “b2cc” has written a script to do this for us. The script is called “pathfinder.sh”. Download and run it.

$ cd ${BT_ROOT}
$ wget https://gist.githubusercontent.com/b2cc/c312bec251aaecbfedd07e4d4bda512e/raw/f7fdaa5bc458372b421a6a207e93c4d9ea257901/pathfinder.sh
$ less pathfinder.sh   # its up to you to make sure script doesn't do anything naughty!
$ bash pathfinder.sh -c

You should see a lot of console spam and green success words.

If you do not, ask for help.

3. Okay, that’s it.

All done. Run the game. Assuming all went well, you can go stomp around and get your dakka dakka pew pew on.

If for whatever reason things are not working, check the Troubleshooting section.


Troubleshooting

Issue: The game loads but the main menu doesn’t say “BattleTech ADVANCED - 3062” and the ModTek version doesn’t show up under the game version next to the CREDITs button

Likely cause: ModTek isn’t patched into the game correctly.

This can happen if mono is incorrectly installed or was not installed before the BTA installer was run the first time.

Solution: (re)run the ModTek Injector. It should look like this if it worked correctly:

$ cd ${BT_ROOT}/Mods/ModTek
$ WINEPREFIX=${BTA_ROOT}/wine64 WINEARCH=win64 wine ModTekInjector.exe 
ModTek Injector
---------------

Assembly-CSharp.dll backed up to Assembly-CSharp.dll.orig
Injecting Assembly-CSharp.dll with ModTek.Injection.LoadModTek at BattleTech.Main.Start
Writing back to Assembly-CSharp.dll...
Injection complete!

Issue: BattleTech refuses to launch/crashes to desktop immediately

Likely cause: Libc library conflict. The system libc is likely newer than, and incompatible with, the libc included in BattleTech’s native Linux distribution.

Solution: Remove libc.so.6 from the BattleTech game directory. This forces BattleTech to use the system libc.

$ mkdir -p "${BTA_ROOT}/../BattleTech_Data/Plugins/x86_64/"
$ mv "${BT_ROOT}/BattleTech_Data/Plugins/x86_64/libc.so.6" "${BTA_ROOT}/../BattleTech_Data/Plugins/x86_64/"

Issue: Not listed here

There are a few Linux users on the BTA Discord channel, you can ask for help in General Chat or open a support ticket with #ticketbot to get help resolving issues with BTA. For general issues with BattleTech on Linux, there are several forums available by searching your favorite search engine.