Hello RedGuides
To date, I have only really paid much attention to the TLO of NearestSpawn, and its friends Spawn & Target.
Everything that I had been doing, seemed to be relative to me, the character, where I am stood in the zone.
There was a thought, I dont care when i am. I want to know about spawns "over there". At an asbsolute location on the map, rather than realtive to where I am standing.
Initially there were a lot of complicated thoughts in mind. For example, getting lists of spawns in the zone. Then having iterating over them, with their spawn co-ords, and my interested loc co-ords, doing something with the likes of ${Math.Distance[y,x,z:y,x,z]}. The lower results, would be close to the location a postive result, and the bigger much further away discounted result.
Maybe I was over thinking, and some of this leg work has been provided. This became a reading session on macroquest pages, over the TLO and datatypes.
It was this entry about Spawn Search, that gave the biggest clue to help here:
I didnt know we could put a "loc x y (z)" in it as an option, until that reading today. Perfectly hitting the nail, as it says to include a radius as well.
Some tests you can try for yourselves:-
(in which, replace X Y with location cordinates interested in ).
In the test case, I was in the zone on my own wth various npc & mobs, so got a reasonable integer for the first.
The second, came back with 1. There was only me.
I ran the third, with my current location in, it came back with me.
I moved away more than the 50 and repeat that echo, it now says 0. Excellent.
I did similar tests again with
When I was close, it gave my name, further away i think it reported NULL.
But why?
Most are probably content working with spawns relative to themselves. Hunter scripts, looking for nearest spawns on the shortest nav path to go find and fight them.
I have had a few times been in a zone and wishing to camp some named but other players are near there. Couple that also with the map lag of lots of spawns on greater zoom out, navigate around zoom in, it can take time to check if the camp spots are from players.
With a hot key, I can echo spawn location radius pc, for a few name mob camps i am interested in and see quickly if there are players near or not without requiring to look at, zoom in and scroll around the map.
It also means i can check whilst moving to the camp, if players have also moved to it and beaten me to arriving.
But regardless for what reasons of doing it, I thought it would be worth sharing that it is possible to do spawn look ups with a radius to an absolute loc position, rather than just assume its always relative to the character running the macro script.
Regards and Best Wishes
To date, I have only really paid much attention to the TLO of NearestSpawn, and its friends Spawn & Target.
Everything that I had been doing, seemed to be relative to me, the character, where I am stood in the zone.
There was a thought, I dont care when i am. I want to know about spawns "over there". At an asbsolute location on the map, rather than realtive to where I am standing.
Initially there were a lot of complicated thoughts in mind. For example, getting lists of spawns in the zone. Then having iterating over them, with their spawn co-ords, and my interested loc co-ords, doing something with the likes of ${Math.Distance[y,x,z:y,x,z]}. The lower results, would be close to the location a postive result, and the bigger much further away discounted result.
Maybe I was over thinking, and some of this leg work has been provided. This became a reading session on macroquest pages, over the TLO and datatypes.
It was this entry about Spawn Search, that gave the biggest clue to help here:
Last year, i had learned about not being explicit enough in spawn criteria. i.e. if you dont mention "npc" than you could get the npc pet instead. This lead onto learning about detailing of npc, pet, or even pc.I didnt know we could put a "loc x y (z)" in it as an option, until that reading today. Perfectly hitting the nail, as it says to include a radius as well.
Some tests you can try for yourselves:-
/echo ${SpawnCount}
/echo ${SpawnCount pc}
/echo ${SpawnCount[loc X Y radius 50 pc]}
(in which, replace X Y with location cordinates interested in ).
In the test case, I was in the zone on my own wth various npc & mobs, so got a reasonable integer for the first.
The second, came back with 1. There was only me.
I ran the third, with my current location in, it came back with me.
I moved away more than the 50 and repeat that echo, it now says 0. Excellent.
I did similar tests again with
/echo ${Spawn[loc X Y radius 50 pc]}
When I was close, it gave my name, further away i think it reported NULL.
But why?
Most are probably content working with spawns relative to themselves. Hunter scripts, looking for nearest spawns on the shortest nav path to go find and fight them.
I have had a few times been in a zone and wishing to camp some named but other players are near there. Couple that also with the map lag of lots of spawns on greater zoom out, navigate around zoom in, it can take time to check if the camp spots are from players.
With a hot key, I can echo spawn location radius pc, for a few name mob camps i am interested in and see quickly if there are players near or not without requiring to look at, zoom in and scroll around the map.
It also means i can check whilst moving to the camp, if players have also moved to it and beaten me to arriving.
But regardless for what reasons of doing it, I thought it would be worth sharing that it is possible to do spawn look ups with a radius to an absolute loc position, rather than just assume its always relative to the character running the macro script.
Regards and Best Wishes