Need help, extremely confusing T0T FINALLY GOT IT =D
Posted: Thu May 02, 2013 1:12 am
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)
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 >_>
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
- 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 >_>
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