-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Directional Vehicle Parts for mounted tools, seats, windshields, rams, and doors #40437
Directional Vehicle Parts for mounted tools, seats, windshields, rams, and doors #40437
Conversation
This pull request introduces 1 alert when merging d2ca094 into f6d85ac - view on LGTM.com new alerts:
|
|
||
with open(output_path, "w") as jf: | ||
json.dump(result, jf, ensure_ascii=False, sort_keys=True) | ||
subprocess.Popen(['D:/Cataclysm-DDA/tools/format/json_formatter.exe', output_path], shell=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only going to work on windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script I based this off, this https://github.com/CleverRaven/Cataclysm-DDA/blob/master/tools/json_tools/pocket_mags.py and it wasn't working for me on Windows. I don't actually expect anyone to be running this script, as I'm committing the transformed JSON along side it. It's more for documentation purposes.
This pull request introduces 1 alert when merging 8d3170c into 2abca8f - view on LGTM.com new alerts:
|
If I understand you correctly, this is not ok, it's going to impose a huge rewrite and migration effort that is going to have to be adressed immediately. Can you instead have it introduce a new abstract part and then create a non-abstrsct post that inherits from it and uses the original name? I.e. some part "heavy_frame" With that done everything can be migrated over piecemeal. |
Perfect, that's a lot easier than my plan of writing a script to update the vehicle definitions. I'll do that. |
How's it going with this? |
This is ready. |
Summary
SUMMARY: Infrastructure "Adds a script for creating directional vehicle parts from json."
Purpose of change
A step towards making this a reality #35861
I applied the script to most vehicle parts: seats, rams, doors, tools, windshields. Game will now ask you which variant you want to mount of that piece, like it does for frames.
Describe the solution
Edit the script to set the
parts.json
to be modified. Possibly comment out some of the variants you don't want included. The script takes every non-abstract part inparts.json
and makes it an abstract one. Then it creates a variant for each of those similar to the ones that exist for frames/boards. For convenience it also writes a textfile with every newly created id, hopefully that can help tileset makers update their tilesets?