#(Isz) Get lowest value in map tag then access the others. Hard to explain.

38 messages · Page 1 of 1 (latest)

plucky hemlock
#

I'm trying to detect what the closest objective is out of a few different ones. My idea was to put all info into a list of maptags, get the lowest distance then access that particular maps other properties. After doing .lowest on the list to find lowest distance I'm not sure how to get the location and objective.

https://paste.denizenscript.com/View/103052

dawn pineBOT
#

(Isz) Get lowest value in map tag then access the others. Hard to explain.

#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

plucky hemlock
#

Don't worry about the if_null and max distance of 50, that's a problem for another day

limber narwhal
#

Uhh. What line are you referring to? And what exactly are you trying to accomplish

#

Cuz uhh

#

I can kinda see but

#

!t location.between

scenic oxideBOT
#
Possible Confusion

Did you mean to search for elementtag.before?

limber narwhal
#

!t location.distance

scenic oxideBOT
viscid terrace
#

<player> is not available in a delta time event

#

find_blocks[].within[50] is going to bring your server to its knees

#

it's basically scanning several hundreds of thousands of blocks, and you are running it multiple times

#

expect a huge lag spike every 10 seconds once you get <player> available through a foreach

limber narwhal
#

You can check the distance between points and find the lowest one

#

In your map I would make the distance first in the list

#

Then the other info trailing that

viscid terrace
#

you can't get the points of arbitrary far-off blocks efficiently. if the blocks are in some static world instead, you can use that static location of the blocks

#

(like for example, this was not a survival world, but was instead some build where you manually placed all the blocks/objectives for people to do)

#

if it's a survival world, what you should be doing is slow-scanning for objectives over multiple ticks, and probably work in some of your own optis

#

for example, glowstone comes in clusters, so you probably don't have to check every location

plucky hemlock
#

The blocks are preplaced but there's far too many of them to mark each location

#

I have got this working but you mention the find_blocks[50] will lag the server. This distance check thing only happens when a player is on this stage of this quest but I will look into changing it

viscid terrace
#

If it's preplaced then what you do is write a script that lets you mark each cluster easily, then go through marking each one. After that, you'll have 10-20 locations to check instead of hundreds of thousands

acoustic rainBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please type </resolved:1028673926114594866> to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@plucky hemlock