-
Notifications
You must be signed in to change notification settings - Fork 14
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
Possibility to use coordinate arrays for one block #46
Comments
For coordinate JSON parsing, you can check out this source code. https://github.com/NovaEngineering-Source/ModularMachinery-Community-Edition/blob/master/src/main/java/hellfirepvp/modularmachinery/common/machine/DynamicMachine.java#L248 |
This code, as I understand it, supports arrays of coordinates in JSON format. In the addCoordinates method of the DynamicMachine class, the coordinate arrays for the X, Y, and Z axes are added to lists avX, avY, and avZ. "These lists are then used to create all possible permutations of the coordinates, allowing the set of positions in space to be defined." As I understand it you can use these lists to combine the locations of identical blocks, for a compact json look. So the question is not python, but how the mod should handle coordinate arrays, I don't fully understand the mechanics itself.
I just don't understand how to specify one type of block by certain coordinates as an array. Or is it necessary to specify it all separately? This way we get huge json files... Example: The original machine Reassembled json As you can clearly see here that my mechanism has turned into a kind of cube, there are blocks that I did not specify the coordinates, the mod adds them itself. |
In reality, component coordinates in modular machinery are relative to the controller; coordinate resolution is just a series of arrays that are added in a loop, and if you define duplicate coordinates in the parts array, they will be overwritten.
If you need to write the same components in a single part, I'm sorry to say that the current modular mechanism may not be able to do that. If you must use arrays, I would suggest defining only 1 of the three arrays Example:
Sorry, my description may not be accurate, but I would still recommend writing the structure file as normal. |
Specifically I understand your example, thanks for explaining the mechanics of how array parsing works in a script.
I would suggest not removing the old mechanics, as you say, so as not to break compatibility. But adding a new one, switchable in config, would be a great option in my opinion. |
Good afternoon, the mod doesn't have an option to use coordinate arrays for one block?
I have a json multiblock structure with 8k lines of code, I wrote a passer that arrays the same blocks.
The problem is that I get a different multiblock in the result.
Maybe I didn't quite understand how it is realized, I relied on this documentation.
The original json of the mechanism
Received json
The text was updated successfully, but these errors were encountered: