Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3   Go Down

Author Topic: IL2 Campaign Validation Sript v0.2  (Read 14030 times)

0 Members and 1 Guest are viewing this topic.

marcost

  • Modder
  • member
  • Offline Offline
  • Posts: 1086
  • Keep calm and run away
Re: IL2 Campaign Validation Sript v0.2
« Reply #12 on: March 19, 2015, 03:24:12 AM »

Hi thanks again for this, it's really useful. I found a problem though - the script uses the first column of air.ini as the skinfolder name when checking for skins. This air.ini name is not always the same name as the skin folder e.g.

Air.ini                 skinfolder

Bf-109E-4/B        Bf-109E-4_B

Ju-52/3mg4e       Ju-52_3mg4e


On the examples above it is the backslash that is not allowed in folder names. Sorry I don't know where the skinfolder name is defined. It's not in the aircraft classfile nor is it the classfile name

Not a huge problem as it only affects a few a/c but will explain some 'false positives' on missing skins.

Regards,

M

Logged

andqui

  • Modder
  • member
  • Offline Offline
  • Posts: 141
Re: IL2 Campaign Validation Sript v0.2
« Reply #13 on: March 19, 2015, 07:20:14 AM »

Hi thanks again for this, it's really useful. I found a problem though - the script uses the first column of air.ini as the skinfolder name when checking for skins. This air.ini name is not always the same name as the skin folder e.g.

Air.ini                 skinfolder

Bf-109E-4/B        Bf-109E-4_B

Ju-52/3mg4e       Ju-52_3mg4e


On the examples above it is the backslash that is not allowed in folder names. Sorry I don't know where the skinfolder name is defined. It's not in the aircraft classfile nor is it the classfile name

Not a huge problem as it only affects a few a/c but will explain some 'false positives' on missing skins.

Regards,

M



I was told that it used the first column when searching for skins in another post here, so that's what I went with. If anyone knows how to reliably get the information without having to dig around in the compressed, compiled class files, I'd appreciate it. It's an easy fix if I know what to look for instead.
Logged

dpeters95

  • Modder
  • member
  • Offline Offline
  • Posts: 450
Re: IL2 Campaign Validation Sript v0.2
« Reply #14 on: March 20, 2015, 01:46:42 PM »

andqui, I'm new to Python but I have installed 3.4.3 and modified the Main.py file.  However, when I run Python.exe and type "python main.py" and hit enter, it says syntax error.  What am I doing wrong?

Logged

andqui

  • Modder
  • member
  • Offline Offline
  • Posts: 141
Re: IL2 Campaign Validation Sript v0.2
« Reply #15 on: March 20, 2015, 02:00:52 PM »

andqui, I'm new to Python but I have installed 3.4.3 and modified the Main.py file.  However, when I run Python.exe and type "python main.py" and hit enter, it says syntax error.  What am I doing wrong?

This assumes a basic knowledge of CMD/command prompt (the windows console).
The "python" part of "python main.py" runs python, you don't need to start running python.exe beforehand.

1. After installing python, make sure python.exe is added to your path:

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=windows+add+to+path

2. To test if it's installed correctly, open up cmd and type "python", which should start the python console. Type "quit()" to close it, as this was just a test and you don't need to do this to run the script.

3. Then, in the console, change the directory to wherever you have main.py stored. For example: "cd C:\EXAMPLE\FOLDER\PATH".

The "cd" command changes the current directory to the path that follows it. Then, entering "python main.py" should open python and run the script. Remember to change the paths at the top of the script to point it to the correct IL2 directories. If you don't cd to where you have main.py stored, the "python main.py" command won't be able to find it and will say that there is no such file.
Logged

dpeters95

  • Modder
  • member
  • Offline Offline
  • Posts: 450
Re: IL2 Campaign Validation Sript v0.2
« Reply #16 on: March 21, 2015, 07:43:06 AM »

andqui/anyone, I don't mean to be a pain but I just can't get this to work.  I believe I have it installed and setup properly but I keep getting this:

Traceback (most recent call last):
File "Main.py", line 16, in (module)
for line in airIni:
File "C:\Python34\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 434: character maps to (undefined)

Any help would be appreciated...
Logged

andqui

  • Modder
  • member
  • Offline Offline
  • Posts: 141
Re: IL2 Campaign Validation Sript v0.2
« Reply #17 on: March 21, 2015, 10:40:17 AM »

andqui/anyone, I don't mean to be a pain but I just can't get this to work.  I believe I have it installed and setup properly but I keep getting this:

Traceback (most recent call last):
File "Main.py", line 16, in (module)
for line in airIni:
File "C:\Python34\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 434: character maps to (undefined)

Any help would be appreciated...


First off all, that's a good sign that you're running the script correctly, so that's progress. The error you just gave happens when the script can't decode/understand some of the bytes in a file, which is usually because of non-standard characters.

Go to your air.ini, scroll down to the Japanese A6M section. You should see a few of the entries have an @ sign in the whitespace next to them. Delete that @ sign, as well as a big chunk of the whitespace around it; I think those entries were originally written in a Japanese-language OS, and the character's don't translate cleanly to unicode. That should fix the problem, let me know if you have any more problems.
Logged

