menu and level load issue...

Posted By: Blink

menu and level load issue... - 04/14/10 00:44

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;
}

}


Posted By: DLively

Re: menu and level load issue... - 04/14/10 01:44

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...
Posted By: Blink

Re: menu and level load issue... - 04/14/10 02:28

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.
Posted By: Blink

Re: menu and level load issue... - 04/14/10 02:32

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.
Posted By: DLively

Re: menu and level load issue... - 04/14/10 12:47

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.


Posted By: Blink

Re: menu and level load issue... - 04/14/10 13:42

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?
Posted By: TerraSame

Re: menu and level load issue... - 04/14/10 17:37

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...
Posted By: Blink

Re: menu and level load issue... - 04/14/10 18:50

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.
Posted By: DLively

Re: menu and level load issue... - 04/14/10 21:09

try putting your include files at the bottom of your script.

Did you make sure to attach the script to the level?
Posted By: Blink

Re: menu and level load issue... - 04/15/10 02:26

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?
Posted By: DLively

Re: menu and level load issue... - 04/15/10 02:30

technically your first level is your first level.

your menu is your menu.


your script can contain both - But I see how you've got it set up - so your menu script will be run on your menu level - so when you load your first level, it loads another script, which is where all your actions should be.

I can't see your code or your project so its tough to say where your problem is.
Posted By: Blink

Re: menu and level load issue... - 04/15/10 03:01

well, the first level is packed with all of the includes, so i dont understand when it loads, why they arent there.
Posted By: Blink

Re: menu and level load issue... - 04/15/10 03:08

if anyone has any suggestions i would be greatful. this is the last issue so i can finally complete my project.
Posted By: Blink

Re: menu and level load issue... - 04/15/10 22:09

maybe someone has a solution? i tried modifying supermenu from AU, i got errors from emre's template, and i tried using the menu's from various AUM's, unfortunately, i kept having issues. i just need a simple menu so when you press start, it plays a movie, then loads the first level. i have the menu and it plays a movie, but when it goes to load the level, certain scripts are missing. i hope this is clear. i posted the code earlier. i can really use a hand.
Posted By: Ganderoleg

Re: menu and level load issue... - 04/15/10 22:58

This is just a wild guess but here is the problem that I had with my player actions:

When exiting from one & entering into the second level, at the very beginning(loading) of the second level, my player had to be placed near the doors that he has just entered, and the level had three doors. So the player xyz had to be determined by the xyz of the doors BUT the door mdl's were placed in WED after the player mdl so the engine always issued an error message that he can't find the doors xyz & therefore can't place the player to the wanted position. Once I deleted the player mdl file from WED and re-loaded him to be after the door mdl files everything worked out.

If I told you something that you already know: sorry crazy Just trying to help.
Posted By: Blink

Re: menu and level load issue... - 04/16/10 02:09

Thanks, no my problem must be with my menu somehow. it works the way it should, and even plays the movie fine, but when its time to load the level i have an issue. none of the actions are there when the level actually loads. maybe it how i am loading the level. i am using the templates and original code for the menu. maybe i have to load the level the way the templates do? i dont know, its driving me crazy.
Posted By: DLively

Re: menu and level load issue... - 04/16/10 02:30

perhaps the names of the actions have been changed in level 1's script, so if player_act is changed to player_acts in the script, but is still player_act in WED, it wont recognize what action you are trying to tell it to use.
Posted By: Blink

Re: menu and level load issue... - 04/16/10 02:47

ok...here is the solution. i discovered it after i read my last post. i had to set up my menu just like the dummy level. i need to set a path so the scripts will be found, i had to include all of the scripts needed, and i had to set up the level string the same way. it works perfectly!
Posted By: DLively

Re: menu and level load issue... - 04/16/10 12:31

good to hear you finally got it solved, Blink.
Posted By: Blink

Re: menu and level load issue... - 04/16/10 13:02

yes, i had to step away and clear my head, but i got it.
Posted By: TerraSame

Re: menu and level load issue... - 04/19/10 17:58

I just read all the new posts...
I definatly understand the "Driring me Crazy" comment...
I'm lov'in it that you got it working finally....
Great!
Now it's back to my flippin' code problems...
G'd Day!
Posted By: Blink

Re: menu and level load issue... - 04/19/10 23:38

thanks for confidence, i ran into yet another issue! maybe its not meant for me to finish this game!
Posted By: TerraSame

Re: menu and level load issue... - 04/20/10 04:40

Do not stop...
Must finish what you started...
Proceed forward...
The shortest distance is a straight line...
Don't dieviate...
Keep a stiff upper lip...
You'll git-er-done!
Posted By: Blink

Re: menu and level load issue... - 04/20/10 20:16

i hope so.....query, does anybody know how to finish a game? i have a menu, all the levels are loaded, but i am getting an error when i publish from SED. ANYONE....BUELLER...????
Posted By: TerraSame

Re: menu and level load issue... - 04/21/10 00:28

I don't get it!
What's the problem now???
You said it was working perfectly.
Give us more detail...
Then maybe someone here can help!
Have you resourced each level seperatly into multiple .wrs files?
Explain the situation with details...
Posted By: Blink

Re: menu and level load issue... - 04/21/10 06:26

now that i have the menu complete, all levels complete and linked. now when i tried to publish, the main script(menu)wasnt there, so when i tried to run the compiled level.cd, it had an error. what am i doing wrong?
Posted By: Blink

Re: menu and level load issue... - 04/21/10 06:27

keep in mind, i am using A6 Commercial.
Posted By: TerraSame

Re: menu and level load issue... - 04/21/10 12:10

OK...
So your publish proceedure only allows you to create a new folder that has all the files in it...
Simply copy your missing file into the new subfolder...
I suppose you tried that...

Tell me... are you doing this work with all your files located in the 3dgs "Work" folder or do you have a seperate folder located elsewhere?
Sometimes all your files need to be in the "Work" folder otherwise the publish process screws up...

When you publish... do you get any error pop-ups?

Try this maybe...
Go into the 3dgs folder and change the "Work" folder name then create a new "Work" folder...
Then copy all your files into the new folder...
Then try publishing...
Posted By: Blink

Re: menu and level load issue... - 04/21/10 21:01

i did that already, got an error. i have a seperate folder located elsewhere, but i have published there before and didnt have any issues. when i publish, one of my files cant be found, but its not the file that the error said is missing. update, i fpound the file that was missing, and extracted it from the code, so i no longer get the error. now the problem is when i run the level from the level.cd folder, the wdl is not found.
Posted By: Blink

Re: menu and level load issue... - 04/21/10 21:04

ok, solved the problem. here was the solution.

i was publishing from SED, but the publish didnt include the wdl i published from...odd. but when i published from WED, no problem, it ran and everything. strange also, i was forced to create a wmb for the menu code, because it would run without a wmb of that script. thanks Terrasame for looking.
Posted By: TerraSame

Re: menu and level load issue... - 04/21/10 21:55

Thank God! Or whoever you believe in!
I never publish from SED...
I hope you are on the right track and all goes well...
I hope to see pics of your game in the Projects forum...
G'd Luck...
Posted By: Blink

Re: menu and level load issue... - 04/22/10 00:13

God is good, now with His grace, maybe I can finish.
© 2024 lite-C Forums