Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
menu and level load issue... #319315
04/14/10 00:44
04/14/10 00:44
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
ok, i have this menu. when you press start, a movie plays and the first level is supposed to load. it does all of that but there are problems and i dont know how to solve.

issue 1. the menu panel is still shown when the level loads.
issue 2. the included scripts to start playing the game are not present. they are included on the levels themselves, but when the first level is loaded, i get "action not found" errors. what am i doing wrong?

Code:
/////////////////////////////////////////////////////////////////////////////////////////
var video_mode=7;
var video_screen=1;




bmap panel_pcx = <mosrn3.bmp>;
////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////////


panel energy_pan // background panel
{
	bmap = panel_pcx;
	layer = 15;	
	pos_x = 1;
	pos_y = 30;
	flags = d3d, overlay, refresh, visible;
}

entity energy_sprite 
{ 
	type = <mo+10.pcx>; 
	layer = 85; 
	view = camera; 
	x = 450; 
	y = 14; 
	z = 44; 
	flags = visible, flare, bright;
} 

function init_animsprite() 
{ 
	while (1) 
	{ 
		energy_sprite.frame += 0.1 * time_step; 
		if (energy_sprite.frame > 10) 
       {
        energy_sprite.frame =0; // loop
       }
		wait (1); 
	} 
}

////////////////////////////////

var effectvol = 50;
var musicvol = 50;

SOUND wave = "horr1.wav";
var wavehandle;


bmap start_w=<menustr2.bmp>;
bmap start_o=<menustr1.bmp>;
bmap pfeil=<handcur.bmp>;
bmap exit_o=<menuquit.bmp>;
bmap exit_w=<menuquit2.bmp>;

string lvl01 ="samoffice.wmb";
string sceneext =".wmv";
string scene01 ="motel66mov.wmv";

string buttonext =".wav";
string buttonsnd ="button.wav";

function start_game();
function exit_game();









panel pn_menue

{ 
  
  button=300,400,start_w,start_o,start_w,start_game,null,null;
  button=300,480,exit_w,exit_o,exit_w,exit_game,null,null;
  //if(freeze_mode==1){button=650,430,back_white,back_blue,back_white,game_menue,null,null;}
  flags = overlay, refresh, visible;
  layer=300;
  
}



function main()
{
  init_animsprite(); 
level_load("dummylv.wmb");   

Menue();
wavehandle = snd_loop(wave,30,0);
wait(-120); 

}
	

function menue()
  
  {
  	
  	//while(levelstart==0){wait(1);}
  	mouse_mode=2;
  	mouse_map=pfeil;
  	
  	while(pn_menue.visible==on){
  	mouse_pos.x = mouse_cursor.x;
  	mouse_pos.y = mouse_cursor.y;
   wait(1);}
  }
  
function start_game()

{ 
wait(1);
media_play(buttonsnd, null, 50);
media_play(scene01, null, 100);
wait(-120);
level_load("samoffice.wmb");      // load level nuhvn.wmb 
 
wait(1);

}


function exit_game()

{ 
// your exit game stuff here
media_play("button.wav", null, 50);
exit;
}

}




My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: menu and level load issue... [Re: Blink] #319317
04/14/10 01:44
04/14/10 01:44
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
function init_animsprite()
{
while (1)
{
energy_sprite.frame += 0.1 * time_step;
if (energy_sprite.frame > 10)
{
energy_sprite.frame =0; // loop
}
wait (1);
}
}


for that
--------------------
try this (not the problem. but faster for the engine):

function init_animsprite()
{
while (1)
{
energy_sprite.frame += 0.1 * time_step;
energy_sprite.frame=cycle(energy_sprite.frame,0,10);

}
}

---------------------------------------------------


I dont see an action in your script.. if the engine can't find the action, thats why..


does your second script have the menu panel defined, again?
using more then 1 script can really cause issues, if your not organized properly. (not that im saying your unorganized) - just saying its harder to do, if you dont know what your doing...

Last edited by DevoN; 04/14/10 01:50.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: menu and level load issue... [Re: DLively] #319320
04/14/10 02:28
04/14/10 02:28
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
you forgot the wait(1);, your way caused an endless loop error. the script is attached to a dummy level. i added the scripts to the dummy level because it is technically the first level of the game, but no luck. i tried to include them with the menu script, but i got a world of errors. now i am stuck.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: menu and level load issue... [Re: Blink] #319321
04/14/10 02:32
04/14/10 02:32
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
the second script that loads and plays the movie is right there in the code i posted. there has to be a way to tell my code to either remove the menu panel or deactivate and make it invisible. i am lost. i am having other issues that i dont understand, after this is solved i will probably be asking for help again.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: menu and level load issue... [Re: Blink] #319351
04/14/10 12:47
04/14/10 12:47
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
k, well the wait(1); I just did that really quick..
EDIT: I also, put my wait(1) like this.. while(1){wait(1);
...
}
to keep it tidy.

If your panel is called in the first script, and is only set to invisible, then it is still active - and your second script doesnt know what it is.



Last edited by DevoN; 04/14/10 12:51.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: menu and level load issue... [Re: DLively] #319358
04/14/10 13:42
04/14/10 13:42
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
ok, i solved the first issue with the menu and panels, it was easy actually. after the level load, i added this.

pn_menue.visible=off;
energy_pan.visible=off;
mouse_map=off;
energy_sprite.visible=off;

now everything menu related is gone. but the first level still hangs, and nothing has scripts, any thoughts?


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: menu and level load issue... [Re: Blink] #319387
04/14/10 17:37
04/14/10 17:37
Joined: May 2009
Posts: 439
T
TerraSame Offline
Senior Member
TerraSame  Offline
Senior Member
T

Joined: May 2009
Posts: 439
Just a note...
Loading a level and playing a movie is tough on the engine/PC..
Of course it depends on how big your level is. Usually the level load causes the movie to run jerky... Try to either play the movie with a progress bar during the load (the best. I think)-or- Load the level then play the movie...

Re: menu and level load issue... [Re: TerraSame] #319404
04/14/10 18:50
04/14/10 18:50
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
the movie isnt the issue. it loading the level itself. the scripts that are included wont load when the level does, so i get actions that arent loaded, so the level loads and none of the entities have actions.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: menu and level load issue... [Re: Blink] #319435
04/14/10 21:09
04/14/10 21:09
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
try putting your include files at the bottom of your script.

Did you make sure to attach the script to the level?


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: menu and level load issue... [Re: DLively] #319452
04/15/10 02:26
04/15/10 02:26
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
yes, i did that. every script is on every level, even the "dummy" levelm just in case. the includes are not in the menu script because there is no level, just a wdl. the dummy level is technically the 1st level right?


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Page 1 of 4 1 2 3 4

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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