Cant and Load in the same Frame Lade_C2 : Level_Load(@2)

Posted By: Noobi

Cant and Load in the same Frame Lade_C2 : Level_Load(@2) - 02/19/10 21:14

Ich bekomme das oben ganannte Error(W 1509) wenn ich mein Level Wechseln will.
Hier die Wichtigen COde Zeilen:

Code:
function Lade_C2
{
	                fps_max = 40;
                wait(5);
                   level_load("ode_c2.wmb");
                     wait(5);
                			ks_etc.visible = off;
                			block_commandmenu = 1;
                			command_pan.visible = off;
                			health_bar_pan.visible = off;
                			health_bar_pan2.visible = off;
                			health_bar_pan3.visible = off;
                			b_attack = 0;
                			wait(1);
}



und

Code:
function licht_cutscene
{


sleep(2);
	Kamera_Modus2 = 0;
	b_wasd = 1;
	b_jump = 1;


	while(x < 20)
	{
light2.Alpha = 0;
vec_set(temp,light2.x);
vec_sub(temp,camera.x);
vec_to_angle(camera.pan,temp);
camera.z += 500;
x += 1;
wait(1);
}	
	sleep(1);
light2.INVISIBLE = off;
		while (light2.alpha < 99){
	light2.alpha += 0.9*time_step;


wait(1);

}


if(light2.alpha > 99)
{

sleep(3);
lade_C2();

                			}
}



Das komische ist nur das wenn ich den Alpha Wert Des Sprites NICHT änder kurz bevor ich das Level Lade bekomme ich keinen Error.Wieso krieg ich einen Error Das hängt doch garnicht zusammen...?
Posted By: Schmerzmittel

Re: Cant and Load in the same Frame Lade_C2 : Level_Load(@2) - 02/19/10 21:23

Ohne es zu Prüfen. Aber warum verwendest du sleep? Wurde das nicht komplett geändert in wait?

Wenn du wait(-3) nimmst, dann wartest du auch 3 Sekunden. Probiers mal aus.
Posted By: Noobi

Re: Cant and Load in the same Frame Lade_C2 : Level_Load(@2) - 02/19/10 22:04

ok habs mal ausprobiert,also es ist anscheinend das gleiche wie sleep ,die Meldung bekomm ich jedoch immernoch....
Posted By: Damocles_

Re: Cant and Load in the same Frame Lade_C2 : Level_Load(@2) - 02/19/10 22:22

Ich schätze mal das die funktion "Lade_C2"
mehrere Male zugleich aufgerufen wird.

Überprüf mal wer die aufruft, und blockiere mehrere eventuelle Aufrufe.
Zb indem Du in "Lade_C2" eine globale Variable am Anfang setzt

if(loading==1) return;
loading=1;

....laden

..ende:

wait(1);
loading=0;


Posted By: Noobi

Re: Cant and Load in the same Frame Lade_C2 : Level_Load(@2) - 02/20/10 00:34

Ok Danke!!
Es hat super geklappt grin
© 2024 lite-C Forums