ID:179242
 
I know I can do usr.Move(locate(/turf/blah)), and send my "player" to the new location, but I am trying to tell him how to ge there on his own theoretically using
locate(/turf/flag1)
get_dir(/turf/flag1)and
get_dist(/turf/flag1),
now I would like to set these all to variables and display them in the "status window" but if I set
/mob/var/flag1loc = locate(/turf/flag1), I get a "constant expression expected error"
So ok I am trying to do something that the language doesn't do, but how else can I store a location in a value to call upon it for later use??

Illya
Illyena wrote:
[snip]
/mob/var/flag1loc = locate(/turf/flag1), I get a "constant expression expected error"
[snip]

That error tends to occur in version 306 when assigning things which are not constant to variables as they are declared.

You might want to try initializing flag1loc in your New() proc. (In other words, cut the "= locate(/turf/flag1)" part and set flag1loc equal to that in the mob's New().)

Updating to a beta is another possibility, but it should not be needed for this as far as I know.
In response to ACWraith
Ok so this a great start

New()
flag1 = locate(/turf/flag1)
flag_dir = get_dir(usr.loc,/turf/flag1)
flag_dist = get_dist(usr.loc,/turf/flag1)
restart = (locate(/turf/start))
return

However I want to be able to reset "restart" when I enter another tile on the game, and it doesn't seem to be working, I must be missing something simple, here is that code
turf/repair1
icon = 'repair1.dmi'
Entered(O)
usr.respoint = 2
usr << "repair 1 entered"
usr.restart = usr.loc usr << "your restart point is now [usr.restart]"
In response to Illyena
CAn 2 turfs occupy the came tile and exhert all of the listed conditionals for both types, and if so does the Entered() proc only work for the most recently applied turf type??
In response to ACWraith
ACWraith wrote:
Illyena wrote:
[snip]
/mob/var/flag1loc = locate(/turf/flag1), I get a "constant expression expected error"
[snip]

That error tends to occur in version 306 when assigning things which are not constant to variables as they are declared.

I think this is a DM thing more than a 306 thing. The early 307 betas added a lot of new support for declaring lists and such at compile-time, but procs like locate() and rand() still can't be used in this context.

Lummox JR
In response to Illyena
Illyena wrote:
[snip]
However I want to be able to reset "restart" when I enter another tile on the game, and it doesn't seem to be working, I must be missing something simple, here is that code
turf/repair1
icon = 'repair1.dmi'
Entered(O)
usr.respoint = 2
usr << "repair 1 entered"
usr.restart = usr.loc usr << "your restart point is now [usr.restart]"

I'm not quite sure what you are trying to do or what the problem is... I suppose I'll shoot my mouth off anyway, further confusing you and myself on a public forum. :)

Entered is called after whatever has entered the turf. Chances are, usr.loc has been set to the location of the instance of repair1 before this. Restart is supposedly set to the location of the instance of repair1 within Entered().

In theory, the output should be:
your restart point is now the repair1

Is this not happening or is this just plain not what you wanted?

PS: Please hit enter after your lines of code. The output after clicking post makes it look like you have possible indentation problems. Those who don't reply with a quote won't see what it looked like when you typed it.
In response to Illyena
Illyena wrote:
CAn 2 turfs occupy the came tile and exhert all of the listed conditionals for both types, and if so does the Entered() proc only work for the most recently applied turf type??

I don't think multiple turfs can occupy the same space. (It might help if you think of turfs as tiles. They don't occupy - they are.)

I think, from reading other posts anyway, the most recently applied turf will overwrite the turf currently in that location. The old turf might appear as an underlay, but its code no longer matters.
In response to ACWraith
Ok I can modify a map to accomidate that limitation, I'm getting my blue book!!!
In response to ACWraith
Actually exactly what I was after, it also was having a problem because I had 2 turf's occupying the same space which I fixed, the barrier was overriding the repair.
Illya
In response to Illyena
Actually turfs can overlay eachother, but only when one has transperency to it, other that that they override eachother.
In response to Nadrew
Nadrew wrote:
Actually turfs can overlay eachother, but only when one has transperency to it, other that that they override eachother.

They can be overlaid in the map editor, yes, but I think the real question is how they're handled internally. From what I've read recently, the map editor does this by using either overlays or underlays, putting the old turf under the new one.

Lummox JR
In response to Lummox JR
the map editor does this by using either overlays or underlays, putting the old turf under the new one.

The old ones are all underlays, but depending on layer settings they can actually appear above the real turf.

-AbyssDragon