Page 1 of 1

Need help, extremely confusing T0T FINALLY GOT IT =D

PostPosted: Thu May 02, 2013 1:12 am
by Hblade
Ok guys this is driving me mad, when I load the map (everything loads fine) but the top layer has random tiles on it (from layer 2 which never even got placed yet)
Code: Select all
void LoadTiles()
{
    Actor*A;
    Actor*A2;
    char*tmp, *tmp2;
    int i;
    for(i=0;i<10000;i++)
    {
        sprintf(tmp, "Tiles.%d", i);
        sprintf(tmp2, "Events.%d", i);
        A=getclone(tmp);
        A->animpos=tAnim1[i];
        A2=getclone(tmp2);
        A2->animpos=tAnim2[i];
    }
}

This is the code that actually -changes- the tiles. Theres "Tiles" and "Events" which Events is layer 2, tAnim1[i] is the tile animation of the cloneindex of each "Tiles" actor, where as tAnim2 stores the "Events" animpos of the cloneindex. I don't understand whats going wrong, I looked in the Events layer and coppied EVERYTHING and even added If statements to determine which layer your on, I also changed tAnim1 to tAnim2 just like I should, and everything gets placed PERFECTLY FINE but when I load, oh god no it loads glitchy >_>

wtf.png


As seen in this screenshot, layer 2 doesn't get loaded properly but layer 1 is fine, again I coppied everything that involves layer ones code, and changed it to tAnim2 so it should effin' work but it doens't

Re: Need help, extremely confusing T0T

PostPosted: Thu May 02, 2013 3:24 am
by skydereign
Are you sure the values in the array are correct?

Re: Need help, extremely confusing T0T

PostPosted: Thu May 02, 2013 4:14 am
by Hblade
No not sure on that at all, i'll check later and try to do a new for statement

Re: Need help, extremely confusing T0T *RIPPING HAIR OUT*

PostPosted: Fri May 03, 2013 5:38 pm
by Hblade
FINALLY FIXED! :D