Code:
mob/proc/instanceCopy(var/copyZ,var/newZ,var/maxx,var/maxy)
//var/max=world.maxzw
if(newZ>world.maxz)
world.maxz+=1
src.Move(locate(8,2,newZ))
src.dir=NORTH
for(var/x=1;x<=maxx;x++)
for(var/y=1;y<=maxy;y++)
var/sturf/t=locate(x,y,copyZ)//;t=new()
var/sturf/t2=locate(x,y,newZ)
t2.icon=t.icon;t2.icon_state=t.icon_state;t2.density=t.densi ty
t2.AI=t.AI;
for(var/mob/enemy/e in locate(x,y,copyZ))
var/mob/enemy/E=e;E=new();E.loc=locate(x,y,newZ);E.icon=e.ic on
E.icon_state=e.icon_state
Problem description:
This code works farly well in copying a map into a new map, what doesnt work is it makes the turfs plain turfs, and i cant copy specific types of turfs. It just makes them all /turf turfs. Id like to be able to copy the branches of turfs to. Like turf/something Inst
Aug 26 2014, 3:48 am
|
|
opps sturf=turf. sorry damn the codding didnt go in right place again
|
It's: <DM>[Insert Code Here]</DM>
For t2, why not copy the path of the t1 /type and make a new instance at that location: var/sturf/t2=t1.type Also, a handy shortcut involving new() was shown above new /path/to/object (new_location) |