ID:142143
 
Code:
mob
verb
look(mob/M in oview(50,usr))
usr << " found: [M]"
return


Problem description:
I am making a verb to search for mobs from a distance (say, 50 tiles). I've tried oview/orange for this but both dont work (they can detect upto 7-8 tiles). Help would be appreciated.

look(mob/M in range("50x50",usr))


Try that, it should work. I can't test since I'm not at home at the moment.
In response to Andre-g1
it just showed the user, no other mob.
In response to Psmaun
*orange

Sorry, my keyboard is messed up here. So the "o" didn't appear. And it's weird that no other mob appears, are you sure there is a mob next to you ?
In response to Andre-g1
Yeah, i tried both range and orange, with orange nothing happens and with range it only shows the user. Yes, there were mobs around me.
In response to Andre-g1
Both range() and orange() are limited in their distance. For this, something like block() would be more suitable. Something like this may work well:
proc/large_range(atom/ref, range)
return block(locate(ref.x - range, ref.y - range, ref.z), locate(ref.x + range, ref.y + range, ref.z))

proc/large_orange(atom/ref, range)
return large_range(ref, range) - ref
In response to Psmaun
Weird it doesn't work.

Shot in the dark (just an alteration to see if it works ;
mob/verb/look()
var/mob/M = locate() in orange("50x50",usr)
usr << "Found : [M]"
In response to Popisfizzy
Popisfizzy wrote:
Both range() and orange() are limited in their distance. For this, something like block() would be more suitable. Something like this may work well:

I didn't know that, it should be documented in the reference, because if it isn't, most people (like me) will have no clue until someone (like you) tells us. :P
In response to Popisfizzy
Just for the record, what are range() and orange() distance limits?
In response to Cameron
"13x11" is on the reference as a valid value, however I don't think it's much higher than that, if it indeed has a max value. I guess we'll wait for an answer. :x
In response to Cameron
I don't remember exactly, but I think they're related to the client's view.
In response to Andre-g1
Just as a by-the-way, since I've seen this misconception multiple times around lately: an integer view of A is NOT the same as a view of "AxA" in the text string form. The former dictates the number of tiles viewable from the center of the view (so with a view of 0 you only see your tile, just like how view(0) works) in all directions but the latter is inherently different - you specify the absolute Width x Height measurements in it.
Really, why would it make any difference with problems if they were the same? Or why would there even be the second version if it was the same? Logic, people. >_>" And also reading the DM Reference, of course.
In response to Kaioken
Kaioken wrote:
Logic, people. >_>" And also reading the DM Reference, of course.

The DM reference, has no such thing as a range/orange limit. But I know <_< It was a stupid attempt lol.
In response to Andre-g1
I was talking about the view range format, not the maximum range (which is mentioned in some entries I believe). Logic, read the post in context. =P
In response to Popisfizzy
Thanks Popisfizzy, pointed me in the right direction.