How is your struct currently defined? And do you "zero()" it before use?

Ive put this code together based on this post and your struct one but they dont seem to mesh.
So Ive made some assumptions and done this.
Code:
#define maxoverlays 40

typedef struct { 
   int       overlays; //How many overlays used 
   PANEL*    overlay[maxoverlays];    //Pointer to each Overlay
   int       posx[maxoverlays];       //Its position on the map
   int       posy[maxoverlays];       // "     "      "  "   "
   int       visibility[maxoverlays]; //Overlays visibility setting
   char*     filename[maxoverlays];   //Name of panels BMAP file
   char*     background;              //Name of background BMAP file
} LEVEL;

LEVEL point1; // structure

function populate_panels(LEVEL* leveldata)
{
   var i;
   for (i=0; i<leveldata.overlays; i++) //Lets create as many overlays as needed
   {
      if(leveldata.visibility[i] == 1) //if visibility of this overlay is 1 then proceed 
      {
         STRING* BuildString = str_create("");
         str_cat(BuildString,"bmap = ");   
            str_cat(BuildString,leveldata.filename[i]);   
            str_cat(BuildString,";  ");   
         str_cat_num(BuildString,"pos_x = %.0f;  ",leveldata.posx[i]);   
         str_cat_num(BuildString,"pos_y = %.0f;  ",leveldata.posy[i]);   
         str_cat(BuildString,"flags = VISIBLE;");
         leveldata.overlay[i] = pan_create(_chr(BuildString),2);
      }
   }
}


   ...
   zero(point1);       //first time use zero to clear potential junk data
   point1.overlays=13;
   // assume build/load overlay filenames etc here
   ...
   populate_panels(point1); //pass it to function
   ...

Now, if your struct has changed from what Ive "assumed", let me know what it is and I'll look again.
Theres not enough info in this thead at the moment for me to figure out any more.

PS the weird BuildString thing you'll see before the pan_create is because the
pan_create statement WILL NOT take variables from an array. The resulting panel is
only half populated. I fell in this hole hard recently, and Im still sore.
So the BuildString creates a string containing the DATA from the array variables and builds
the panel based on that.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial