How to Enable the console in BGEE/SoD/BG2EE in version 2.0 and later
elminster
Member, Developer Posts: 16,317
Note: Mac OSX Sierra users follow the steps found in this spoiler tag before trying to modify the baldur.lua file.
Before proceeding please note the security issues with this workaround outlined here
https://forums.beamdog.com/discussion/comment/832569/#Comment_832569
1. Open the terminal
2. Paste into it
sudo spctl --master-disable
3. Put in your password
4. Go to "System Preferences -> Security and Privacy
5. Click the lock at the bottom left and type in your password
6. Make sure "anywhere" is enabled
6. Launch whatever game this involves (BGEE, BG2EE, IWDEE)
7. Close the game
8. Open the terminal again
9. Paste into it
sudo spctl --master-enable
10. Go to "System Preferences -> Security and Privacy
11. (If necessary) Click the lock at the bottom left and type in your password
12. Make sure "Mac App Store and Identified Developers" is selected
Note: Make sure "Mac App Store and Identified Developers" is selected after you go through these steps.
You may now continue using the steps outlined below.
(The following steps may vary somewhat based on what system you are running)
You can find more information about the console (including how to enable it on version 1.3 and earlier) in the link below.
https://forums.beamdog.com/discussion/29678/about-this-forum-troubleshooting-faq#latest
Before proceeding please note the security issues with this workaround outlined here
https://forums.beamdog.com/discussion/comment/832569/#Comment_832569
1. Open the terminal
2. Paste into it
sudo spctl --master-disable
3. Put in your password
4. Go to "System Preferences -> Security and Privacy
5. Click the lock at the bottom left and type in your password
6. Make sure "anywhere" is enabled
6. Launch whatever game this involves (BGEE, BG2EE, IWDEE)
7. Close the game
8. Open the terminal again
9. Paste into it
sudo spctl --master-enable
10. Go to "System Preferences -> Security and Privacy
11. (If necessary) Click the lock at the bottom left and type in your password
12. Make sure "Mac App Store and Identified Developers" is selected
Note: Make sure "Mac App Store and Identified Developers" is selected after you go through these steps.
You may now continue using the steps outlined below.
(The following steps may vary somewhat based on what system you are running)
- Go into your "My Documents" folder (if you are on a Mac this will be called "Documents")
- In it open the appropriate folder for the game you are playing (for instance "Baldur's Gate Enhanced Edition")
- Find the Baldur.lua file
- Open this file up using a Notebook, Wordpad, TextEdit, ConTEXT, or any other word processor (provided smart quotes are disabled)
- Add this line to the file SetPrivateProfileString('Program Options','Debug Mode','1')
- Save the file (be sure it remains a .Lua file)
- When you are playing the game (and are in the same screen you experience combat in) you should now be able to hit Ctrl+Space and see a black box appear (I've put a yellow box around it in the following image)
- Type in the appropriate code in the box and then hit enter.
Note: As of 2.0 the old code prefix "CLUAConsole:" no longer works. You can instead just use "C:"
An example would be
C:CreateCreature("gibber")
You can find more information about the console (including how to enable it on version 1.3 and earlier) in the link below.
https://forums.beamdog.com/discussion/29678/about-this-forum-troubleshooting-faq#latest
Post edited by elminster on
13
Comments
When I hit Ctrl+Space, nothing happens.....
I think the line you are entering may be the wrong one. In the .ini file (I thought was called baldur.ini but may be different for Mac - both PC and Android use baldur.ini), the console entry used should read:
'Program Options', 'Debug Mode', '1',
If you were looking for the .lua, you might have been using this instead, which wouldn't work :
SetPrivateProfileString('Program Options','Debug Mode','1')
If neither is the case, could you let us know the code you are using?
Good hunting
Gus
There was also a baldur.ini file that was located nestled deep within my Library folder (/Users/____me____/Library/Containers/com.overhaulgames.iwdee-macos/Data/Documents/Icewind Dale - Enhanced Edition/baldur.ini) but the insertion of that corrected code (and the uncorrected code, btw) caused the game to be unlaunchable until removed.
I am continuing to play and enjoy the game as is, but am hoping that this information proves to be helpful in finding a way at some point to provide access to the in-game console for anyone playing the latest release on the Mac.
What version are you running? (if you start the game it should be found either on the main screen or on the load game screen).
If you are using an earlier version then paste this
'Program Options', 'Debug Mode', '1',
right below the "INSERT INTO options ROWS (" line in your baldur.ini file
p.s. - The version is 1.4.0, just to answer that question.
I wanted to enter a cheat code to get more money so that I could buy better equipment, so I read your instructions, did all you said in Preference system and Terminal and found the baldur.lua file, opened it in Text Edit (Smart quotes disabled in the preferences), added the line as you said (the one with Debug Mode under Program Options, saved it. I checked the file by opening it again and there it was (the new line).
So I opened the game and tried to activate the cheat console but nothing (I tried different things and the main one : Ctrl+ SPACE is just pausing the game)... I'm desperate !
Help please !
Game: BGEE 1
Version: 2.3.67.3 from STEAM
In advance, I used the terminal workaround for Sierra.
In Text Edit, added the following, no smart quotes enabled, to baldur.lua in documents folder for game:
SetPrivateProfileString('Program Options','Debug Mode','1')
Filed is saved and still in .lua format
In game, "CTRL" has no effect, e.g.:
"CTRL 8" on character creation does not give all 18s for stats - no effect
"CTRL J" on primary game screen will not jump character to cursor location, only opens journal
"CTRL Space" pauses game, no console menu appears.
I have a mac laptop and a PC desktop. This is a mac-exclusive issue I've faced since 2016, forum posts always address one of the topics I've bolded above. Its not earth-shattering, just irritating. Any ideas?
Just downloaded BG Enhanced on a new computer and am trying to get the console to work to no avail...running Windows 10Pro and have version 2.5 of BG. Don't have a .LUA file but do have a .ini one that I've tried modifying above with no luck...game doesn't crash or anything, but simply can't get the console to open up
Help please! lol
The EEs 2.x and above all use the baldur.lua and there should be no .ini file. You would need to start the game first to generate the file, and it is located in you Documents folder within what ever game you are running. The this case, I assume it is BG1EE.
..\Documents\Baldur's Gate - Enhanced Edition
It is likely that the extension is hidden and if you unhide extensions (options in Explorer), you would get a better view. A common problem is that if you use Windows Notepad to edit the file, it attaches a .txt at the end when save. Unhiding the extensions would allow you to check that (you could also look at the properties).
When editing, this is the linr you need to insert:
SetPrivateProfileString('Program Options','Debug Mode','1')
It can be placed anywhere in the file as the game will rewrite the file on closing. You cannot edit the file when the game is running. If you do, the settings will not be saved.
Hope that helps
Gus
I've ensured that no files are hidden and the ONLY files within the ...\Documents\Bauldur's Gate - Enhanced Edition folder are the following:
1. bpsave
2. save
3. Baldur.ini
I've deleted the .ini file several times and still don't have a .lua file...the game itself seems to be running fine (except for an occasional error message in the game text box associated with the main character's name)...
Any other suggestions would be very helpful!
Julius has pointed to a number of vanilla .lua files so you will need to edit it; if it doesn't work, I can pass mine up.
Gus
To answer questions:
1. The file that Julius linked hasn't helped - still can't get the console to open up
2. The /username file has no special characters or anything like that
3. Running Windows Defender - disabling it doesn't seem to be affecting anything either
If you don't mind Gus, I'll try your .lua file to see if THAT works lol
I would double check by checking the game to make sure you have the right version. If its 2.5 it should appear in the top right corner of the initial game menu. If its an earlier version it might appear in the loading screen.
Attached is my copy of baldur.lua. Just rename it from what it is right now to baldur.lua and place it into your 'documents' BG game folder. Make sure you aren't running the game when you do that.
If in the end it still doesn't work, rename the
..\Documents\Baldur's Gate - Enhanced Edition
to
..\Documents\Baldur's Gate - Enhanced Edition.old
and start the game. This will/should create a new 'clean' folder and a new baldur.lua (and keep safe any saved games you might have). Close the game and edit the new baldur.lua.
As the last resort, there is another method which doesn't require editing the balur.lua but it only works in 2.x (prob only 2.5 and above - not tested in earlier versions). Have a read of the instructions as you either add to your UI.MENU or replace it. This will then add a GUI button in the bottom right hand corner which will give you acceess to the console.
Hopefully one of these will get you there.
Gus
Edit: Added attachment