ID:165184
Feb 11 2007, 11:24 am
|
|
In my code i have Objects that wander around with a density of 1 Imagine this object wanders away from its orig. spot and some passerby wanders to it and logs out. Then imagine that the world is rebooted and both that Object and Passerby are recreated into that same spot. CHAOS. The game creates the object first and sends the passerby to the first avaible spot on the X,Y,1 layer of the map. So my how-to question is... How do i detect if there is two things being created at once, or if the the mob's saved x,y,z location is already occupied? |
Copyright © 2024 BYOND Software.
All rights reserved.
Eh? Not at all. It's perfectly possible to have hundreds of atoms in a given atom, or in this case hundreds of movables (objs and mobs) in a turf.
Actually, as implied above, chances are they will both be created at the same spot, and if not, the 2nd object created will be at loc null ("black screen"). You need to actually set that up yourself for what you said to happen.
Well, you don't really have to if you're properly using Move() to place objects as it will return 0 if movement failed; but if you really want, you can mimic an Enter() proc (or work to actually using it); make a is_turf_empty() proc that goes like this: if the turf's density is 1, return 0, otherwise loop threw the turf's contents and if a dense object is found, return 0. At the end, return 1.