[SCR][TC+AP] Autosave (beta v0.50)

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24965
Joined: Sun, 2. Apr 06, 16:38
x4

[SCR][TC+AP] Autosave (beta v0.50)

Post by X2-Illuminatus » Thu, 5. Jun 14, 23:58

Das deutsche Thema findet sich hier.

Autosave (beta v0.50)

The Autosave script provides an autosave function for your game utilizing the "Autosave on stations" game option. If autosaving is not possible, it will remind you to save.

Image

Index
Information for players: installation, function, compatibility
Download and Changelog

Image


1. The general idea

While saving is extremely easy if you have enough Salvage Insurances, remembering to regularly use them is not – especially if you’re just in the process of building a huge complex, commanding a fleet or simply managing your empire. Unfortunately, the autosave function provided by X3TC and X3AP only works, when you’re docking to a station. This script utilizes this autosave function, but tries to make it a bit more convenient, so that you don’t have to actively do something to get your game saved reguarly. In case this doesn’t work, the script will at least remind you to save the game.

Disclaimer: This script was a just a quick idea I had and I really did not invest a lot of time into it. (Writing this readme took actually more time than writing and testing the script itself). It is far from being a proper autosave solution and should be treated that way.


2. The installation

Download the script archive and extract it to your game directory.

For X3: Terran Conflict, by default this will be either
C:\Program Files\Egosoft\X3 Terran Conflict or
C:\Program Files\Steam\steamapps\common\X3 Terran Conflict

For X3: Albion Prelude, by default this will be
C:\Program Files\Steam\steamapps\common\X3 Terran Conflict\addon

Afterwards all files of the archive - they are listed below - should be placed in their respective folders in the X3TC directory or its "addon"-folder.

Note: Just to be on the safe side you should also make a backup of your savegames before installing the script. The standard directory for the saves is
C:\Users\[USERNAME]\Documents\Egosoft\X3TC\save for X3TC or
C:\Users\[USERNAME]\Documents\Egosoft\X3AP\save for X3AP
(C: is the letter for your OS partition.)


2. The function

The Autosave script runs as soon as you have it installed and start/load your game. There are currently no configuration menus in the game. Only the text file provides a small amount of options, which you can set on your own. The Autosave script thereby provides two basic functions:

Autosaving the game

Autosaving the game is realized using the “Autosaves in stations” option and automatically docking (teleporting) the player to a station, which is created just for this purpose.
If the playership (the ship the player is currently sitting in) is in space, a player-owned (Boron) Player Headquarters will be created far off the sector centre and the player will be docked to said station. This triggers the autosave. After saving, the playership will be undocked and teleported back to its previous position facing its previous target. Also restored are the current ship’s speed and shield strength. The just created station will be destroyed.
If the playership is already docked at a station, it will be undocked and directly docked again, which triggers the autosave by the game.

The game will not be saved, if the playership is currently running an autopilot command. (Turret commands are fine though.)

Please note: The autosave function will only work, if the "Auto save in stations" function is activated in your ingame options under "Gameplay -> Advanced Game settings".


Save reminder

If autosaving isn’t possible, the Autosave script will simply remind you to save the game by sending you a short message and an audio notification (can be activated/deactived).


Configuration options

By editing the text file of the Autosave script you can set a small amount of options:
  • t id="3": 15(time between two autosaves in ingame minutes) - This determines, how often the game will be autosaved. The default value is 15 minutes. If the set value is too big (greater than 1440 minutes = 24 hours) or too small (less or equal 0), the script will use the default value.
    Please note that in-game minutes are meant here!
  • t id="4": 0(pop up message) - This determines, whether the save reminder message should be displayed as a pop message or not. By default this option is deactived (0). To activate this option change the 0 to 1.
  • t id="5": 1(subtitle) - This determines, whether the save reminder message should be displayed as a subtitle or not. By default this option is actived (1). To deactivate this option change the 1 to 0.
  • t id="6": 1(audio notification) - This determines, whether an audio notification should be played, when the save reminder message is displayed. By default this option is actived (1). To deactivate this option change the 1 to 0.
  • t id="7" 1124(audio sample id for audio notification) - If the audio notification option is activated,this determines, which audio sample id will be played. This MSCI article in the egosoft.com forum contains a list of available audio sample ids. Please note that the list was originally created for X2 and that not all ids might be available in X3TC and X3AP.
To change the options, open the language specific text file of the Autosave script for the language you are playing 7332-L0xx.xml (xx is representing the specific language code, 49 = German, 44 = English) with any text or xml editor. (Text writing programs such as Word or wordpad won’t work!) The file can be found in the t folder of your game directory.

For X3: Terran Conflict, by default this will be either
C:\Program Files\Egosoft\X3 Terran Conflict\t, or
C:\Program Files\Steam\steamapps\common\X3 Terran Conflict\t
(C: is the letter for your OS partition.)

For X3: Albion Prelude, by default this will be
C:\Program Files\Steam\steamapps\common\X3 Terran Conflict\addon\t
(C: is the letter for your OS partition.)

