Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error While Trying to Extract DivisionRules.ndf #3

Closed
wolff69 opened this issue May 28, 2023 · 8 comments
Closed

Error While Trying to Extract DivisionRules.ndf #3

wolff69 opened this issue May 28, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@wolff69
Copy link

wolff69 commented May 28, 2023

I would like to first say that you have done a fantastic job on the project however, the data extraction keeps throwing an error with newer versions of the files used to create the export csv, I was wondering if I could get your input updating the project so it can handle the newer data fields added since the patch this was made for?

returned value is 0
Traceback (most recent call last):

DivisionRulesArray = helper.csv.export(procedures.DivisionRules.extract("/Scripts/data/DivisionRules.ndf", "/Scripts/data/Divisions.ndf"), version, "DivisionRules", keywords.deck) 

WARNO-DATA-main\WARNO-DATA-main\Scripts\procedures\DivisionRules.py", line 107, in extract
extractDivisionRules(open(rootDirectory + filePathDivisionRules,"r").read(), 0, Divisions, 0)

WARNO-DATA-main\WARNO-DATA-main\Scripts\procedures\DivisionRules.py", line 28, in extractDivisionRules
extractDivisionRules(temporaryStr, level + 1, Divisions, divisionIndex)

WARNO-DATA-main\Scripts\procedures\DivisionRules.py", line 46, in extractDivisionRules
DivisionRules[-1][listIndex] = [DivisionRules[-1][listIndex][0], Divisions[divisionIndex][listIndex][1]]
~~~~~~~~~^^^^^^^^^^^^^^^
IndexError: list index out of range

@Perytron
Copy link
Owner

Welcome, @wolff69! I'm surprised to see your interest in this project despite its rather messy code, haha! I will take a quick look at it tomorrow morning. However, please note that I have university exams this week. If I can't address it tomorrow, I'll make sure to give it attention on Friday, alright? It would be fantastic to collaborate with you and bring this project back on track.

Anyhow, I believe the optimal approach would be to rewrite the entire code, especially considering that I've completed an entire semester on Python at university since then. In approximately five weeks from now, I'll be on summer vacation, and if it is desired, I can rewrite it then.

@Perytron
Copy link
Owner

Perytron commented May 29, 2023

@wolff69 I have identified the error in the code. However, there are some challenges in fixing it due to the messy state of the code. Eugen has made changes to variable names, which the program relies on to navigate through the files. As a result, the array remains empty, and nothing is extracted from divisons.ndf.

I'm planning to perform a quick & dirty fix this Friday so that you are able to at least read out the files. But eh, I will rewrite the code anyways over the coming weeks.

@wolff69
Copy link
Author

wolff69 commented May 30, 2023 via email

@Perytron Perytron self-assigned this May 31, 2023
@Perytron Perytron added the bug Something isn't working label May 31, 2023
@Perytron
Copy link
Owner

Hey again, @wolff69! I'm excited to announce that I've just committed the first iteration of the refactored code, which embraces a pure object-oriented approach (OOP) and utilizes regular expressions (RegEx). I couldn't wait for friday, haha!

Furthermore, I've created a new issue to keep everyone informed about the progress of the refactor.

It's important to note that the first iteration successfully captures a sample from WeaponDescriptor.ndf and outputs the findings to the console. The code is already much more readable and understandable. However, before moving on to the next .ndf files, my next step will be to maximize abstraction and improve readability.

@wolff69
Copy link
Author

wolff69 commented May 31, 2023

That is a great idea i am so glad you were able to update the code base, and appreciate all your hard work on this wonderful tool.

@Perytron
Copy link
Owner

Hey again, @wolff69! I'm really pleased with the progress of the new code base. Ammunition.ndf and WeaponDescriptor.ndf are being parsed correctly, although currently they only output the values to the console.

Unfortunately, due to my upcoming university exams in two weeks, I won't be able to continue coding for the repository until after they are over. However, once they are done, I have nothing planned except for coding on this repository.
I'll definitely keep you updated on the progress of exporting to .csv.

@wolff69
Copy link
Author

wolff69 commented Jun 12, 2023 via email

@Perytron
Copy link
Owner

Perytron commented Dec 6, 2023

Hey @wolff69! I wanted to inform you that I am closing this issue as I've decided not to proceed with the .ndf parser. This repository has transitioned into a dedicated wiki, as detailed in this pull request. If you're in need of a .ndf parser, you might find this repository useful, as suggested in another issue.

@Perytron Perytron closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants