Baldur's Gate 3

How to Create Auto-Save Script for Baldur’s Gate 3

Did you just lose a few hours of progress because your game crashed after doing some trading, respeccing, or looting? In this guide, we use AutoHotKey to create a script that will autosave your game every so often … because only saving when walking into new areas is not a proper autosave, Larian.

Overview

This guide explains how to create an autosave script for Baldur’s Gate 3 using AutoHotKey that will autosave the game every 1, 5, 10, etc. minutes of game time.

Doesn’t BG3 already have an autosave feature?
Sort of. The autosave in BG3 will only save when entering specific areas of the game. For example, entering the area of most boss fights or points of interest. Where this fails is when you spend a lot of time in an area you already discovered, such as the grove or goblin camp. You can potentially lose hours of progress if you don’t religiously save the game yourself.

Didn’t DOS2 have a proper autosave feature?
Yep! In DOS2, you can configure your game to save after a certain number of minutes. Why is this nonexistent in BG3? Not sure. I hope Larian adds this feature though and makes this guide obsolete. Fingers crossed.

Are there any known issues with this autosave script?

  • If you use a controller for PC BG3, this autosave script will switch your UI from console to desktop until you provide input on your controller again. It will look a bit janky and jarring.
  • This script assumes your autosave key is F5 (default) – If you changed this keybind, keep that in mind when copying the script.
  • In very rare circumstances, saving the game will crash the game soon after. Since you just saved, all you need to do is reload the game and pickup where you left off, but saving the game in BG3 can be fairly unstable sometimes.
  • Please – if anyone else finds issues or wants to provide improvements to the script, post them in the comments!

Instructions to Create your Own Script

1. Download AutoHotKey v2.0 here.

2. Run the AutoHotKey Dash application and select ‘New Script’

3. Name your script whatever you want, save it wherever you want (documents or desktop is probably preferable), select ‘Empty Slate’, and then select ‘Edit’.

4. This will either open up notepad automatically, or ask you if you want to use another editor (like notepad++, vscode, etc). Anything will work here.

5. Take note of two things before you proceed:

  • What your save keybind is in BG3. It is F5 by default, but if you modified this, refer to this page to find the name of the keybind – https://www.autohotkey.com/docs/v1/KeyList.htm
  • How frequent you want your autosave to occur in milliseconds.

Use WolframAlpha to convert this easiest – https://www.wolframalpha.com/input?i=5+minutes+to+milliseconds

6. Copy and paste the following into this file, make your modifications if any, and save the file:

#Requires AutoHotkey v2.0
#Warn All, Off

SetTitleMatchMode 2 ;

global windowExists := 0 ;

Loop {
	if WinExist("ahk_exe bg3_dx11.exe") || WinExist("ahk_exe bg3.exe"){
		windowExists := 1 ;
	} else {
		windowExists := 0 ;
	}

	if windowExists {
		WinActivate ;
		Send "{F5}" ;
	} else {
		return ;
	}
	
	Sleep 300000 ;
}

If you changed your save keybind, modify the line

Send "{F5}" ;

making sure to not remove the quotations or curly braces.

If you want a different save interval, modify

Sleep 300000 ;

making sure not to include any commas or postfixes.

7. Go back to AutoHotKey Dash and select the “Compile” Option.

8. Enter the source file path (the .ahk file), enter the executable file path you want this to compile to, and then select “convert to executable”.

9. If your script successfully compiled, you should see this dialog box

10. Launch BG3, load up a save game, then navigate to where you saved your executable and double click it.

11. If everything is good, you should see the AutoHotKey script in task manager and/or your system tray:

12. Congratulations! You have a okayish workaround until Larian adds a proper autosave feature to BG3!

This guide about Baldur's Gate 3 was written by Bucko0o0o. You can visit the original publication from this link. If you have any concerns about this guide, please don't hesitate to reach us here.

About the author