Power Users

Please help improve this if you can. The Discussion page may contain suggestions.Reason: "*Out of date information and empty sections (Jan 2019)*"

**This article may need cleanup to meet quality standards.**
Please help improve this if you can. The Discussion page may contain suggestions.
Reason: "*Out of date information and empty sections (Jan 2019)*"

If you're looking to tweak your game's client settings, wanting to setup you own private server, or want to mod the game, this is the page you want. The page is split into these 3 categories: Advanced Settings, Private Servers, and Modding.

One Hour One Life is an Open Source game allowing you to change everything down to the underlying code. This means that a Power User can basically change everything about the game if they so choose from tweaking the window size to replacing all the graphics. Every purchase of the game includes a link to the source code which can be redistributed however you like. Essentially by buying the game you buy the right to play on the official servers and support the developer.

## Advanced Settings

Note that all changes to the Advanced Settings is done by using a text editor to change specific files under the settings folder in your game's directory.

* Custom Server: Choose a specific official or private server to always play on.
* Changing the Control Scheme: All settings related to changing the game controls.
* Hard To Quit Mode: A setting that... makes it very hard to quit. Only way is to use application task manager. For use on kiosks (e.g. at conferences).

## Private Servers

*NOTE: Sometimes the server just breaks somehow and you can't connect anymore because the server says "socket read failed" and in your OHOL client it says that the server version is 1 and your client version is the current version of the game. So if anybody knows a fix for this, please add it to this tutorial.*

### How to edit server settings:

1. The server must be closed, in order to edit any server settings to take affect
2. Go to the settings folder in the server folder with the following command: cd ~/yourServerName/OneLife/server/settings
3. Type "ls" to see all the available settings files
4. You can edit each setting by opening a file with a text editor and changing the content of it and then saving the changes
5. Open up the server again

Some very use full settings are the following:

* Setting how many seconds a year has (Basically how long you can life):
	+ Edit the "secondsPerYear.ini" file and set your value there (default: 60)
* Setting your starting age:
	+ Edit the "forceEveAge.ini" file and set your age value there (default: 0, I always set it to 18, so you dont have any effects of a childhood)
* Setting your spawn location:
	1. Edit the "forceEveLocation.ini" file and set the value to 1 (default: 0)
	2. Edit the "forceEveLocationX.ini" file and set the value you want (default: 0)
	3. Edit the "forceEveLocationY.ini" file and set the value to 1 (default: 0)

### How to open up a private server on your local pc via a virtual machine

*Note: You only need to open up the server on either a virtual machine or on the wsl, so dont do both*

