I want to locate something new on the map, but offset it Y-1.
Will this work? And YES I know there is more to this code than just this, but this is the area I'm not sure will work or not.
(loc,y-1) What I think is this should locate something at the obj/s location, but offset it -1 y.
LJR
ID:149764
Feb 20 2002, 3:02 pm
|
|
In response to Dan
|
|
Dan this code did not work :(
Here is what I'm trying to do. LJR new/obj/metal_bars/copper_bars(loc,y-1) |
In response to LordJR
|
|
try this:
new/obj/metal_bars/copper_bars(locate(src.x,src.y-1,src.z))
Tell me if that works. -Rcet |
In response to LordJR
|
|
LordJR wrote:
Dan this code did not work :( new/obj/metal_bars/copper_bars(loc,y-1) You'd need to do this:
new/obj/metal_bars/copper_bars(get_step(loc,SOUTH))
Or...
new/obj/metal_bars/copper_bars(locate(x,y-1,z))
Remember that y is just a number, nothing more. It might be possible, but unwieldy, to code in a syntax where "loc,y-1" meant anything other than a pair of arguments. However I suspect that although BYOND has a pliable and very convenient syntax, it's probably past the point where that could be made to work. Worse, I think, is that "loc,y-1" doesn't make much sense from any kind of a semantic standpoint, so it'd be hard to make that into an actual language syntax because it lacks the sort of logical flow that other operations have. Lummox JR |
In response to Lummox JR
|
|
Lummox JR wrote:
new/obj/metal_bars/copper_bars(get_step(loc,SOUTH))
Thanks m8, this is the code that worked for me!! LJR |
You can do the coordinate arithmetic yourself, as you are proposing, or you can just use get_step(loc,SOUTH).
--Dan