Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,306 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Strange problem #256768
03/18/09 22:30
03/18/09 22:30
Joined: Aug 2008
Posts: 49
V
Vyse220 Offline OP
Newbie
Vyse220  Offline OP
Newbie
V

Joined: Aug 2008
Posts: 49
i have a strange problem, i use level_load, but sometimes an error came out: can't load in the same frame level - levelname
why?
Somebody can explane?

Re: Strange problem [Re: Vyse220] #256783
03/19/09 00:10
03/19/09 00:10
Joined: Jan 2009
Posts: 57
Slovakia
wolodo87 Offline
Junior Member
wolodo87  Offline
Junior Member

Joined: Jan 2009
Posts: 57
Slovakia
did you put wait() instruction after level_load? sometimes it helps

Re: Strange problem [Re: wolodo87] #256789
03/19/09 02:21
03/19/09 02:21
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
show ur code


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: Strange problem [Re: delinkx] #256814
03/19/09 07:47
03/19/09 07:47
Joined: Aug 2008
Posts: 49
V
Vyse220 Offline OP
Newbie
Vyse220  Offline OP
Newbie
V

Joined: Aug 2008
Posts: 49
Code:
	}
	gameover_pan.visible = on; //parte del gameover
	black_pan.visible = on;
	player.passable = on;
	while(gameover_pan.alpha <= 100){
		gameover_pan.alpha += 10 * time_step;
		wait(1);
		}
	sleep(1);
	while(black_pan.alpha <= 100){
		black_pan.alpha += 10 * time_step;
		wait(1);
		}
	//snd_stop(hnd);
	media_stop(hnd);
	sleep(1);
	snd_play (fail_wav, 10, 0);
	var failvalore;
	failvalore = random(100);
	greetings_txt.visible = on;
	if(failvalore < 100 && failvalore > 75){
		greetings_txt.string = fail2_str;
	}
	else{
		if(failvalore < 50 && failvalore > 0)
		{
			greetings_txt.string = fail1_str;
		}
		else
		{
			greetings_txt.string = fail3_str;
		}
	}
	snd_play(god_over,100,0);
	sleep(5);
	greetings_txt.visible = off;
	level_pan.visible = off;
	power_pan.visible = off;
	wait(2);
	level_load(credits_wmb);
	wait(1);

}

that's it, in the last three lines there is level_land and relative wait.
what's the problem?

Re: Strange problem [Re: Vyse220] #256821
03/19/09 08:37
03/19/09 08:37
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
Ur code structure is wrong. make use of functions to properly structure your code. Do something like this...

Code:

//define variables
...

//1 function or many functions
function gameplay()
{
 ...
}


function main()
{
 //set video_modes
 ...
 //load level
 level_load(my_level.wmb);
 wait(2);
 //call game functions
 gameplay();

 //if u want to load another level
 if (exit)
 { 
    level_load(credits.wmb);
 }
}



A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: Strange problem [Re: delinkx] #256831
03/19/09 09:17
03/19/09 09:17
Joined: Aug 2008
Posts: 49
V
Vyse220 Offline OP
Newbie
Vyse220  Offline OP
Newbie
V

Joined: Aug 2008
Posts: 49
so, i should exit the game before calling a new leve?
My structure is similar to that one, except this part
Code:
if (exit)
 { 
    level_load(credits.wmb);
 }

edit: the engine tell me that i can't use exit in the if.

Last edited by Vyse220; 03/19/09 09:25.
Re: Strange problem [Re: Vyse220] #257019
03/20/09 03:26
03/20/09 03:26
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
no.. the exit here i meant a variable.. like if ur user has chosen a menu 2 exit. instead u can put use this code:

i meant

if(user chooses exit)
{
then load the level
}


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: Strange problem [Re: delinkx] #257116
03/20/09 15:00
03/20/09 15:00
Joined: Aug 2008
Posts: 49
V
Vyse220 Offline OP
Newbie
Vyse220  Offline OP
Newbie
V

Joined: Aug 2008
Posts: 49
so it isn't a level load on_exit.
so the game structure is like the mine but i still got that error, how?

Re: Strange problem [Re: Vyse220] #257377
03/23/09 03:12
03/23/09 03:12
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
see this sample code below. it loads a level and after 10 seconds load another level.

Code:
function exit_event()
{
	level_load("test4.wmb");
}


function main()
{
var video_mode = 7; // 800x600 pixels
var video_depth = 32; // 32 bit mode

//load level
 level_load("particle.wmb");
 wait(2);
 //call game functions
 
 wait(-10);
 exit_event();
 
}



A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook

Gamestudio download | chip programmers | 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