2 registered members (Ayumi, 1 invisible),
584
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
OP
Expert
|
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?
/////////////////////////////////////////////////////////////////////////////////////////
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
Serious User
|
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.
|
|
|
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
OP
Expert
|
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
OP
Expert
|
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
Serious User
|
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.
|
|
|
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
OP
Expert
|
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: TerraSame]
#319404
04/14/10 18:50
04/14/10 18:50
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP
Expert
|
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: DLively]
#319452
04/15/10 02:26
04/15/10 02:26
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP
Expert
|
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."
|
|
|
|