Giter Site home page Giter Site logo

alexgopen / twolifexcompile Goto Github PK

View Code? Open in Web Editor NEW

This project forked from defalt36/twolifexcompile

0.0 0.0 0.0 2.98 MB

Files to assist with compilation of Two Hours One Life for Windows using an integrated Linux distribution. May also be used to compile other OneLife based games.

License: The Unlicense

Shell 92.41% Batchfile 7.59%

twolifexcompile's Introduction

Friendly Advice

What is This?

This project was adapted from the original OneLifeXcompile as an attempt to provide the tool for anyone to build, modify and even contribute to the game Two Hours One Life.

Before You Start

Windows Subsystem for Linux (WSL) was the main tool used for testing of the scripts in this repository. Other tools such as Virtual box may be able to make use of the scripts here, but have in mind it might not work. WSL 2 was not tested.

You can see a guide on how to activate WSL on Windows 10 here:
WSL Installation Guide for Windows 10

If your in a hurry enter the folder exclude-dir in this repository and then run the batch file 'activateWSLthenRestart.bat' as an administrator. Be warned it will restart your machine.
After you computer reboots install Ubuntu 20.04 LTS from the Microsoft store. Open it and define a user and password.

Do I have to read all of the following? This stuff is boring, why can't I just build the game?

I got you, fam. Run this from wsl:
wget https://raw.githubusercontent.com/Defalt36/TwoLifeXcompile/master/doEverything.sh;chmod +x doEverything.sh;sudo ./doEverything.sh

Preparing Your Work Directory

After you set up WSL on your machine open the CMD and type 'wsl' and you should see the terminal of your linux distribution. Alternatively you can run 'openTerminalHere.bat' from the repository files.

If you don't already have a work directory create a folder and name it 'workdir', then move the 'TwoLifeXcompile' repository to it or proceed to get instructions on how to acquire it.

To download the repository directly to your workdir first open WSL from CMD. Then use the command 'cd' to navigate to the folder you want to place your files. In my case I use 'cd /mnt/c/Users/defalt/Desktop/workdir' as that is where my workdir is located. '/mnt/c' is the corresponding path of C: on WSL.

Now run 'sudo apt-get install git', wait for it to complete and then run 'git clone https://github.com/Defalt36/TwoLifeXcompile.git'. After the command completes, check to see if 'TwoLifeXcompile' was cloned into the right folder.

For convenience you can type:
ln -s "The path to your work directory" ~/workdir

This create a shortcut that will let you find you work directory easily using:
cd ~/workdir

Preparing Your Enviroment

The following scripts will install the required components to build the game in your linux distribution. You just have to run then once as long as you don't uninstall or use another distribution.

Make sure you have the correct folder opened in the terminal. Check the end of the line to see if you are in the TwoLifeXcompile folder. For me it is:
defalt@DEFALT-PC:/mnt/c/Users/defalt/Desktop/workdir/TwoLifeXcompile

Run:
./getBasics.sh

Run this if you want to be able to build the editor:
./installMissingLibraries.sh

Preparing The Game Files

First you will have to clone the game files. The command ./replaceClonedFolders.sh should do this for you, but have in mind it will delete the game repositories you previously cloned (if any).
Note that command will clone the minorGems, OneLife and OneLifeData7 repositories from the TwoHoursOneLife github account. To clone from other sources you can use: ./cloneAlternative.sh.

After successfully cloning the game repositories to your work directory run:
./applyLocalRequirements.sh

Building The Game

Before you start, if you already tried to compile anything run this command to remove the files generated from previously builds.
./perform.sh --cleanall

Now you are ready for compiling the game. You have currently four basic options on how to do this using the repository scripts.

  1. ./fastBuildGame.sh
  2. ./buildTestSystem.sh
  3. ./createFullBuild.sh
  4. ./perform.sh -b g

'fastBuildGame.sh' will compile the game and then move the game to the folder windows_builds in your work directory. It is faster because it does not convert the unix-style line endings to windows-style, an optional step.

'buildTestSystem.sh' is very similar to pullAndBuildTestSystem.sh from the OneLife scripts; In fact, it is derived from it. It will clone the game repositories if they are missing and compile the game, editor and server for you, modifing some files so it will be ready to be used for testing. Be warned you will be editing the repositories files when you use the editor. You may want to make a backup of the OneLifeData7 repository.

'createFullBuild.sh' will compile the game, server and editor and move all their files to a single folder in order to make a full build. If you are using this, remember to run the 'initiateServer.bat' file before running the server. 'resetServer.bat' is included to delete the server files if you are unable to run it due to a crash.

'perform.sh' is a multi utility script. It can build and run the game, server and editor depending on the flags you use. This is useful for testing.

Building From Another Source

You can run './cloneAlternative.sh' to clone the game repositories under any name or user. This is useful for cloning your own repositories. You can also clone the original game repositories with it if you input 'jasonrohrer' as the user you want to clone from.
The compile script recomended when building from other sources is 'buildTestSystem.sh'.

Ok, But What Does All This Stuff Actually Do?

Most forked scripts keep the same function as the original ones, and others were renamed. You can read about what they do in this tutorial from the creator of the original project, Joriom: https://onehouronelife.com/forums/viewtopic.php?id=1438

exclude-list.txt
When you run ./applyLocalRequirements.sh some files from TwoLifeXcompile will be copied to the game folders with the sole exception being the files listed here. The folder exclude-dir and some files you may use are included for your convenience.

cloneAlternative.sh
Used for cloning from other repositories, branches or users.

installMissingLibraries.sh
You may have a lot of libraries in your system, but you need to have them installed to your compiler for it to work. This script install the ones you need.

deleteAllServerFiles.sh
Did you forget to press control-c when exiting the server or you just want a fresh map? This script will send all your server files to oblivion, solving the problem.

cleanServerMap.sh
Less destructive version of the above.

buildLatestTHOL.sh
Will automatically build the lastest version of Two Hours One Life for you.

buildLatestOHOL.sh
Will automatically build the lastest version of One Hour One Life for you.

perform.sh
read next section.

buildTestSystem.sh
This will clone missing repositories if any and build a test system for experimenting with the game.

createFullBuild.sh
Build the game, editor and server and puts them in a single folder.

doEverything.sh
Will install, download and run everything you need, then it will build the game, editor and server. This should be run at your workdir.

Fast building

The 'perform.sh' script can be used to clean, build and open the applications quickly.
Its '-c' option will clean only the files specified in the 'toClean' variable inside the script.
The usage is ./perform.sh (FLAGS) (PARAMETERS).
Flags: '-b' Build; '-r' Run; '-c' Clean; '-cleanall' Clean all build files.
Parameters: 'g' Game; 'e' Editor; 's' Server.

Example: ./perform.sh -cbr gs This will clean the files specified, build the game and server and then run both.

Known Issues

  1. SDL won't install if it is in a folder with blank spaces in the path.

twolifexcompile's People

Contributors

defalt36 avatar joriom avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.