var/turf/T = new/turf/anything
T.loc = locate("move here")
Problem description:
This gives a runtime of can't edit a constant value. I am looking for a way to move turfs do to a bug that moves them from their original location.
ID:141924
![]() Oct 2 2008, 10:04 am
|
|
Code:
var/turf/T = new/turf/anything Problem description: This gives a runtime of can't edit a constant value. I am looking for a way to move turfs do to a bug that moves them from their original location. |
Therefore, his problem of the turfs moving might actually be worthy of a bug report, unless he messed up on some coding which I don't think is likely to cause such a bug to happen.
|
That's she, and the only thing I can see causing it is a system I made so people can log out and keep their location, but this only applies to special turfs and those turfs aren't the one's moving. I have had issues with the game randomly moving turfs during a compile though this bug doesn't happen at compile time.
|
Her problem could be caused by all sorts of things, most likely definitely not turfs actually moving, but turfs being unexpectedly created/deleted, etc. It might appear they may be moving, but it is not necessarily the case. Either way I'm not telepathic, so I couldn't tell what the problem really is like this.
|
Turfs cannot move by definition, so you're seeing something else happening, such as the saved data from a turf being loaded into a different one. (In general you shouldn't be saving turfs though, at least not in raw form, because if someone's standing on them you can end up with a "rollback" issue.)
Lummox JR |
How I set it up is that the turf's location is saved in the mob and the mob just moves to the x,y,z saved in the location. I don't actually save the turf.
|
Dpheonix7 wrote:
How I set it up is that the turf's location is saved in the mob and the mob just moves to the x,y,z saved in the location. I don't actually save the turf. I'm not sure how you'd be seeing turfs "move" without having saved and loaded them directly, then. I do suspect the issue is something in your code though. Lummox JR |
Only descendants of /atom/movable can move, their location vars can be changed and they also have a Move() procedure.
When creating a new turf, you're supposed to pass the initial location (an old turf to replace) in new()'s first argument - that's the location. The turf will be created at the spot of the old turf used, and virtually replace it (though this might not be completely the case).