Hello, o already posted this on the bug section, but i would like you guys to check this.

you can download the file here: GO TO BUG SECTION LINK

or you can read the code here.

Code:
#include <acknex.h>
#include <default.c>
#include <litec.h>
BMAP* c_map;


function fade_pan_out(PANEL*p){
set(p,TRANSLUCENT); //Allow alpha
while(p.alpha>0){
p.alpha-=20*time_step;
wait(1);	
}
///After faded, make it invisible
p.alpha=0;set(p,UNTOUCHABLE);reset(p,SHOW);		
}



function load_wait(short a, short b, var time){
PANEL* ar=pan_create("bmap=c_map;",5);
var timex=0;
set(ar,SHOW);
ar.pos_x=a;ar.pos_y=b;
while(timex<time){wait(1); timex++;}

//reset(ar,SHOW); //switch with fade , and it wont happen again
fade_pan_out(ar);  //remove the panel ,     <<<<<<<< this is one thing that causes a "bug" to dissapear "no related" further panels.

ptr_remove(ar); //remove the local created panel pointer
}

PANEL* addd_pan;
function add_contact_start2(){addd_pan=pan_create("bmap=c_map; pos_x=100; pos_y=50;flags=SHOW;",4);}


function main(){
vec_set(screen_color,vector(53,53,53)); 
video_window(NULL,NULL,16,"TEST");
video_set(800,600,0,0);
level_load(NULL);
wait(1);
reset(camera,SHOW);
c_map=bmap_createblack(100,100,32);  //something to just show
wait(1);
bmap_fill(c_map,vector(100,200,100),100);
wait(1);

//real script
load_wait(300,300,100); //waits 200 to fade out, and when over , keep this function bellow.
wait_for(load_wait);
add_contact_start2(); //create a new panel...
}




Like JCl said there is timming problem with the fade out, and then ptr remove (which wont wait for the fade out function)
but that is not reason to fade the 2nd panel anyway

Last edited by MMike; 07/01/10 21:15.