On a large map, how could I run a proc that selects a single piece of turf of a particualr type (assuming there are several of these turf types in the world (I just want one of them)) and manipulate that?
Example:
In a large city, I want a single house to burst into flames and set the usr.client.eye to that house.
ID:176566
![]() Jan 2 2003, 8:46 am
|
|
![]() Jan 2 2003, 10:17 am
|
|
Maybe adding a different tag to each turf? then u can locate it using that tag.
|
well if you know were that turf is located befor runtime, you can always just us its location to point some proc to it. I didnt understand your point all the way, so i might not be helping.
|
Krosse wrote:
On a large map, how could I run a proc that selects a single piece of turf of a particualr type (assuming there are several of these turf types in the world (I just want one of them)) and manipulate that? To select a random turf of a given type, you'd do this: var/turf/mytype/T var/turf/T var/turf/T Lummox JR |
Well, thank you all for your advice. I think I'll go with Lummox's suggestion. He's never steered me wrong before and it seems to fit the best. Sorry if my example was a bit cryptic.
|
By the way, I assumed that the "break" line was to avoid an infinite loop, but I soon discovered that if there is no turf of the specified type, it will result in an infinite loop. Just for future reference.
(Not a big deal as, if you write this into your code, obviously, you're going to have that turf type in the program.) |
Krosse wrote:
By the way, I assumed that the "break" line was to avoid an infinite loop, but I soon discovered that if there is no turf of the specified type, it will result in an infinite loop. Just for future reference. Ah--a way around that is to abort the proc if count==0, before picking a random value. (I hadn't thought about that; the count=rand(1,count) will set count=1.) Or you can use the list method. This shouldn't be an infinite loop because the second loop will end on its own when it runs out of turfs, though. It's just less desirable behavior than not going through the loop at all. Lummox JR |