How make a portable version?
Moderator: OpenTTD Developers
How make a portable version?
Hi!
What keys are necessary to be set at compiling, that all files contain only in game folder? It's needed to copy this folder on a flash drive and play at any computer.
Thank you.
What keys are necessary to be set at compiling, that all files contain only in game folder? It's needed to copy this folder on a flash drive and play at any computer.
Thank you.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: How make a portable version?
No special preparation is necessary. Just copy the openttd folder and you're set. Make sure that your base graphics, base sound and desired newgrfs are in <openttd-folder>/data and your desired ais in <openttd-folder>/aiBelsagor wrote:What keys are necessary to be set at compiling, that all files contain only in game folder? It's needed to copy this folder on a flash drive and play at any computer.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: How make a portable version?
I'm not 100% sure of what you mean, but if you want a running version on a flash drive go to program files and copy the folder called 'OpenTTD'.
Paste it wherever you feel like, it doesn't matter, I presume a flash drive, then on any computer to run it open the folder on you flash drive and run openttd.exe (it will just appear as a file called openttd with the OTTD log, double click on it).
Simple realy, have fun.
Paste it wherever you feel like, it doesn't matter, I presume a flash drive, then on any computer to run it open the folder on you flash drive and run openttd.exe (it will just appear as a file called openttd with the OTTD log, double click on it).
Simple realy, have fun.
Re: How make a portable version?
To simplify what they both just said:
Take your install of OpenTTD. Copy it to your USB Drive, which we'll call U (For USB).
Go to where your openttd.cfg is stored for your local game. Copy that into the same folder as the binary on U
Go into both AI and Data on your local copy, and copy any AIs and/or newGRFs to AI/Data (Whichever you got them from) on U
Done.
OPTIONAL: If you use OpenTTD on more than one OS (EG Windows and Linux, like I do) You may copy the binary for each to the same place on U, as they will not over-write each other. They will both use the same openttd.cfg, and other files on U.
Simples!
Take your install of OpenTTD. Copy it to your USB Drive, which we'll call U (For USB).
Go to where your openttd.cfg is stored for your local game. Copy that into the same folder as the binary on U
Go into both AI and Data on your local copy, and copy any AIs and/or newGRFs to AI/Data (Whichever you got them from) on U
Done.
OPTIONAL: If you use OpenTTD on more than one OS (EG Windows and Linux, like I do) You may copy the binary for each to the same place on U, as they will not over-write each other. They will both use the same openttd.cfg, and other files on U.
Simples!
Re: How make a portable version?
Thank you very much, indeed simply!
But, want to understand, as will make own patchpack.
How to do that at the first run a game did create configuration and work folders only in the own folder? As far as I remember, before it was just like this. Actually question, how to do that a game used the own folder only, and never read or write in other.

But, want to understand, as will make own patchpack.
How to do that at the first run a game did create configuration and work folders only in the own folder? As far as I remember, before it was just like this. Actually question, how to do that a game used the own folder only, and never read or write in other.
Re: How make a portable version?
If the binary finds openttd.cfg in the same folder as it, it'll read from there before it reads anywhere else.
There's an entire section in the readme that comes with OpenTTD that explains the order in which it reads files, I think if you read it, it'll help you understand how and why a portable version works the way it does.
There's an entire section in the readme that comes with OpenTTD that explains the order in which it reads files, I think if you read it, it'll help you understand how and why a portable version works the way it does.
Re: How make a portable version?
How to do portable version from binary I already understood and checked. A question is in other, how immediately make only portable version.
Here in a file cohfig.lib found a variable personal_dir="1", if to set 0, will ok or it not enough? Exist variable with_personal_dir, is it also needed to set in a zero? In a wikki answer did not find.
Here in a file cohfig.lib found a variable personal_dir="1", if to set 0, will ok or it not enough? Exist variable with_personal_dir, is it also needed to set in a zero? In a wikki answer did not find.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: How make a portable version?
As stated before: You don't need to (nor should for this reason) change anything wrt the default compile settings. It all works out of the box. Even the binaries downloaded from OpenTTD site do so. Just copy it from your HD onto your stick and you're done. No special compile, setting or anything else is needed.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: How make a portable version?
But it does put the configurations and savegames in My documents/OpenTTD by default.
I think this is what he wants to chance ... and gl with it cause using My documents is retarded.
Well maybe not since it is impossible to use My documents for documents anyhow since every game and a bunch of apps insist on spamming everything in there so you will never find your work...
I think this is what he wants to chance ... and gl with it cause using My documents is retarded.
Well maybe not since it is impossible to use My documents for documents anyhow since every game and a bunch of apps insist on spamming everything in there so you will never find your work...
Re: How make a portable version?
If you run it from a USB key, that has the openttd.cfg on it, it will save and load to the USB Key. I have tested this myself. Try it yourself, in exactly the same way.
Re: How make a portable version?
Yeah, but you still need to move the config file there after launching the program first time.Gremnon wrote:If you run it from a USB key, that has the openttd.cfg on it, it will save and load to the USB Key. I have tested this myself. Try it yourself, in exactly the same way.
I would think it easier to include the config file in this portable version distribution then to chance the code though, just launch once, move the file and make the copies after.
Unless you for some bizzare reason need to give out source code compile yourself portable versions to many people...
Re: How make a portable version?
I think he is looking for this:
"openttd.exe" -c openttd.cfg
Then game will not make default catalog in "my documents" only run all files from directory it is. Of course data, ai, scrits and gm folders should be where openttd.exe is.
"openttd.exe" -c openttd.cfg
Then game will not make default catalog in "my documents" only run all files from directory it is. Of course data, ai, scrits and gm folders should be where openttd.exe is.
Re: How make a portable version?
Gremnon, thank you. I checked up this method already, he works. About what talked in post № 5.
bigos, not quite.
I simply wanted to build(make,compile) the program, which keeps all information only in one folder.
It's a pity that nobody can help.
Explain. I very dislike that games for storage of data use a folder "My Documents". Yet create the heap of subfolders there. And "My Documents" grow into a dump. I love when on my computer order. All lies on the places. Games on a HD with games. Program on a HD with program. Operating system on own HD. And when the program scatter the files on all disks, me it disorders. Yes, it is perfect me incomprehensible. Seems, times when a computer was rareness, passed a long ago. The personal computer is indeed personal now. And desire of all programs to keep all information in the single folder on a system disk, and main not asking permission for an user, very strange.
Heh, however it already offtop.
bigos, not quite.
I simply wanted to build(make,compile) the program, which keeps all information only in one folder.
It's a pity that nobody can help.

Explain. I very dislike that games for storage of data use a folder "My Documents". Yet create the heap of subfolders there. And "My Documents" grow into a dump. I love when on my computer order. All lies on the places. Games on a HD with games. Program on a HD with program. Operating system on own HD. And when the program scatter the files on all disks, me it disorders. Yes, it is perfect me incomprehensible. Seems, times when a computer was rareness, passed a long ago. The personal computer is indeed personal now. And desire of all programs to keep all information in the single folder on a system disk, and main not asking permission for an user, very strange.
Heh, however it already offtop.
Re: How make a portable version?
On the Russian forum found a man which knows as it to do!
Simply it is needed to set one key during configuration!
Happy!!!

Simply it is needed to set one key during configuration!
Happy!!!



Who is online
Users browsing this forum: No registered users and 6 guests