D:
I need something to check the whole world the way view() does.
(for(var/blah in world) goes from left to right and stuff)
How would you go about doing this?
I was thinking creating an obj everytime view() gets to its limit, and making a view proc off of the obj...but it might not work, so I wanna' know before I work on it. :p
ID:269321
![]() May 25 2005, 10:37 am
|
|
Theodis wrote:
D: You could always, however, do your own line-of-sight routines based on the techniques available at http://roguelikedevelopment.org. Sadly you can't replace BYOND's automatic line-of-sight stuff with your own, but you can always use a homemade LOS calculator for other purposes. Lummox JR |
Er, I gave what you said a shot and:
largerange(atom/center,range) Yet, it finds nothing in the list D: (nothing gets sent to the world). I did for(var/turf/t in largerange(src,10)). And nothing got sent out D: Sorry for being bothersome or something. But, what's the problem? [edit]Realised all I needed was a turf (code edit) [edit]I fixed it, and block isn't what I want, it goes like: ######### Not: ### ### ### Any other ways to imitate view(), just a large range number at the end? |
What if you created temporary new objects and made the proc check their view() as well? The player wouldn't see anything, but you could expand the area. I don't know how to do it at the moment. But it sounds like a cool idea (at least I think so lol).
|
Rockinawsome wrote:
What if you created temporary new objects and made the proc check their view() as well? The player wouldn't see anything, but you could expand the area. I don't know how to do it at the moment. But it sounds like a cool idea (at least I think so lol). Can't be done, because the view angle would be off. If A can see B and B can see C, it doesn't necessarily follow that A can see C. Lummox JR |
I'm trying to get the visual sense of what you're saying, you're most probably right, I just can't picture what you're saying yet. Hehe, perhaps a cheesy text map to help me out?
like: M = mob O = object X=view of Mob V=view of Object VVVVV VXOXV VVXXXXXVV VVOXMXOVV VVXXXXXVV VXOXV VVVVV Or...something like that....Cripes...that looks terrible. Well, it lets me think that everything in oview of M would be done twice (because of the view of the objects), so you'd have to control it with an if statement and a variable so it only happens once. I don't know... |
I don't know... B C The dashes are a wall. A can see B and B can see C but the wall blocks A from seeing C. |
This works for me: (Of course, it doesn't do any LOS checking, just returns a big block of stuff and the stuff in that stuff, minus the Ref, their stuff and location if you use longoview(). <s>Range doesn't accept text, so you can't use "11x13" for the range, like you can with view().</s>
[Edit 2] Range does accept text now. You can enter a single number for the range, or you can use a text string, or even world.view or client.view. The format for text ranges is the same as world.view: ex: "11x13". #define neighbors(X, Y, Z, XRange, YRange) (\ You will still have to figure out how to tell if the things in this list can be seen by the Ref. >.> ~X [Edit] Wait, what about shooting the atom? If you can use a missle to hit the atom, then it goes to reason that you can see it. Not always true for view(), but it might work. It would probably be rather slow, though, relatively speaking. |
If you need to keep line of sight restrictions based on the center you'll have problems. However if you just want to get everything within a specified range you could just use block() to get the turfs within a certain range then check all their contents.