Empyrion - Galactic Survival

Empyrion - Galactic Survival

Not enough ratings
Storm's Quality of Life Configuration - NotePad++ script
By Kishmond
A NotePad++ Python script that automates changes to configuration files so you don't have to do it manually every time there's an update.
   
Award
Favorite
Favorited
Unfavorite
Introduction
I like some of the changes outlined in Storm's Quality of Life configuration guide, but found it a pain to have to make these changes every time the game updates. So I used NotePad++ and a Python scripting plugin to automate these changes. After every update I can just run these scripts again and it makes the same changes.

This is compatible with version 1.3, 1.4, and 1.5. Unless there are major changes to how these config files work it will probably continue to work in the future.
Setting up NotePad++ and the PythonScript plugin
  1. Download and install the free software NotePad++ here[notepad-plus-plus.org]
  2. Once NotePad++ is open, click 'Plugins' in the menu bar, then select 'Plugins Admin...'
  3. In the 'Available' tab, search for PythonScript. Check the box and click 'Install'
Running the scripts
Make a copy of BlocksConfig.ecf and ItemsConfig.ecf before beginning.
  1. The two scripts are in the sections below. Copy the text of the first one - "Blocks Script". Make sure you copy them carefully because Python is very picky about how many spaces you use in it.
  2. In NotePad++, click Plugins > Python Scripts > New Script. Name it after the title of the script and put it in the default folder location that pops up. Click 'Save'.
  3. Copy the text into the new file, make any custom changes you want (see "Customization" section), then save it.
  4. Repeat steps 1 through 3 for the second script - "Items Script"
  5. Go to your Empyrion Configuration folder at \Steam\steamapps\common\Empyrion - Galactic Survival\Content\Configuration
  6. Open "BlocksConfig.ecf" in NotePad++
  7. Click Plugins > Python Script > Scripts > [whatever you named the block script]
  8. The editor will jump around a bit if it worked. Save the file.
  9. Open "ItemsConfig.ecf" in NotePad++
  10. Click Plugins > Python Script > Scripts > [whatever you named your items script]
  11. Jumping around. Save changes.

