Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
evolution level - endless loop #211194
06/15/08 14:32
06/15/08 14:32
Joined: Jun 2007
Posts: 63
Italy
Sonic220 Offline OP
Junior Member
Sonic220  Offline OP
Junior Member

Joined: Jun 2007
Posts: 63
Italy
I've created an action for some entity in the level.
Do you know rez? the game created from sega for dreacast, i want simulate a similar evolution code.
i have this
Code:
if(energy > 100){
			lvl += 1;
			energy = 0;
		}

Code:
action level { //impostare i flag
	my.transparent = ON;
	my.alpha = 0;
	my.ambient = 35;
	gameover_pan.alpha = 0;
	sleep(5);
	while(lvl > 0){
		while(lvl == 1)
		{
			my.alpha -= my.flag2*4*time_step;
			my.x = player.x;
			my.z = player.z;
			my.y = player.y;
				if(my.alpha < 100){
				my.alpha += my.flag1*2*time_step;
				my.alpha -= my.flag2*2*time_step;
				}
		my.pan += 10*my.flag1;
		wait(1);
		}
	while(lvl == 2)
		{
			my.x = player.x;
			my.z = player.z;
			my.y = player.y;
			if(my.alpha < 100){
				my.alpha += my.flag2*2*time_step;
			}
			my.roll += 3*my.flag2;
			wait(1);
		}
	}
	while(my.alpha > 0){
		my.alpha-= 2*time_step;
		wait(1);
	}
	gameover_pan.visible = on; //parte del gameover
	while(gameover_pan.alpha <= 100){
		gameover_pan.alpha += 10 * time_step;
		wait(1);
		}

}

it works when lvl decrase, but not when lvl incrase.
When energy come to 100, lvl pass to 2, then it says endless loop.

Someone can give me an hel? cause it seems fine to me, but doesnt work.


~Vision Divine~
Re: evolution level - endless loop [Re: Sonic220] #211197
06/15/08 14:46
06/15/08 14:46
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
The while(lvl > 0) loop has no wait(1) instruction inside, so maybe thats the reason?
Updated the
Code:
//impostare i flag
action level 
{
	my.transparent = ON;
	my.alpha = 0;
	my.ambient = 35;
	gameover_pan.alpha = 0;
	wait(-5);
	
	while(lvl > 0)
	{
		while(lvl == 1)
		{
			my.alpha -= my.flag2*4*time_step;
			my.x = player.x;
			my.z = player.z;
			my.y = player.y;
			if(my.alpha < 100)
			{
				my.alpha += my.flag1*2*time_step;
				my.alpha -= my.flag2*2*time_step;
			}
			my.pan += 10*my.flag1;
			wait(1);
		}
		
		while(lvl == 2)
		{
			my.x = player.x;
			my.z = player.z;
			my.y = player.y;
			if(my.alpha < 100)
			{
				my.alpha += my.flag2*2*time_step;
			}
			my.roll += 3*my.flag2;
			wait(1);
		}
		
		wait(1);
	}
	
	while(my.alpha > 0)
	{
		my.alpha-= 2*time_step;
		wait(1);
	}
	
	gameover_pan.visible = on; //parte del gameover
	
	while(gameover_pan.alpha <= 100)
	{
		gameover_pan.alpha += 10 * time_step;
		wait(1);
	}
}


Re: evolution level - endless loop [Re: Xarthor] #211384
06/16/08 12:29
06/16/08 12:29
Joined: Jun 2007
Posts: 63
Italy
Sonic220 Offline OP
Junior Member
Sonic220  Offline OP
Junior Member

Joined: Jun 2007
Posts: 63
Italy
Thx for the help, i will post my code, maybe it will be helpful for someone
Code:
action level { //impostare i flag
	my.transparent = ON;
	my.alpha = 0;
	my.ambient = 35;
	gameover_pan.alpha = 0;
	sleep(5);
	while(lvl > 0){
		my.x = player.x;
		my.z = player.z;
		my.y = player.y;
		if(lvl == 1)
		{		if(my.alpha > 0){
					my.alpha -= my.flag2*2*time_step;
				}
				if(my.alpha < 100){
					my.alpha += my.flag1*2*time_step;
				}
			my.pan += 10*my.flag1;
		}
		if(lvl == 2)
		{	if(my.alpha > 0){
				my.alpha -= my.flag1*2*time_step;
			}
			if(my.alpha < 100){
				my.alpha += my.flag2*2*time_step;
			}
			my.roll += 3*my.flag2;
		}
	wait(0.1);
	}
	while(my.alpha > 0){
		my.alpha-= 10*time_step;
		wait(1);
	}
	gameover_pan.visible = on; //parte del gameover
	while(gameover_pan.alpha <= 100){
		gameover_pan.alpha += 10 * time_step;
		wait(1);
		}

}



~Vision Divine~

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1