If you do this, it should work just fine:
mob/New()
..()
loc = locate(/turf/brick)
In response to Misticone
|
|
Having more than one /turf/brick won't break it, but locate() will return the first instance that it finds.
If you do this, it should work just fine: mob/New() |
In response to Albro1
|
|
Humm i don't agree with you.
Let's imagine that he has 4 /turf/brick in te map. By writing loc = locate(/turf/brick) The code won't work the way Rexar wants to ,MistY, |
In response to Misticone
|
|
If you're using a certain type of turf as a unique waypoint, then having multiple of something present that should be unique is a pretty dumb idea in the first place. Either declare a new type for the waypoint and use it only once, or even use the tag variable and locate() to find the appropriate turf that way.
|
In response to Misticone
|
|
You're still thinking like a human. When dealing with problems like this, you have to think like a machine. That also requires some understanding of how things work, though.
When using locate() with a type (Assuming you're using the world as the container), it loops through each turf in the world. I believe it starts at x=1,y=1 and proceeds to x=world.maxx,y=1, then bumps up the y value. It will return the first instance of the atom you're looking for. I'm not saying that the code won't cause issues, because obviously having different instances of the same atom could cause issues in finding the exact one that you want, but I am saying that locate() does not think about choices like humans do. As for finding a specific instance out of different instances of an atom, look into changing the tag variable, like LA said. |
In response to Albro1
|
|
Oh thanks :)
|
if u have more than 1 than the problem is there