Now every time the game updates and these files reset, you can repeat steps 5 - 11 to make the same changes again.
Blocks Script
####### Run this script in BlocksConfig.ecf ####### import math # Change this to change the division factor of power draw # For example, 10 means stuff will cost 1/10th energy divideFactor = 20 # How many times stronger to make the shields multiplyFactor = 2 # Change this to True to only change the idle power requirements # If this is True teleporters won't get changed since they don't have an idle draw idleOnly = False # Reduce power draw of shield blocks changeShields = True # Reduce power draw of teleporter blocks changeTele = True # Allow deconstructors to be placed on CV capitalDecon = True # Make shields stronger strongShields = True def divide_replace(m): return str(math.trunc(int(m.group(0)) / divideFactor)) def multiply_replace(m): return str(math.trunc(int(m.group(0)) * multiplyFactor)) def go_to_pos(m): editor.gotoPos(m.span(0)[0]) def search_replace_func(blockId, attribute, isMulti = False): editor.search('Block Id: ' + blockId + ',', go_to_pos) editor.search(attribute, go_to_pos, 0, editor.getCurrentPos(), 9999999, 1) if isMulti: editor.rereplace('\d+', multiply_replace, 0, editor.getCurrentPos(), 9999999, 1) else: editor.rereplace('\d+', divide_replace, 0, editor.getCurrentPos(), 9999999, 1) if changeShields: # HV Shield search_replace_func('1888', 'EnergyInIdle') # SV Shield search_replace_func('1810', 'EnergyInIdle') # CV Shield I search_replace_func('1809', 'EnergyInIdle') # CV Shield II search_replace_func('1811', 'EnergyInIdle') # BA Shield I search_replace_func('1808', 'EnergyInIdle') # BA Shield II search_replace_func('1812', 'EnergyInIdle') if not(idleOnly): # HV Shield search_replace_func('1888', 'EnergyIn') # SV Shield search_replace_func('1810', 'EnergyIn') # CV Shield I search_replace_func('1809', 'EnergyIn') # CV Shield II search_replace_func('1811', 'EnergyIn') # BA Shield I search_replace_func('1808', 'EnergyIn') # BA Shield II search_replace_func('1812', 'EnergyIn') if changeTele and not(idleOnly): #BA Teleporter search_replace_func('1377', 'EnergyIn') #CV Teleporter search_replace_func('1315', 'EnergyIn') if strongShields: #HV Shield search_replace_func('1888', 'ShieldCapacity', True) #SV Shield search_replace_func('1810', 'ShieldCapacity', True) #CV Shield I search_replace_func('1809', 'ShieldCapacity', True) #CV Shield II search_replace_func('1811', 'ShieldCapacity', True) #BA Shield I search_replace_func('1808', 'ShieldCapacity', True) #BA Shield II search_replace_func('1812', 'ShieldCapacity', True) if capitalDecon: editor.search('Block Id: 1371,', go_to_pos) editor.search('AllowPlacingAt', go_to_pos, 0, editor.getCurrentPos(), 9999999, 1) editor.replace('Base', '"Base,MS"', 0, editor.getCurrentPos(), 9999999, 1) editor.replace('TechTreeNames: "Base"', 'TechTreeNames: "Base,Capital Vessel"', 0, editor.getCurrentPos(), 9999999, 1)
Items Script
####### Run this script in ItemsConfig.ecf ####### # Handheld pulse laser, the pulse laser turret, and the rocket turret can be used on planets useOnPlanets = True # SV and HV Minigun turrets fire minigun rounds minigunTurretRounds = True def search_replace_func(itemId, attribute, searchTerm, replaceTerm): editor.search('Item Id: ' + itemId + ',', go_to_pos) editor.search(attribute, go_to_pos, 0, editor.getCurrentPos(), 9999999, 1) editor.replace(searchTerm, replaceTerm, 0, editor.getCurrentPos(), 9999999, 1) if useOnPlanets: search_replace_func('112', 'Child 0', 'AllowAt: Space', 'AllowAt: "Space,Planet"') search_replace_func('123', 'Child 0', 'AllowAt: Space', 'AllowAt: "Space,Planet"') search_replace_func('126', 'Child 0', 'AllowAt: Space', 'AllowAt: "Space,Planet"') if minigunTurretRounds: search_replace_func('114', 'Damage', '280', '140') search_replace_func('114', 'AmmoType', '15mmBullet', '8.3mmBullet')
Customization
To customize the effects of these scripts, just edit them within NotePad++. What each value does should be explained within the script itself. Just change numbers or use 'True' or 'False' to turn certain features on or off. For example, you can have the script change teleporter energy usage but not shield energy usage. Or shield energy but not shield capacity.
6 Comments
Ender424 7 Jul, 2022 @ 7:29pm 
Thanks!
Kishmond  [author] 4 Aug, 2021 @ 5:58pm 
Yeah, I could add more stuff like regex to account for spaces, but luckily that wasn't necessary for the tweaks I wanted to make.
zaphodikus 4 Aug, 2021 @ 12:38pm 
I have found when "config editing" that sometimes the spacing and so on would be inconsistent, and had to cater for that if i wanted to autoscript things, like changing the default sizes of deposits and so on.
Kishmond  [author] 3 Aug, 2021 @ 9:25pm 
Commas wouldn't work, you'd need different calls to search_replace_func()
For example, if you wanted to change the damage and zoom level of the T2 Assault Rifle, you would add this to the end of the ItemsConfig script:
search_replace_func('36', 'Child 0', 'Damage: 81', 'Damage: 800')
search_replace_func('36', 'Child 1', 'ZoomIn: 15', 'ZoomIn: 10')

I just realized you may be talking about config file editing itself. In that case I can't help you. I don't know config file editing I just scripted the instructions in the other tweak guide.
hydrosmith 3 Aug, 2021 @ 7:48pm 
Question on the script, for 'Child' items, do they need to be on separate lines or can commas be used i.e. 'Child 0,1,2' ?
I am a total noob but I think either way works?
Thanks for putting this out there, I am having a blast with this!!!!!
zaphodikus 1 Aug, 2021 @ 8:33am 
Pretty sure I created a similar kind of thing once, it just never really worked all that smoothly for some reason.