Revision history[back]
4
No.3 Revision
updated2010-10-07 21:58:16.464299
1

cache of old player positions

function custom(m)
    local array = {}
    for i=1,m do
        array[i]={0,0}
    end
    return array
end

cache={}
for i=1,10 do
    cache[i]=custom(32)
end

addhook("always","omg")
function omg()
    cache[10]=cache[9]
    cache[9]=cache[8]
    cache[8]=cache[7]
    cache[7]=cache[6]
    cache[6]=cache[5]
    cache[5]=cache[4]
    cache[4]=cache[3]
    cache[3]=cache[2]
    cache[2]=cache[1]

    for i=1,32 do
        cache[1][i][1],cache[1][i][2]=player(i,"x"),player(i,"y")
    end
end

what i want it to do: make a table that holds every player's position for the previous 10 frames. e.g. cache[5][16][2] shows the y position of player #16 5 frames ago.

what it is doing: it is only showing the current position. old positions are not saved or something.something. it feels like cs2d is executing my list of cache[x]=cache[x-1] in reverse o.OO

3
No.2 Revision
updated2010-10-07 21:52:20.833714
1

cache of old player positions

function custom(m)
    local array = {}
    for i=1,m do
        array[i]={0,0}
    end
    return array
end

cache={}
for i=1,10 do
    cache[i]=custom(32)
end

addhook("always","omg")
function omg()
    cache[10]=cache[9]
    cache[9]=cache[8]
    cache[8]=cache[7]
    cache[7]=cache[6]
    cache[6]=cache[5]
    cache[5]=cache[4]
    cache[4]=cache[3]
    cache[3]=cache[2]
    cache[2]=cache[1]

    for i=1,32 do
        cache[1][i][1],cache[1][i][2]=player(i,"x"),player(i,"y")
    end
end

end

what i want it to do: make a table that holds every player's position for the previous 10 frames. e.g. cache[5][16][2] shows the y position of player #16 5 frames ago.

what it is doing: it is only showing the current position. old positions are not saved or something.

2
No.1 Revision
updated2010-10-07 21:48:59.838278
1

cache of old player positions

function custom(m)
    local array = {}
    for i=1,m do
        array[i]={0,0}
    end
    return array
end

cache={}
for i=1,10 do
    cache[i]=custom(32)
end

addhook("always","omg")
function omg()
    cache[10]=cache[9]
    cache[9]=cache[8]
    cache[8]=cache[7]
    cache[7]=cache[6]
    cache[6]=cache[5]
    cache[5]=cache[4]
    cache[4]=cache[3]
    cache[3]=cache[2]
    cache[2]=cache[1]

    for i=1,32 do
        cache[1][i][1],cache[1][i][2]=player(i,"x"),player(i,"y")
    end
end

end

what i want it to do: make a table that holds every player's position for the previous 10 frames. e.g. cache[5][16][2] shows the y position of player #16 5 frames ago. ago.

what it is doing: it is only showing the current position. old positions are not saved or something.

1
asked2010-10-07 21:46:44.251465
1

cache of old player positions

function custom(m)
    local array = {}
    for i=1,m do
        array[i]={0,0}
    end
    return array
end

cache={}
for i=1,10 do
    cache[i]=custom(32)
end

addhook("always","omg")
function omg()
    cache[10]=cache[9]
    cache[9]=cache[8]
    cache[8]=cache[7]
    cache[7]=cache[6]
    cache[6]=cache[5]
    cache[5]=cache[4]
    cache[4]=cache[3]
    cache[3]=cache[2]
    cache[2]=cache[1]

    for i=1,32 do
        cache[1][i][1],cache[1][i][2]=player(i,"x"),player(i,"y")
    end
end

what i want it to do: make a table that holds every player's position for the previous 10 frames. e.g. cache[5][16][2] shows the y position of player #16 5 frames ago.

what it is doing: it is only showing the current position. old positions are not saved or something. it feels like cs2d is executing my list of cache[x]=cache[x-1] in reverse o.OO

Made with Django.