|
2 registered members (TipmyPip, izorro),
556
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: ok, maybe i am going about this all wrong....
[Re: Blink]
#137409
06/22/07 20:52
06/22/07 20:52
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
No I did not say that you should attach your menu wdl file to your game levels. Alright step by step: Open WED and save the new level as "game.wmp" build it and attach a new script file with all the templates included you need. Open the game.wdl and include your menu script there too. Edit the main wdl file to load your menu. Now you just need a function which loads a particular level from the menu. Example: You have a button which performs the following function when it was clicked: Code:
function load_first_level() { hide_menu(); level_load("my_first_level.wmb"); wait(3); }
EDIT: You get that error "malfunction [bla] cannot find plbiped01" (or whatever) because you have NOT included the templates into that script file. Include all needed template files at the top of the script file which contains your main function (you just posted) and you should be fine.
Last edited by Xarthor; 06/22/07 20:55.
|
|
|
Re: ok, maybe i am going about this all wrong....
[Re: Xarthor]
#137410
06/22/07 21:05
06/22/07 21:05
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
ok, so i created the dummy level like you said. now, should i re-write the menu script and call it from the main of my dummy level? oh my, my brain is hurting,lol. i still dont get it,lol. can you explain again, i am kinda slow sometimes.
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: ok, maybe i am going about this all wrong....
[Re: Blink]
#137411
06/22/07 21:06
06/22/07 21:06
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
i didnt add it to an actual game level, i added it to a dummy level that loaded a game level. i guess that was a mistake.
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: ok, maybe i am going about this all wrong....
[Re: Blink]
#137412
06/22/07 21:43
06/22/07 21:43
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
Alright let me give you a simple step by step tutorial: Basic Project Set-Up 1. Folder set-upAt first we start to create a project folder which will contain all project related data later on. I choosed the name [Blinky]  (Note: I will write all folder names into [ ] signs]) Now lets go down a level and create some sub folders in our brand new project folder: [scripts] //which will contain almost all script files later on [levels] //this one will contain all level (wmp/wmb) files 2. Setting up the game's main scriptNow its time to set-up the one and only main script of the project. So lets open SED and a fresh new script and save it into our project folder. NOT into any subfolder of the project. I choosed the name: "game.wdl" Well the time has come to actually start writing some code into the "game.wdl": Code:
// project: Blinky // file: game.wdl
// =========================================================================== // PATHES
path "scripts"; path "levels";
// =========================================================================== // INCLUDES /* we will add some includes here later on */
// =========================================================================== // SETTINGS
var video_mode = 7; var video_screen = 2; var video_depth = 32;
// =========================================================================== // MAIN FUNCTION
function main() { wait(3); }
// =========================================================================== // END OF: game.wdl
Save the script and run it from SED, as you can see it does nothing but create a window into the "void" 3. Adding the menuNow its time to add the menu, to do so we open a new script file and save it into the project's subfolder [scripts]. I saved it as: "menu.wdl" And here comes it's content: Code:
// project: blinky // file: menu.wdl
/****************************** bmaps ******************************/ bmap exit_g_w=<exit_game_white.tga>; bmap exit_g = <exit_game.tga>; bmap gilogo=<gicdcvr2.bmp>; bmap main_tga = <gicdcvr2.bmp>; // another duplicate bmap movie1_tga = <new_game.tga>; bmap movie2_tga = <new_game_white.tga>; bmap pfeil = <pfeil.tga>; /****************************** strings ******************************/ string level_wmb = <nurfcut.wmb>; /****************************** function prototypes ******************************/ function exit_game(); function menue(); function play_a_movie(); panel pn_menue { bmap = gilogo; button=255,400,movie2_tga, movie1_tga, movie2_tga, start_game, null, null; button=255,475,exit_g_w,exit_g,exit_g_w,exit_game,null,null; flags= transparent,visible; layer=10; } /****************************** exit_game ******************************/ function exit_game() { // exit; sys_exit("Make love, then make war."); } /******************************/ function menue() { //while(levelstart==0){wait(1);} mouse_mode=2; mouse_map=pfeil; pn_menue.visible=on; pn_menue.alpha=85; while(pn_menue.visible==on){ mouse_pos.x=pointer.x; mouse_pos.y=pointer.y; wait(1);} } } ///////////////////////////////////////////////
string gimov_new_avi = <gimov_new.avi>; var aviHandle; ////////////////////////////////////////////////////////// // AVI Code - now add these lines before your level_load // call in your main function
string level_str = <nurfcut.WMB>;///Name of your level
function start_game() { mouse_mode = 0; pn_menue.visible = off; //switch off the menu aviHandle = media_play(gimov_new_avi,null,100); while(media_playing(aviHandle)) { if(key_space) { media_stop(aviHandle); } wait(1); } wait(1); // now load the level level_load(level_str); wait(3); }
Now save that "menu.wdl" and go back to the "game.wdl": Lets add some stuff there too. First we include the "menu.wdl" in our include section: Code:
// =========================================================================== // INCLUDES:
include <menu.wdl>
Now we have to call the function "menue();" from the main function: Code:
function main() { wait(3); //start the menu: menue(); }
So our complete "game.wdl" file now looks like this: Code:
// project: Blinky // file: game.wdl
// =========================================================================== // PATHES
path "scripts"; path "levels";
// =========================================================================== // INCLUDES
include <menu.wdl>;
// =========================================================================== // SETTINGS
var video_mode = 7; var video_screen = 2; var video_depth = 32;
// =========================================================================== // MAIN FUNCTION
function main() { wait(3); //start the menu: menue(); }
// =========================================================================== // END OF: game.wdl
Now the only thing you have to make sure is to copy your level file "nurfcut.wmb" to the subdirectory [levels] The last remaining step: Add all necessary script files to the include section of the "game.wdl" Hope this helps.
|
|
|
Re: ok, maybe i am going about this all wrong....
[Re: Xarthor]
#137413
06/23/07 12:59
06/23/07 12:59
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
thanks Xarthor, but I did exactly what you said, and i have the same problem, transparent menu, with the loaded level behind it, and my cursor doesnt work, so i cant play the movie. i solved the transparent menu by just making it visible instead of invisible, but how do i get the cursor back, and will it play my movie? i thought it was only supposed to load the menu from the dummy level, then wait until i press start to play the movie and load the level?
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: ok, maybe i am going about this all wrong....
[Re: Xarthor]
#137415
06/23/07 20:25
06/23/07 20:25
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
no, i didnt do that, i will look at it again, thanks.
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: ok, maybe i am going about this all wrong....
[Re: Blink]
#137416
06/23/07 22:32
06/23/07 22:32
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
ok Xarthor, i did everything you said, and the menu is perfect, but i ran into the same issue with the includes. the menu runs perfectly without the includes, but when i add them, the menu wont run at all, and i get a bunch of errors. am i forgetting something? this is the code without the includes. Code:
// project: Blinky // file: game.wdl // =========================================================================== //paths path "C:\\Program Files\\GStudio6\\template_6"; // Path to A6 templates directory path "C:\\Program Files\\GStudio6\\template_6\\code"; // Path to A6 template code subdirectory path "C:\\Program Files\\GStudio6\\template_6\\images"; // Path to A6 template image subdirectory path "C:\\Program Files\\GStudio6\\template_6\\sounds"; // Path to A6 template sound subdirectory path "C:\\Program Files\\GStudio6\\template_6\\models"; // Path to A6 template model subdirectory ///////////////////////////////////////////////////////////////// // Included files include <numen622.wdl>;
// =========================================================================== // SETTINGS var video_mode = 7; var video_screen = 2; var video_depth = 32; // =========================================================================== // MAIN FUNCTION function main() { wait(3); //start the menu: menue(); } // =========================================================================== // END OF: game.wdl
|
|
|
Re: ok, maybe i am going about this all wrong....
[Re: Blink]
#137418
06/24/07 05:11
06/24/07 05:11
|
Joined: May 2005
Posts: 819 U.S.
Why_Do_I_Die
Warned
|
Warned
Joined: May 2005
Posts: 819
U.S.
|
I'm not sure about whats wrong , i didnt read the whole thing , but i would sujjest commenting out all the includes, then uncomment one , save , and run the game , and keep doing that for all of them till you run into the one causing you the problem. Also , take a look at the errors , usually they will point you into the direction of whats wrong , it could be many things causing the errors.
|
|
|
|