dpeters95

  • Modder
  • member
  • Offline Offline
  • Posts: 450
Re: IL2 Campaign Validation Sript v0.2
« Reply #18 on: March 21, 2015, 11:16:30 AM »

Go to your air.ini, scroll down to the Japanese A6M section. You should see a few of the entries have an @ sign in the whitespace next to them. Delete that @ sign, as well as a big chunk of the whitespace around it; I think those entries were originally written in a Japanese-language OS, and the character's don't translate cleanly to unicode. That should fix the problem, let me know if you have any more problems.

It works now!  Thank you for the help...
Logged

vonOben

  • Modder
  • member
  • Offline Offline
  • Posts: 885
  • Wer den Tod fürchtet, hat das Leben verloren.
    • vonOben's Flight Sim Mods
Re: IL2 Campaign Validation Sript v0.2
« Reply #19 on: September 12, 2015, 03:38:06 AM »

Thanks for the script andqui!

I've tested it but I get this error:

Traceback <most recent call last>:
File "Main.py", line 58, in <<module>
stationaries [lineData[1] = lineData[0]
IndexError: list index out of range

Any ideas why?
Logged
vonOben's Flight Sim Mods  http://vonoben.free.fr/ Twenty Years online January 3, 2022!

tartenmuche

  • Supporter
  • member
  • Offline Offline
  • Posts: 393
Re: IL2 Campaign Validation Sript v0.2
« Reply #20 on: September 12, 2015, 10:48:08 AM »

Dear Andqui,
I downloaded Main.py and Python 3.4.3. I can open Main.py with Notepad and get your example, but then I am stuck. When I command "Python" I get a small screen on which I have to type I don't know what.
I am lost.
Best regards.
Logged
Intel Core Duo E8400 3GHz, Nvidia GeForce GTX 750 Ti, 2x2 gb DDR2 1066 mHZ

vonOben

  • Modder
  • member
  • Offline Offline
  • Posts: 885
  • Wer den Tod fürchtet, hat das Leben verloren.
    • vonOben's Flight Sim Mods
Re: IL2 Campaign Validation Sript v0.2
« Reply #21 on: September 14, 2015, 04:48:11 AM »

tartenmuche, please follow this instruction by andqui

This assumes a basic knowledge of CMD/command prompt (the windows console).
The "python" part of "python main.py" runs python, you don't need to start running python.exe beforehand.

1. After installing python, make sure python.exe is added to your path:

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=windows+add+to+path

2. To test if it's installed correctly, open up cmd and type "python", which should start the python console. Type "quit()" to close it, as this was just a test and you don't need to do this to run the script.

3. Then, in the console, change the directory to wherever you have main.py stored. For example: "cd C:\EXAMPLE\FOLDER\PATH".

The "cd" command changes the current directory to the path that follows it. Then, entering "python main.py" should open python and run the script. Remember to change the paths at the top of the script to point it to the correct IL2 directories. If you don't cd to where you have main.py stored, the "python main.py" command won't be able to find it and will say that there is no such file.
Logged
vonOben's Flight Sim Mods  http://vonoben.free.fr/ Twenty Years online January 3, 2022!

tartenmuche

  • Supporter
  • member
  • Offline Offline
  • Posts: 393
Re: IL2 Campaign Validation Sript v0.2
« Reply #22 on: September 15, 2015, 03:00:36 AM »

Dear vonOben,
it doesn't help me to just give me the same instructions as Andqui.
When I use the link you recommend I get 127 millions of answers. It is a litlle bit to many for me. I don't want to change something on my computer that I don't understand and without being sure that I can go the reverse way.
Best regards.
Logged
Intel Core Duo E8400 3GHz, Nvidia GeForce GTX 750 Ti, 2x2 gb DDR2 1066 mHZ

Zoran395

  • Mapper
  • member
  • Offline Offline
  • Posts: 355
Re: IL2 Campaign Validation Sript v0.2
« Reply #23 on: September 15, 2015, 04:10:54 AM »

vonOben,  :) thank you for your Python skills, much appreciated !

Here is how I use it which may help others:

I got Python 3.5.0 rc4 which comes with IDLE (integrated development environment).
After installing Python, on my Windows 10 machine, .py are associated with IDLE so that I can, in Windows Explorer, with a right click choose "Edit with IDLE".
This lets you change the paths at the top of the script. Hit save.
Then there is a menu entry in IDLE, with "Run | Run Module F5", hit that and the script will ... run in a separate window, the Python shell.
Copy the whole shell output with "Edit | Copy ..." and paste in your text editor for further treatment.
Mine is Notepad++ which has a function to sort all lines by alphabetical order.
After sorting the lines, those starting with "###..." will be at the top, indicating where the issues are.
My next step is with TextCrawler to find and replace in multiple files at the same time...
Logged
Pages: 1 [2] 3   Go Up
 

Page created in 0.077 seconds with 25 queries.