if(get_dist(/mob/units/soldiers/Digger/,/turf/water) == 1)
usr << "CHEESE"
Does anybody know why this doesnt work? Thanks in advance!
-Crio
ID:176311
Jan 26 2003, 12:05 pm
|
|
Im trying to make it so if your next to the turf water something happens my code is:
if(get_dist(/mob/units/soldiers/Digger/,/turf/water) == 1) Does anybody know why this doesnt work? Thanks in advance! -Crio |
Jan 26 2003, 12:11 pm
|
|
Yes. get_dist() takes two atoms as arguments. You've passed two type paths into it.
|
In response to Garthor
|
|
why dont it work?
|
In response to Koolguy900095
|
|
Koolguy900095 wrote:
why dont it work? http://www.byond.com/forum/ forum.cgi?action=message_read&id=163361&forum=8&view=0 |
In response to OneFishDown
|
|
Just typing in " [link] " looks nicer, y'know! BYOND will automatically link it.
|
In response to Garthor
|
|
Garthor wrote:
Just typing in " [link] " looks nicer, y'know! BYOND will automatically link it. Yea, but its faster to just copy the link to the post. |
In response to Garthor
|
|
im confused...how do i fix it tho...an atom is like a mob right
|
In response to Koolguy900095
|
|
You're trying to use the type path, as Garthor calls it, as arguments for the proc. That's like specifying a directory where you want to be specifying a file. You want to use a variable as an argument for that proc, like this:
<code>mob/verb/findwater() var/turf/water/WATER var/mob/MOB = src for(var/turf/water/W in range()) WATER = W break MOB << get_dist(WATER, MOB)</code> |
In response to OneFishDown
|
|
You can copy the post ID in the top right corner of the post.
|
In response to Garthor
|
|
I would've, but I was reading his post, so it was easier to copy the link to yours then reply.
|
In response to Triste
|
|
why doesnt this work for every tile even if i put the guy on the water...:
var/turf/water/WATER |
In response to Koolguy900095
|
|
Because range() doesn't limit it to everything 1 tile away. Oh, and it's also not inside of a proc.
|
In response to Garthor
|
|
how do i fix this....im really confused and its in a proc:
Dig() |
In response to Koolguy900095
|
|
I have no clue what you're trying to do. And it's vertical, not verticle.
|
In response to Garthor
|
|
read my first post for what im trying to do...im trying to make it so when ur next to water and dig it makes a moat in the way u tell it to...then if ur next to a moat u can make a moat next to it....
|
In response to Koolguy900095
|
|
mob/verb/Dig_Moat() |
In response to Garthor
|
|
now how do i make it check if the src is there not usr?
|
In response to Koolguy900095
|
|
What?
|
In response to Garthor
|
|
if(locate(/turf/water) in orange(1) || locate(/turf/moat) in orange(1))
checks to see if the usr is there how do i make it check is the src is orange(1) away from the water and moat |
In response to Koolguy900095
|
|
Change orange(1) to orange(src,1).
|