WormHoles in Developer Help
|
|
I,ve created these worm holes, and I have about 20 of them, now I want to make them connect, but only two at a time, so A connects to B and B connects to A not A then B then C just a two way gate.
The problem is I want it to be randomly generated, I dont wanna code out all of their X,Y,Z cords, so I created some procs but could never get the hang of it.
One of the failed procs was
-----------------------------------------------------------
obj/proc/Hole()
sleep(1)
if(src.GoTo == null)
for(var/obj/WormHoles/WormHole/W in world)
if(W.GoTo == null)
if(W != src)
if(W.z != src.z)
src.GoTo = W.z
W.GoTo = src.z
if(src.GoTo == null)
src.Hole()
-----------------------------------------------------------
But for some reason many of the worm holes when entered either take you back to it, or wont work at all, one or two work but thats about it.
Any suggestions or code would be great :)
|