ID:267920
 
Once again, in many times, I have a problem!

area/air
area/plasma


This is my code.
What I need, is to figure out a way to make both of the area's "move". This can be done by simply making a Wander() proc...

New()
Wander()
proc/Wander()
set background = 1
step_rand(src)
sleep(200)
src.Wander()


However, I want the areas to not only move, I want them to create new area's of the same type, deleting *whatever* area's they come across.
Better saying, I want an room full of area/air, that will continously delete and recreate types of area/air.
This way, I could release plasma inside the room, and the plasma will slowly suck the air out of the room, only leaving plasma in the room.

My question,
How do I make it so that area/air and area/plasma moves, and recreates itsself so it is able to 'fill' an room with air, but not causing too much lag?
Current Code:
obj/air
New()
spawn(rand(1,300))
back
var/ox = src.x
var/oy = src.y
var/oz = src.z
step_rand(src)
new /obj/air(ox,oy,oz)
step_rand(src)
sleep(200)
goto back
// Wander()
proc/Wander()
set background = 1
var/ox = src.x
var/oy = src.y
var/oz = src.z
step_rand(src)
new /obj/air(ox,oy,oz)
step_rand(src)
sleep(200)
src.Wander()
obj/plasma
New()
spawn(rand(1,300))
back
world << "step"
step_rand(src)
sleep(200)
goto back
proc/Wander()
set background = 1
world << "step2"
step_rand(src)
sleep(200)
src.Wander()


Current Errors/Warnings:
loading spaceship.dme
Turfs.dm:134:error:goto back: bad link
Turfs.dm:126:back :warning: unused label
Turfs.dm:153:error:goto back: bad link
Turfs.dm:149:back :warning: unused label

spaceship.dmb - 2 errors, 2 warnings (double-click on an error to jump to it)
In response to Phoenix Man
It works. It creates air. And it barely lags!
However...
...it's still a bit slow.
In an room with NO air, I walked in, and there was no air. After like 5 minutes there was 1 tile with air, but that tile was airless after a couple of seconds.
In an room WITH air, I walked in, and breathed air successfully. But near the machine, there was no air. And around 5 minutes, all the air in that room was GONE!
obj
computers
airgenerator
icon_state = "aircontrol"
density = 1
New()
spawn(rand(1,20))
Wander()
proc/Wander()
set background = 1
var/obj/air/S = new(src)
S.loc = locate(S.x,S.y,S.z)
step_rand(S)
step_rand(S)
sleep(rand(5,10))
Wander()
obj/air
New()
spawn(rand(1,50))
Wander()
proc/Wander()
set background = 1
step_rand(src)
sleep(200)
Wander()
obj/plasma
New()
spawn(rand(1,50))
Wander()
proc/Wander()
set background = 1
step_rand(src)
sleep(200)
Wander()
In response to Phoenix Man
*** Solved! ***