1. Install VirtualBox or any other virtual machine software and setup Ubuntu in there (there are plenty tutorials for that, so I am skipping explaining how to do that step. See here)
2. Start up the ubuntu machine
3. In there go to the git repository of ohol (See here) and download the repository as a zip.
4. Extract that zip into your home directory in ubuntu (See here, if you dont know how)
5. Make a new folder in your home folder for your server to reside in, with the following comand: mkdir ~/yourServerName (replace yourServerName with the one you've choosen)
6. Go into the "installYourOwnServer" folder with the following comand: cd ~/OneLife-master/server/installYourOwnServer
7. Copy the serverPullAndBuildLinux.sh into your "yourServerName" folder with this coommand: cp ./serverPullAndBuildLinux.sh ~/yourServerName
8. Then execute the script with this command: bash ~/yourServerName/serverPullAndBuildLinux.sh
9. Edit the "requireClientPassword.ini" and the "requireTicketServerCheck.ini" settings files and set the content of both to 0 (see tutorial section on how to edit server settings)
10. Now you can run the server with this command: ~/yourServerName/OneLife/server/OneLifeServer
11. Connect to your server

### How to open up a private server on your local pc via an already installed WSL

*Note: You only need to open up the server on either a virtual machine or on the wsl, so dont do both. I used here wsl with ubuntu.*

1. On Windows go to the git repository of ohol (See here) and download the repository as a zip.
2. Extract that zip onto your desktop
3. Start up the ubuntu WSL termial
4. Make a new folder in your home folder for your server to reside in, with the following comand: mkdir ~/yourServerName (replace yourServerName with the one you've choosen)
5. Copy the serverPullAndBuildLinux.sh file from your desktop into your "yourServerName" folder in your wsl with this coommand: cp /mnt/c/users/yourName/Desktop/OneLife-master/server/installYourOwnServer/serverPullAndBuildLinux.sh ~/yourServerName
6. Then execute the script with this command: bash ~/yourServerName/serverPullAndBuildLinux.sh
7. Edit the "requireClientPassword.ini" and the "requireTicketServerCheck.ini" settings files and set the content of both to 0 (see tutorial section on how to edit server settings)
8. Now you can run the server with this command: ~/yourServerName/OneLife/server/OneLifeServer
9. Connect to your server

### How to connect to your private server

1. Open up the server
2. Open OHOL
3. Go to settings
4. Click on use custom server
5. Set the port to the shown port in your ubuntu terminal ("Listening for connection on port xxxx")
6. Go back to the main screen and login
7. Play OHOL on your server

### How to quit playing and how to close your server

1. Put down the items, you have on you, as they might despawn if you quit
2. Move a few tiles, to get a message, which displays your current location
3. Search in your ubuntu terminal for the last move message (it should look like this: Player 6's move is done at -77,-5) and write down the last two numbers
4. Quit the game
5. Close the server, by pressing CTR-L Z in the terminal window
6. Edit the x and y (the XY-coordinates you wrote down) location of your eve spawn point to continue where you left of (see tutorial section on how to edit server settings)
7. If you dont want to do this tedious process all the time, then you can add and execute the following bash script: 1. In your ubuntu terminal execute the following command, to create the script: touch ~/yourServerName/OneLife/server/SaveSpawnPoint.sh 2. In your ubuntu terminal execute the following command, to make it executable: chmod a+rwx ~/yourServerName/OneLife/server/SaveSpawnPoint.sh 3. Copy the code below into this file with a text editor:
```
#!/bin/bash
if [[ $# -ne 2 ]]; then
 echo "I need an x value and a y value!"
 exit 1
fi

x=$1
y=$2

sed -i "1s/.\*/1/" ./settings/forceEveLocation.ini

sed -i "1s/.\*/$x/" ./settings/forceEveLocationX.ini
sed -i "1s/.\*/$y/" ./settings/forceEveLocationY.ini

echo "Successfully saved your spawn location!"
exit 0

```
8. Execute the script like this and replace the x and y with yours: ~/yourServerName/OneLive/server/SaveSpawnPoint.sh x y

## Modding

Modding is the act of changing a game away from the official content. It can be anything from changing an image to adding new game mechanics. Due to the open source nature of One Hour One Life there are two ways to modify the game: Asset and Code.

**Asset mods** involve changing graphics or object definitions. Simple graphics changes can be distributed to anyone with an official client and will work. An example is the Nudity Removal Mod included with your purchase of the game. This mod replaces specific graphics with blank versions. Another example would be a graphics overhaul mod that replaces all graphics with more detailed versions.

Changing object definitions is another form of Asset modding. However, these mods will only work on private servers. Object definitions can be changed and created manually with a text editor or using the EditOneLife application included in the game source.

**Code mods** are created when someone makes changes to the application's source code and builds new binaries for each platform (Linux, Windows, Mac OS). These mods can do just about anything allowing for full rewrites of the game's engine if the modder so desires.

The Developer maintains several code repositories for the game that are public for anyone to copy :

* Source Code: https://github.com/jasonrohrer/OneLife
* Game Assets: https://github.com/jasonrohrer/OneLifeData7
* Minor Gems: https://github.com/jasonrohrer/minorGems (Seems to be a special library the developer made to use with all his games)