EmpyrionScripting
EmpyrionScripting copied to clipboard
{{blocks}} fails to take a range of Y figures.
Describe the bug There are 2 bugs, which I suspect have an overlap in their root cause.
The main bug I'm experiencing:
When using the {{blocks scope, you are required to select FromX FromY FromZ ToX ToY ToZ. FromX ToX, and FromZ ToZ works, but FromY ToY only works if they are the same number. i.e. {{blocks -5 128 -5 5 128 5}} will work. {{blocks -5 127 -5 5 129 5}} will not work.
The second bug, is somewhat odd.
I can reference a block by sending it a command. For instance, 1 block to the left of the core using {{block -1 128 0}}
I can send it a command to re-paint or re-texture it, no problem at all.
However, if I were to ask the location of something I know to be in that same location of -1 128 0, the co-ordinates it gives me, are -1 0 0. I don't know if this is connected.
To Reproduce I have a blueprint, which should demonstrate the behavior concisely. https://steamcommunity.com/sharedfiles/filedetails/?id=3274687580&searchtext=respray
Steps to reproduce the behavior:
- Deploy this blueprint.
- Open the LCD with the script on it.
- Change the 'targetcolor' to '3'.
- This will re-paint all the blocks over a single Y co-ordinate (128).
- Now, alter the {{blocks}} scope to include more than a single figure. I.e. set it to 127 and 129. This should paint all blocks 1 layer underneath the 128 co-ordinate, and all blocks 1 layer above. This fails.
Expected behavior I would expect the FromY and ToY co-ordinate system to function in the same way as the FromX ToX and FromZ ToZ.
For reference, this is the script. define '2' as the initial color I wish to look for, and 10 is the texture i'm looking for. I then look for that color+texture, over all blocks within the range, and where I find that color+texture, i will change the color to the target color. The objective of this, is that I have a Xenosteel ship, with a bunch of color accents. I wish to re-paint just these accented blocks, on command.
{{set 'targetcolor' '2'}} {{set 'initialcolor' '2'}} Test {{#blocks E.S -3 128 -6 4 128 4}} {{#each .}} {{#test Top eq 10}} {{~#test TopColor eq @root.Data.initialcolor}} {{setcolor . @root.Data.targetcolor 'T'}} {{/test}} {{/test}}
{{#test Bottom eq 10}} {{#test BottomColor eq @root.Data.initialcolor}} {{setcolor . @root.Data.targetcolor 'B'}} {{/test}} {{/test}}
{{#test North eq 10}} {{#test NorthColor eq @root.Data.initialcolor}} {{setcolor . @root.Data.targetcolor 'N'}} {{/test}} {{/test}}
{{#test South eq 10}} {{#test SouthColor eq @root.Data.initialcolor}} {{setcolor . @root.Data.targetcolor 'S'}} {{/test}} {{/test}}
{{#test West eq 10}} {{#test WestColor eq @root.Data.initialcolor}} {{setcolor . @root.Data.targetcolor 'W'}} {{/test}} {{/test}}
{{#test East eq 10}} {{#test EastColor eq @root.Data.initialcolor}} {{setcolor . @root.Data.targetcolor 'E'}} {{/test}} {{/test}} {{/each}} {{/blocks}}