@name CRONUS EYE v2
@inputs [Look Point]:vector
@persist [H7 H1]:entity

if(first()){
    Angles=array(),Colours=array(),Materials=array(),Models=array(),Parents=array(),Positions=array(),Scales=array()
        #Creation array populating
    Angles[1,angle]=ang(270,0,0),Angles[2,angle]=ang(),Angles[3,angle]=ang(40,90,90),Angles[4,angle]=ang(-40,90,90),Angles[5,angle]=ang(45,40,0),Angles[6,angle]=ang(-45,-40,0),Angles[7,angle]=ang(0,90,0)
    Colours[1,vector]=vec(0,1,1)*191.25,Colours[2,vector]=vec(0,1,1)*255,Colours[3,vector]=vec(1,1,1)*255,Colours[4,vector]=vec(1,1,1)*255,Colours[5,vector]=vec(1,1,1)*255,Colours[6,vector]=vec(1,1,1)*255,Colours[7,vector]=vec(0,1,1)*255
    Models[1,string]="hqicosphere2",Models[2,string]="hqicosphere2",Models[3,string]="hqcylinder",Models[4,string]="hqcylinder",Models[5,string]="hqcylinder",Models[6,string]="hqcylinder",Models[7,string]="hqicosphere2"
    Parents[1,number]=7,Parents[2,number]=1,Parents[3,number]=7,Parents[4,number]=7,Parents[5,number]=7,Parents[6,number]=7,Parents[7,number]=7
    Positions[1,vector]=vec(),Positions[2,vector]=vec(0,0,1),Positions[3,vector]=vec(0,-3,-7),Positions[4,vector]=vec(0,-3,6),Positions[5,vector]=vec(-7,-4,6),Positions[6,vector]=vec(7,-4,6),Positions[7,vector]=vec(0,-4,0)
    Scales[1,vector]=vec(2,2,2)/3,Scales[2,vector]=vec(3,3,6)/9,Scales[3,vector]=vec(1,4,1)/3,Scales[4,vector]=vec(1,4,1)/3,Scales[5,vector]=vec(4,1,1)/3,Scales[6,vector]=vec(4,1,1)/3,Scales[7,vector]=vec(1,5,4)/3
        #Creation arrays ditched after first execution
    print(Angles:count()+"")
    #Hologram production
    S=0
    P=0
        #Spawning
    while(S<=Positions:count()){
        Pos=Positions[S,vector]
        Sca=Scales[S,vector]
        Ang=Angles[S,angle]
        Col=Colours[S,vector]
        holoCreate(S,Pos,Sca,Ang,Col)
        
        holoModel(S,Models[S,string])
        if(S==7){holoMaterial(7,"models/props_combine/tpballglow")}
        
        S++
    }
        #Parenting
    while(S==Positions:count()+1&P<=Positions:count()){
        holoParent(P,Parents[P,number])
        P++
    }
    
    H1=holoEntity(1)
    H7=holoEntity(7)
    
    runOnTick(1)
}

#Hover position determination
if(Point){Po=Point}else{Po=entity():pos()}
    holoPos(7,Po)

#Look position determination
if(Look){T=Look}else{T=H1:pos()+entity():forward()}
if(!Look & $Look){reset()}
    #Prevents angle locking if the Eye chip is destroyed

#Main body turning (25 times slower)
    A7=(T-H7:pos()):toAngle()-H7:angles()
C=(H7:angles()+A7/25):setRoll(0)
holoAng(7,C)

#Eye turning
A=(T-H1:pos()):toAngle()
holoAng(1,A)