- Can you use vars and locate? Example: var/my_var = locate(usr.x,usr.y+1,usr.z) and then use it like, my_var.density = 1.
- Can you use for() in the following way?: for(var/turf/T in locate(usr.loc))
There are more, i just need some ways to get the turf (or atom) in a certain x,y,z coordinates, into a var, do i can edit thier vars.
Thank you
-Rcet
ID:149760
![]() Feb 21 2002, 8:21 am
|
|
Im trying to finish up my project i started a while back and i need some questions answered..
|
Lummox JR wrote:
Rcet wrote: This is funny. I tried doing this for a test, and it gives me errors: client What is wrong? I also tried doing this under mob.Move() but still gives me the same errors. -Rcet |
Because my_var doesn't have a opacity var because it's not defined as an atom.
var/turf/my_var = locate(x,y,z) |
I did that, and at runtime, when i press an arrow key, it gimes me this:
runtime error: Cannot modify null.opacity. Thanks -Rcet |
Rcet wrote:
I did that, and at runtime, when i press an arrow key, it gimes me this: You have to check on the value returned by locate() to be sure it's not null. If you try to get a location off the edge of the map, locate() returns null instead of a turf. Lummox JR |
Yes, that's perfectly acceptable. locate(x,y,z) should always return a turf, but it will at any rate be an atom; use var/atom/my_var and then density is a known var belonging to it.
No, because locate() returns a turf, and a turf won't have other turfs within its contents. (Also, locate(usr.loc) is redundant; usr.loc should do well enough as long as it's a turf.)
Lummox JR