Starfield

Starfield

Not enough ratings
How to use batch files for easier life
By Lich Enjoyer
Starfield lets you save a ton of time by running predefined scripts saved in batch files with a single console command, instead of having to type out a bunch of commands every time you want to do something useful.
2
   
Award
Favorite
Favorited
Unfavorite
What are console scripts?
Console scripts are sets of console commands that you can save in a `.txt` or `.bat` file and then run in the game with a single `bat` (don't mistake with a file extension `.bat`) command. This is useful when you want to do something that requires you to type a lot of console commands, like adding all perks to your character, or giving yourself every ammunition type in the game.
Running your first script
- Open a folder where your game executable is located. If you bought the game on Steam, then the folder is likely located at `C:\Program Files (x86)\Steam\steamapps\common\Starfield`. In my case, I have it installed on `D:\`, so it's in `D:\SteamLibrary\steamapps\common\Starfield`.
- Create a `.txt` file in that folder and name it `test.txt`.
- Open the file in a text editor, and paste the following code into it:


Player.AddItem F 10000

This script will add 10,000 credits to your inventory. Now, save the file and close it.

After saving and closing the file:


Launch the game and open the in-game console. Enter:

bat test


This will execute the script you just created. The argument given to the `bat` command refers to the batch file's path relative to the game's executable.

Upon checking your inventory, you should now have 10,000 more credits.


Unlike with `.bat` files, you don't need to specify the extension of `.txt` files when running them. So if you named your file `test.txt`, you can run it with `bat test` instead of `bat "test.txt"`. For this reason, I recommend using `.txt` files instead of `.bat` files for scripting.
Organizing things
The game's directory is already cluttered with files, so by adding a bunch of batch files to it, you'll only make it worse. To avoid this, I recommend creating a new folder inside the game's directory, and then saving all of your scripts there. For example, I store all my scripts in the `Scripts/` folder.

Now, if you put your scripts in a folder, you'll have to specify the path to the script relative to the game's executable when running it. So if you put them in a `Scripts/` folder, you'll have to run them with `bat "Scripts/test"`. Notice that the path is in quotes, because it contains a backslash, which is a special character in the console, so it needs to be escaped. You'll need to do this every time you run a script that's inside of a folder, or when you also want to specify the extension of the file, since `.` is also treated a special character.
Example: add every skill perk to your character
Let's create a script that will add every perk in the game to your character.

Another advantage of loading scripts from batch files: they support comments. Lines following `;`, `#` or `//` are ignored when batch files are loaded, so you can see what each command does.

# Physical Player.AddPerk 002C59DF ; Boxing Player.AddPerk 0028AE14 ; Cellular Regeneration Player.AddPerk 002C555E ; Concealment Player.AddPerk 002CE2A0 ; Decontamination Player.AddPerk 002C59E2 ; Energy Weapon Dissipation Player.AddPerk 0028AE17 ; Environmental Conditioning Player.AddPerk 002CE2DD ; Fitness Player.AddPerk 0028AE29 ; Gymnastics Player.AddPerk 002C5554 ; Martial Arts Player.AddPerk 002C53B4 ; Neurostrikes Player.AddPerk 002CFCAD ; Nutrition Player.AddPerk 002CFCAE ; Pain Tolerance Player.AddPerk 0028AE13 ; Rejuvenation Player.AddPerk 002CFCB2 ; Stealth Player.AddPerk 002C59D9 ; Weight Lifting Player.AddPerk 002CE2E1 ; Wellness # Social Player.AddPerk 002C5A8E ; Commerce Player.AddPerk 002CFCAF ; Deception Player.AddPerk 002C59E1 ; Diplomacy Player.AddPerk 002C5A94 ; Gastronomy Player.AddPerk 002C555D ; Instigation Player.AddPerk 002C59DE ; Intimidation Player.AddPerk 002C53AE ; Isolation Player.AddPerk 002C890D ; Leadership Player.AddPerk 002C5555 ; Manipulation Player.AddPerk 002C555F ; Negotiation Player.AddPerk 0023826F ; Outpost Management Player.AddPerk 0022EC82 ; Persuasion Player.AddPerk 0028B853 ; Scavenging Player.AddPerk 002C53B3 ; Ship Command Player.AddPerk 002C555B ; Theft Player.AddPerk 002C53B0 ; Xenosociology # Combat Player.AddPerk 0027DF94 ; Armor Penetration Player.AddPerk 002CFCAB ; Ballistics Player.AddPerk 0027CBBA ; Crippling Player.AddPerk 002C5556 ; Demolitions Player.AddPerk 002CFCB0 ; Dueling Player.AddPerk 00147E38 ; Heavy Weapons Certification Player.AddPerk 0027DF96 ; Incapacitation Player.AddPerk 002C59DD ; Lasers Player.AddPerk 002C890B ; Marksmanship Player.AddPerk 0027BAFD ; Particle Beams Player.AddPerk 002080FF ; Pistol Certification Player.AddPerk 002C555A ; Rapid Reloading Player.AddPerk 002CE2E0 ; Rifle Certification Player.AddPerk 002C53AF ; Sharpshooting Player.AddPerk 0027DF97 ; Shotgun Certification Player.AddPerk 002C53B1 ; Sniper Certification Player.AddPerk 002C59DA ; Targeting # Science Player.AddPerk 002C2C5A ; Aneutronic Fusion Player.AddPerk 002C5560 ; Astrodynamics Player.AddPerk 0027CBBB ; Astrophysics Player.AddPerk 002C5557 ; Botany Player.AddPerk 002CE2C0 ; Chemistry Player.AddPerk 002CE29F ; Geology Player.AddPerk 002CE2DF ; Medicine Player.AddPerk 002C59E0 ; Outpost Engineering Player.AddPerk 0027CBC2 ; Planetary Habitation Player.AddPerk 002C555C ; Research Methods Player.AddPerk 002CFCB1 ; Scanning Player.AddPerk 0027CBC3 ; Spacesuit Design Player.AddPerk 0004CE2D ; Special Projects Player.AddPerk 0027CBC1 ; Surveying Player.AddPerk 002C890C ; Weapon Engineering Player.AddPerk 002C5552 ; Zoology # Tech Player.AddPerk 0027B9ED ; Automated Weapon Systems Player.AddPerk 002CE2C2 ; Ballistic Weapon Systems Player.AddPerk 0008C3EE ; Boost Assault Training Player.AddPerk 00146C2C ; Boost Pack Training Player.AddPerk 002C53B2 ; EM Weapon Systems Player.AddPerk 002C59DB ; Energy Weapon Systems Player.AddPerk 002CE2DE ; Engine Systems Player.AddPerk 002C5558 ; Missile Weapon Systems Player.AddPerk 002C2C5B ; Particle Beam Weapon Systems Player.AddPerk 00143B6B ; Payloads Player.AddPerk 002CFCAC ; Piloting Player.AddPerk 002C5553 ; Robotics Player.AddPerk 002CE2E2 ; Security Player.AddPerk 002C2C59 ; Shield Systems Player.AddPerk 002C59DC ; Starship Design Player.AddPerk 002AC953 ; Starship Engineering Player.AddPerk 002C5559 ; Targeting Control Systems

I also have other useful scripts, such as adding 1,000 of each ammunition type to your inventory, adding every resource in the game, paying off all bounties, etc. However, they are too big to show them all here, so I've published them on Starfield Items[www.starfielditems.com].

Now, save it to `Scripts/LearnAllPerks.txt`:

If everything works as expected, this empty perk tree should become fully unlocked.


Now run the script we just created:

bat "Scripts/LearnAllPerks"


In the case of adding perks, you will have to call this script multiple times until every perk is at the desired rank.


Done. Every skill perk is now unlocked and fully upgraded.
Conclusion
Thanks for reading. Have fun.
4 Comments
dragonsphotoworks Dec 28, 2023 @ 6:14am 
Oh weird I thought this was a online mmo type game lol So didnt expect to see this available. Guess I misread store page :-) So I can adjust variables once I finish game for 2nd run. That is good to know.
diMaggio Sep 20, 2023 @ 11:55am 
@Seks_Advocate_2003 No I used the batch file, and for me only the ; comments work. For the other lines that are commented with # or // it will try to evaluate the command throw an error message.

I'm loading a batch file automatically via the .ini file and when I open the console after game startup I can see that only the line beginning with ; gets ignored, the others get an error because the game tries to evaluate them.

Hmm, not sure why it's different for me, but apparently there seem to be some inconsistencies in how comments behave. I'll do some more testing to see what the outcome of different scenarios is (i.e. lines beginning with comment, lines including comment further in, batch called manually, batch called automatically, nested batch call, etc.).
Lich Enjoyer  [author] Sep 20, 2023 @ 5:37am 
@diMaggio, I just loaded a batch file that has all three of them, and it worked just fine. Have you tried commenting directly in the console? Comments only work within batch files.
diMaggio Sep 19, 2023 @ 1:58pm 
Only ; works for comments.
When you use // or #, then the console will still try to execute the line as a command and probably just fail with an error message.