Hi,
I made (a maybe little quick and a bit dirty) php script, that does following:
A) It installs mods (must be downloaded manually, e.g. from here to the folder "2install"), to the game's mod-folder
B) Those installed/extracted archives are being kept in a folder named "installed"
C) It copies the current mods from the Steam's workshop folder (and keeps them in the game's mod-folder up to date)
D) It does a back up of every overwritten mod (folder "backup")
E) It keeps old settings.lua, config/config.lua and mod.lua.bak (I keep copies of slightly adapted modified mod.lua at this mname.)
I thought maybe someone could also make use of it.
I made this because there's currently no TPFMM for TPF, yet, and as I use many mods I don't want to do all updating and keeping track of them manually. And also to have backups in case, that mods disappear (already happened with ~3-5 steam mods) and fatally changed ones.
I also did a script to eliminate duplicate mods, but this is not representable yet (that ones really quick and dirty).
next step I wanted to solve in a better way is point E) and the possibility to add files/folders to the list.
as topic states, it's (currently) linux only, php(-cli) needs to be installed. Doing a windows version should be easily possible (is there a "where"-like command?).
Hi,
Ich habe ein (vielleicht etwas schnell und ein bisschen schmutziges) PHP-Skript erstellt, mit folgenden Funktionen:
A) Installiert Mods (muss manuell heruntergeladen werden, z. B. von hier - in den Ordner "2install") in den Mod-Ordner des Spiels
B) Diese installierten / extrahierten Archive werden in einem Ordner mit dem Namen "installed" gespeichert.
B) Es kopiert die aktuellen Mods aus dem Workshop-Ordner von Steam (und hält sie im Mod-Ordner des Spiels auf dem neuesten Stand).
C) Es macht ein Backup von jedem überschriebenen Mod (Ordner "backup")
D) Es behält alte settings.lua, config/config.lua und mod.lua.bak bei (ich behalte Kopien von leicht angepassten mod.lua unter diesem Namen).
Ich dachte, vielleicht könnte auch jemand anderes davon Gebrauch machen.
Ich habe dies gemacht, weil es derzeit noch kein TPFMM für TPF gibt und da ich viele Mods verwende, möchte ich nicht alle Updates durchführen und sie manuell nachverfolgen. Und auch um Backups für den Fall zu haben, dass Mods verschwinden (schon passiert mit ~ 3-5 Steam Mods) und tödlich veränderte.
Ich habe auch ein Skript erstellt, um doppelte Mods zu entfernen, aber das ist noch nicht darstellbar (diese sind wirklich schnell und schmutzig).
Der nächste Schritt, den ich besser lösen wollte, ist Punkt D) und die Möglichkeit, Dateien / Ordner zur Liste hinzuzufügen.
wie das Thementitel sagt, ist es (derzeit) nur linux, php (-cli) muss installiert sein. Das Ausführen einer Windows-Version sollte problemlos möglich sein (gibt es einen "where" -ähnlichen Befehl?).
Installation
1) create a directory where you want to keep the script.
mkdir ~/tpfmodinstaller
2) create the needed subdirectories
cd ~/tpfmodinstaller && mkdir installed installing backup 2install
3) place the script into the folder (name it e.g. "installmods")
e.g. use an editor and paste the script below.
4) make it executable:
chmod +x installmods
4) check/modify paths in the first 8 lines of the script
(path to php executable, path to TPF2, path to steam workshop folder)
(alternatively you can pass the latter two paths as parameters to the script)
alternative to 1-3:
-extraction of the tarball (e.g. into home directory)
cd ~ && tar -xf modinstaller.tar
respectively
cd ~ && tar -xjf modinstaller.tar.bz2
1) Erstellen eines Verzeichnis, in dem das Skript aufbewahrt werden soll.
mkdir ~/tpfmodinstaller
2) Erstellen Sie die benötigten Unterverzeichnisse
cd ~/tpfmodinstaller && mkdir installed backup 2install installing
3) lege das Skript in den Ordner (nenne es zum Beispiel "installmods")
z.B. Verwenden Sie einen Editor und fügen Sie das folgende Skript ein.
4) mache es ausführbar:
chmod +x installmods
4) überprüfe / ändere die Pfade in den ersten 8 Zeilen des Skripts
(Pfad zur ausführbaren PHP-Datei, Pfad zu TPF2, Pfad zum Steam Workshop-Ordner)
(Alternativ können Sie die letzten beiden Pfade als Parameter an das Skript übergeben.)
alternativ zu 1-3:
-extraktion des tarballs (z.B. im home-Verzeichnis)
cd ~ && tar -xf modinstaller.tar
bzw.
cd ~ && tar -xjf modinstaller.tar.bz2
Usage/Nutzung:
-put mods you want to install into the "2install" folder
-just call the script (from any point, working directory used will always be the path where the script is placed)
~/tpfmodinstaller/installmods
-of course, the user must have rights to read and modify files and folders at those locations
some output is written to STDOUT, errors to STDERR
it will return 0 if everything went fine and 1 on error
-Mods, die du installieren willst, in den "2install" Ordner kopieren
-Nur das Skript aufrufen (von jedem Punkt aus - es wird als Arbeitsverzeichnis immer der Pfad verwendet, in dem sich das Skript befindet)
~/tpfmodinstaller/installmods
-Der verwendete user muss natürlich entsprechende Rechte zum Schreiben und Lesen in den Pfaden haben
Einige Ausgaben werden nach STDOUT geschrieben, Fehler nach STDERR
Es wird 0 zurückgegeben, wenn alles in Ordnung war und 1 bei einem Fehler
example output/Beispielausgabe:
message too long, maybe in a reply
The message is too long, must be under 10,000 characters.
I called it here with my deduplication script afterwards (if there's demand for it, I can create a publishable version):
Ich habe hier mit meinem Deduplikations-Skript anschliessend aufgerufen (wenn es hierfür Nachfrage gibt, kann ich eine veröffentlichungsfähige version kreïeren)
the output is colored / Die Ausgabe ist farbig.
finally, the script "installmods" / Hier nun das Skript "installmods"
message got too long "The message is too long, must be under 10,000 characters." will add a tarball
dependencies / required commands are checked as startup, as well existance of paths.
Abhängigkeiten / benötigte Kommandos (ausser "where") sowie Exisatenz der Pfade wird am Beginn des Aufrufs geprüft
If anyone interested, I can also upload a tarball (with directories, files and rights).
Wenn jemand einen tarball möchte (mit Verzeichnissen, Dateien, Rechte ), kann ich gerne einen erstellen
Edit:
board doesn't accept gzipped or bz2ipped files. so I put the uncompressed tarball into a rar archive - rar and zip don't store usage rights, afaik