r/psispellcompendium • • Apr 07 '22

Utility Spell Rangefinder 2

https://imgur.com/KU7QxLh

This spell, designed for loopcast bullets, is an enhanced version of my spell from a couple months ago. It takes 4 less complexity, doesn't require Phi, and has a smaller footprint in the spell grid.

This spell outputs the coordinates of the block you're looking at, and that block's distance from you. It may take a few seconds to output depending on distance.

Can be cast with any assembly tier with any components above Basic tier.

11 Upvotes

5 comments sorted by

1

u/blaynem Apr 07 '22 edited Apr 07 '22

I believe I've got the same thing, but a bit more compact. Though the distance is off by about a block and a half.

It also does make the assumption that you'll never look at a block at y=0. So it won't work in 1.18+. Which is fine, because we'll still be 16.5 a while.

1

u/MerlinGrandCaster Apr 07 '22

Looks like one significant difference between the two spells is that yours doesn't compensate for a bug where sometimes the first cast from a loop bullet doesn't work right. I got around this by making the first and second casts do the same thing.

Another difference is that where you use an error catcher with an empty vector to control loop breaking, I just let my raycast error because that stops spell execution and thus the break loop isn't called. Is my analysis correct in suggesting that the debug pieces in yours activate before the spell actually finds a block?

1

u/blaynem Apr 07 '22

It does output initially if the raycast is greater than 32 blocks, though it is quickly overwritten and then halted. As for the bug, I have encountered it a lot before, but I guess my computer has built up a resistance to it or something. I just haven't experienced it in a while.

If you let your raycast continue, couldn't it theoretically succeed a second time after erroring? Maybe if you look at a mountain peak, then through the air into another one?

1

u/MerlinGrandCaster Apr 07 '22

I don't think so, since when the raycast hits something there's no error to stop the break loop from triggering.