How To Run GTA2 in Linux

Sections:

Software you will need

You need the following software to complete this tutorial:

  • Wine, a program that lets you run Windows software on other operating systems.
  • winetricks, a time-saving script to download and install various redistributable runtime libraries sometimes needed to run programs in Wine.
  • p7zip, a port of 7-Zip for various operating systems.
  • GTA2 GameHunter, a free (no malware, no bullshit) application for finding and playing with human GTA2 opponents.
  • GTA2, the best multiplayer game ever. The GTA2-GTAMP edition is the newest and best version of GTA2.

Note: As you should know, it is best to install these programs using your distribution's package management software. Ubuntu uses Aptitude, Gentoo uses Portage, Fedora uses Yum, etc.

How to run GTA2 in Linux

Paste and run this code from a console of your choice.

  1. Install p7zip any way you like, for example by using your distro's package manager.
    In Ubuntu, you'd type this in a console:
    										
    sudo apt-get install p7zip
    										
    									
    In Gentoo you'd type:
    										
    sudo emerge p7zip
    										
    									
  2. Install Wine-1.2 or newer.
    Ubuntu:
    										
    sudo apt-get install wine
    										
    									
    Gentoo:
    										
    sudo emerge wine
    										
    									
  3. Download, unpack and install GTA2-GTAMP Edition, GameHunter
    										
    tmpdir=$(mktemp -d /tmp/gta2-XXXX) || exit
    trap 'rm -rvf "$tmpdir"; exit' EXIT
    cd ${tmpdir} || exit
    wget --trust-server-names http://www.seeitmyway.org/gta2/downloads/GTA2-GTAMP-Edition-v2.exe http://gtamp.com/GTA2/gh
    mkdir -pv ~/.wine/drive_c/games
    echo -e "\nUnpacking GTA2"
    cd ~/.wine/drive_c/games/ || exit
    7z x "${tmpdir}"/GTA2-GTAMP-Edition-v2.exe || exit
    cd ${tmpdir} || exit
    echo -e "\nInstalling GameHunter"
    wine gta2gh1???setup.exe \/S \/D=C:\\games\\GTA2\\gh\\ || exit
    echo -e "\nAdding GTA2 Manager keys to registry"
    wine regedit ~/.wine/drive_c/games/GTA2/gta2_install.reg
    echo -e "\nGTA2 and GameHunter have been installed.\n\nGetting winetricks and installing Visual Basic 6 RuntimeSP6 and DirectPlay"
    wget http://www.kegel.com/wine/winetricks
    sh winetricks vb6run directplay
    echo -e "\nEverything done, installation complete."
    cd ~
    
    										
    									
  4. Run GameHunter, open Tools > Settings and enter a GTA2 name (a name you want to use in GTA2), an IRC name (a name you want to use in GameHunter), GTA2 folder ( c:\games\GTA2\ ), tick "connect on startup", "sign in automatically", "highlight own words", "timestamp messages" and "mute alert sounds while GTA2 is open" and choose a sound to play to notify you when players join your game and when your nick is written in the chat. Notice the password field - you do not need to fill this in unless you have registered your nickname. If you are a frequent GameHunter user, it is recommended that you do this. See this GTAMP forum post for more information.
  5. When you're in GameHunter press F8 to run GTA2 Manager to set GTA2 up. Remember to set "Display mode" to "Window", othewise your desktop resolution will get switched to 640x480 while playing GTA2. Setting the GTA2 resolution to 960 x 720 makes for nice screencasts if you plan on recording your games (720p). Don't turn anything on in the Debug tab other than what is in my screenshot. Don't change anything in the Physics tab, otherwise you won't be able to play online.
  6. That's it! As far as Linux is concerned, you are now ready to play.

    Unfortunately GTA2 is an old game and although you got everything running correctly so far, you might not be able to enjoy multiplayer games just yet. If you try joining other players and the "Network GTA2" window pops up but the "join" button is disabled, then either you or the person you are trying to join need to forward your ports. Read http://gtamp.com/gta2/network-help/ very carefully. Forwarding ports only takes one minute once you've done it before, but you will need to pay attention and read carefully if this is your first time. You only ever need to do this once, unless you change routers or your network setup somehow changes.

  7. addendum 1: Using winetricks in step 3 is a great way of saving you some work, but it can be done manually if, for some unholy reason, you feel you need to. You don't need to (and shouldn't) do this if you did step 3.
    1. Download and copy directplay files to windows/system32 so that you can use TCP/IP:
      												
      tmpdir=$(mktemp -d /tmp/directplay-XXXX) || exit
      trap 'rm -rvf "$tmpdir"; exit' EXIT
      cd ${tmpdir}
      wget http://www.thehandofagony.com/alex/dll/dplaydlls-win98se.tar.bz2
      tar -xjf dplaydlls-win98se.tar.bz2 || exit
      mv -vt ~/.wine/drive_c/windows/system32/ *.exe *.dll
      rm -rvf "${tmpdir}"
      												
      											
    2. Register the directplay files using windows regsvr32:
      												
      wine regsvr32 dplayx.dll
      wine regsvr32 dpnet.dll
      wine regsvr32 dpnhpast.dll
      												
      											
    3. Add DLL overrides (native,builtin) for dplayx, dpnet, dpnhpast and dpwsockx in "winecfg".
      												
      $ winecfg
      												
      											

Awesome design by DrSlony
www.gta2.seeitmyway.org