Change the option(s) according to your wishes and save the file. (Make sure to not add spaces between the option value and the explanation behind it.) Afterwards start/load your game.


4. (In)compatibilies and Limits

This script is compatible to all X3: Terran Conflict versions equal or greater than 2.5 and to all X3: Albion Prelude versions equal or greater than 1.0. It is also compatible to all scripts and mods as long as they do not use the same text file / page id (7332) and as long as they do not modify the (Boron) Player Headquarters model in a way that it cannot dock ships of all classes anymore.

As mentioned above the autosave is realised using the existing “Autosave in stations”-option provided by the game and docking the player to a station nearby. Despite having only short waiting times in this script, when you’re currently playing the game and monitoring (looking at) the screen, you will notice that something is happening (e.g. a station popping up infront of you), which might be immersion breaking for the one or other.
The script does not know and cannot find out, when you saved the game the last time. This means that you might have just saved the game manually and the script will still autosave or remind you to save 30 seconds later.
It’s not possible to restore / reopen any menus you just opened, when the autosave was executed. This means, if you for example were just writing a message to your logbook or writing a script in the Script Editor and the game is autosaved, the respective windows will be closed and the entered texts won’t be saved. Reactivating SETA is not possible as well.

The script itself is currently limited so that it only autosaves, if no autopilot command is running on the playership. This is because I wasn’t able to properly interrupt the current autopilot script, so that it is restored after saving. I will have to look into this, when I have more time.


5. Known bugs

This script has not been tested thoroughly, which is why I’m releasing it as a beta version. I only made some short tests with a small amount of ships of different classes. But I can think of all kind of problems, which may or may not happen, when using this script. So as mentioned in the installation instructions already, make sure to back up your savegames, before using this script.


6. ToDo list
  • - Remove limitation, so that script also autosaves when autopilot is active (if possible)
    - Check for more cases, when autosaving might not be a good idea
    - Maybe rewrite script and make it an AL-Plugin
    - Maybe add an ingame configuration menu
    - Clean-up work
7. The uninstallation

Open the language specific text file of the Autosave script for the language you are playing 7332-L0xx.xml (xx is representing the specific language code, 49 = German, 44 = English) with any text or xml editor. The file can be found in the t folder of your game directory.

For X3: Terran Conflict, by default this will be either
C:\Program Files\Egosoft\X3 Terran Conflict\t or
C:\Program Files\Steam\steamapps\common\X3 Terran Conflict\t

For X3: Albion Prelude, by default this will be
C:\Program Files\Steam\steamapps\common\X3 Terran Conflict\addon\t

Change the ‘uninstallation variable’ from 0 to 1 and save the file. Afterwards start/load the game.

Now go to the scripts.uninstall folder in your X3TC directory or its addon folder (for X3AP) and double click on the uninstall.X2I.autosave.bat. This will remove all Autosave files from the folders Documents, scripts and t. Afterwards deletethe uninstall.X2I.autosave.bat. If the uninstall.X2I.autosave.bat was the only file in the scripts.uninstall folder, you can delete this folder too.


8. Credits
  • EGOSOFT for the X-Series and the Script Editor
    SS_T for a reliable hosting place on XDownloads

Last edited by X2-Illuminatus on Sun, 29. Nov 15, 18:27, edited 2 times in total.

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24965
Joined: Sun, 2. Apr 06, 16:38
x4

Download, Changelog, List of Files

Post by X2-Illuminatus » Fri, 6. Jun 14, 00:26


9. Download

The Autosave script package can be downloaded from a number of places, which are listed below. If one of the download links doesn’t work, please check one of the others. If none of them work, please make a post here in the topic about it or write me (X2-Illuminatus) a Private message.


XDownloads
[ external image ]

Mediafire.com
[ external image ]


mydrive.ch
(No direct link available)
  • 1. Open http://www.mydrive.ch in your browser
    2. Login using the username Gast@Illuminatus and the password Gast01.
    3. In the folder "Autosave" click on the "Autosave_betav0.50.zip" file.
Please note: The script package contains a detailed Readme file (in the Documents folder), which provides explanations for all functions of the Autosave.


10. Changelog
  • 5th June 2014 - Script release (beta v0.50)
11. Script specific information

List of Files
  • Documents
    • Autosave_LiesMich.pdf
      Autosave_ReadMe.pdf
    scripts
    • !init.X2I.autosave.modified.pck
      plugin.X2I.autosave.save
      plugin.X2I.autosave.start
      setup.X2I.autosave
    scripts.uninstall
    • uninstall.X2I.Autosave.bat
    t
    • 7332-L044.xml (English)
      7332-L049.xml (German)
Used ressourced
Text file / Page id: 7332

Global and local variables
Global variables start with the string globvar.X2I.autosave.
Local variables are not used.

Last edited by X2-Illuminatus on Sun, 29. Nov 15, 18:28, edited 1 time in total.

Szynszyl
Posts: 276
Joined: Fri, 2. Jan 09, 20:23
x4

Post by Szynszyl » Sat, 15. Nov 14, 04:35

This is great mate. I need this so much :P

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”