Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/27/26 22:06
WFO Training with parallel cores Zorro64
by Martin_HH. 02/26/26 16:03
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (TipmyPip, Quad, AndrewAMD), 4,941 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
the1, alx, ApprenticeInMuc, PatrickH90, USER0328
19200 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