@name DesertSpire
@persist Int [EnderGraph Parents]:table
#include "graph_desertspire"
if(first()) {
    function loadHolos(EnderGraph:table) {
        local Parents=table()
        for(I=1,EnderGraph:count()) {
            
        }
        
    }
    EnderGraph=Graph
    timer("loader",1)
}

if (clk("loader")) {
    local Finished=0
    for(I=1, 30) {
        local I=Int+I
        if (EnderGraph[I,table]) {
            local V=EnderGraph[I,table]
            print("Creating",I)
            local ID=V["ID",number]
            local Parent=V["Parent",number]
            local Alpha=V["Alpha",number]
            local Pos=V["Pos",vector]
            local Ang=V["Angle",angle]
                Ang=ang(Ang:yaw(),Ang:pitch(),Ang:roll())
            local Color=V["Color",vector]*255
            local Size=V["Size",vector]/12
                if (Size:x()>25) {Size=vec()}
            holoCreate(ID)
            holoAlpha(ID,Alpha)
            holoPos(ID,Pos)
            holoAng(ID,Ang)
            holoScale(ID,Size)
            holoColor(ID,Color)
            Parents[toString(ID),array]=array(ID,Parent)
        } else {
            Finished=1
        }
    }
    if(!Finished) {
        Int+=30
        timer("loader",1000)
    } else {
        foreach(I,V:array=Parents) {
            holoParent(V[1,number],V[2,number])
        }
        holoPos(1,entity():pos())
        holoAng(1,ang(0,90,90))
        holoParent(1,entity())
        print("Finished!")
    }
    
}
