Last active
September 25, 2021 18:37
-
-
Save cmachler/8252a2cf99179b542b0b5ea8163dd3cd to your computer and use it in GitHub Desktop.
IVAO X-CSL MSFS Electrical Workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### USE AT OWN RISK ##### | |
import glob, os, configparser, shutil | |
##### CHANGE TO PATH WHERE "ivao_x-csl" IS INSTALLED ##### | |
path = "C:\\MSFS_Addons\\vPilot\\ivao_x-csl\\SimObjects\\Airplanes\\" | |
p = configparser.SafeConfigParser() | |
for filename in glob.iglob(path + "/**/systems.cfg", recursive=True): | |
shutil.copy(filename, filename + ".bak") | |
with open(filename, "r") as f: | |
p.readfp(f) | |
print(p.sections()) | |
### ELECTRICAL ### | |
p.remove_section('ELECTRICAL') | |
p.add_section('ELECTRICAL') | |
p.set('ELECTRICAL', 'max_battery_voltage', '24 ; ###') | |
p.set('ELECTRICAL', 'generator_alternator_voltage', '28 ; ###') | |
p.set('ELECTRICAL', 'max_generator_alternator_amps', '60 ; ###') | |
p.set('ELECTRICAL', 'electric_always_available', '1 ; ###') | |
p.set('ELECTRICAL', 'flap_motor', '0, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'gear_motor', '0, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'autopilot', '0, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'avionics_bus', '0, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'avionics', '1, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'pitot_heat', '0, 2, 17 ; ###') | |
p.set('ELECTRICAL', 'additional_system', '0, 2, 17 ; ###') | |
p.set('ELECTRICAL', 'marker_beacon', '1, 2, 17 ; ###') | |
p.set('ELECTRICAL', 'gear_warning', '0, 2, 17 ; ###') | |
p.set('ELECTRICAL', 'fuel_pump', '0, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'starter1', '0, 20, 17 ; ###') | |
p.set('ELECTRICAL', 'light_nav', '0, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'light_beacon', '0, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'light_landing', '0, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'light_taxi', '0, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'light_strobe', '0, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'light_panel', '0, 5, 17 ; ###') | |
p.set('ELECTRICAL', 'light_logo', '0, 5, 17 ;') | |
### LIGHTS ### | |
p.remove_section('LIGHTS') | |
p.add_section('LIGHTS') | |
p.set('LIGHTS', 'lightdef.0', 'Type:3#Index:1#LocalPosition:-17.865253,55.230568,4.452876#LocalRotation:0.000000,0.000000,0.000000#EffectFile:LIGHT_ASOBO_NavigationGreen#PotentiometerIndex:1#EmMesh:LIGHT_NAVIGATION_GREEN') | |
p.set('LIGHTS', 'lightdef.1', 'Type:3#Index:2#LocalPosition:-17.865000,-55.230988,4.453050#LocalRotation:0.000000,0.000000,0.000000#EffectFile:LIGHT_ASOBO_NavigationRed#PotentiometerIndex:1#EmMesh:LIGHT_Navigation_red') | |
p.set('LIGHTS', 'lightdef.2', 'Type:2#Index:1#LocalPosition:-18.460833,-55.504601,4.452950#LocalRotation:0.000000,0.000000,60.000000#EffectFile:LIGHT_ASOBO_StrobeDouble#PotentiometerIndex:1#EmMesh:LIGHT_Strobe_Left') | |
p.set('LIGHTS', 'lightdef.3', 'Type:2#Index:2#LocalPosition:-18.461000,55.505001,4.453000#LocalRotation:0.000000,0.000000,-60.000000#EffectFile:LIGHT_ASOBO_StrobeDouble#PotentiometerIndex:1#EmMesh:LIGHT_Strobe_Right') | |
p.set('LIGHTS', 'lightdef.4', 'Type:1#Index:1#LocalPosition:3.717968,0.000000,9.940319#LocalRotation:0.000000,0.000000,0.000000#EffectFile:LIGHT_ASOBO_BeaconTop#PotentiometerIndex:1#EmMesh:LIGHT_BEACON_TOP') | |
p.set('LIGHTS', 'lightdef.5', 'Type:1#Index:2#LocalPosition:5.997935,0.000000,-4.372193#LocalRotation:0.000000,0.000000,0.000000#EffectFile:LIGHT_ASOBO_BeaconBelly#PotentiometerIndex:1#EmMesh:LIGHT_BEACON_BELLY') | |
p.set('LIGHTS', 'lightdef.6', 'Type:3#Index:3#LocalPosition:-73.793213,0.000000,6.224617#LocalRotation:0.000000,0.000000,180.000000#EffectFile:LIGHT_ASOBO_NavigationWhite#PotentiometerIndex:1#EmMesh:LIGHT_Navigation_White') | |
p.set('LIGHTS', 'lightdef.7', 'Type:2#Index:3#LocalPosition:-73.797852,0.000000,6.335907#LocalRotation:0.000000,0.000000,180.000000#EffectFile:LIGHT_ASOBO_StrobeDouble#PotentiometerIndex:1#EmMesh:LIGHT_STROBE_REAR') | |
p.set('LIGHTS', 'lightdef.8', 'Type:5#Index:1#LocalPosition:0.195332,-7.364830,-2.173142#LocalRotation:0.000000,0.000000,0.000000#EffectFile:LIGHT_ASOBO_LandingLarge#PotentiometerIndex:1#EmMesh:LIGHT_LANDING_MAIN_LEFT') | |
p.set('LIGHTS', 'lightdef.9', 'Type:5#Index:2#LocalPosition:0.195000,7.365000,-2.173000#LocalRotation:0.000000,0.000000,0.000000#EffectFile:LIGHT_ASOBO_LandingLarge#PotentiometerIndex:1#EmMesh:LIGHT_LANDING_MAIN_RIGHT') | |
p.set('LIGHTS', 'lightdef.10', 'Type:5#Index:3#LocalPosition:32.656708,-0.613699,-4.166347#LocalRotation:0.000000,0.000000,0.000000#EffectFile:LIGHT_ASOBO_LandingLarge#PotentiometerIndex:1#EmMesh:LIGHT_LANDING_FRONT_LEFT') | |
p.set('LIGHTS', 'lightdef.11', 'Type:6#Index:1#LocalPosition:33.176888,-0.709952,-5.949129#LocalRotation:0.000000,0.000000,0.000000#EffectFile:LIGHT_ASOBO_TaxiLarge#PotentiometerIndex:1#EmMesh:LIGHT_ASOBO_Taxi') | |
p.set('LIGHTS', 'lightdef.12', 'Type:9#Index:1#LocalPosition:-66.0,-10.3,8.0#LocalRotation:-50,0,-70#EffectFile:LIGHT_ASOBO_LogoLightLarge#PotentiometerIndex:3#EmMesh:LIGHT_ASOBO_LogoLeft') | |
p.set('LIGHTS', 'lightdef.13', 'Type:9#Index:2#LocalPosition:-66.0,10.3,8.0#LocalRotation:-50,0,70#EffectFile:LIGHT_ASOBO_LogoLightLarge#PotentiometerIndex:3#EmMesh:LIGHT_ASOBO_LogoRight') | |
print(p.sections()) | |
with open(filename, "w") as f: | |
p.write(f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome job man. Love you. Now i can finally fly at night :D. It still dosen't work with some planes but its much better than nothing. Prob Asobo issue. Thanks though!