2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Menu Script
#74968
05/21/06 10:14
05/21/06 10:14
|
Joined: Mar 2006
Posts: 32 Deutschland, Grevenbroich
Shifter
OP
Newbie
|
OP
Newbie
Joined: Mar 2006
Posts: 32
Deutschland, Grevenbroich
|
Hallo zusammen Ich habe mir heute ein Menü Tut. runtergeladen um mir halt ein Menü erstellen zu können (logisch oder?! *g*). Das Tut. war auf Englisch aber ich habe versucht alles genau so zu machen wie es vorgegeben wasr. Jetzt habe ich bereits dreimal alles Kontroliert aber keinen fehler finden können, trotzdem läuft es nicht! Vieleicht weiß ja hier einer weiter... Hier mal das Skript:
/////////////////////////////////////////////////////////////////////////////////// // A5 main wdl //////////////////////////////////////////////////////////////////////////// // Files to over-ride: // * logodark.bmp - the engine logo, include your game title // * horizon.pcx - A horizon map displayed over the sky and cloud maps //////////////////////////////////////////////////////////////////////////// // The PATH keyword gives directories where game files can be found, // relative to the level directory path "C:\\Programme\\GStudio\\template"; // Path to WDL templates subdirectory
//////////////////////////////////////////////////////////////////////////// // The INCLUDE keyword can be used to include further WDL files, // like those in the TEMPLATE subdirectory, with prefabricated actions include <movement.wdl>; include <messages.wdl>; include <menu.wdl>; // must be inserted before doors and weapons include <particle.wdl>; // remove when you need no particles include <doors.wdl>; // remove when you need no doors include <actors.wdl>; // remove when you need no actors include <weapons.wdl>; // remove when you need no weapons include <war.wdl>; // remove when you need no fighting //include <venture.wdl>; // include when doing an adventure include <lflare.wdl>; // remove when you need no lens flares include <ultima_panel.wdl>;
//////////////////////////////////////////////////////////////////////////// // The engine starts in the resolution given by the follwing vars. var video_mode = 6; // screen size 640x480 var video_depth = 16; // 16 bit colour D3D mode
///////////////////////////////////////////////////////////////// // Strings and filenames // change this string to your own starting mission message. string mission_str = "Fight your way through the level. Press [F1] for help"; string level_str = <Alfatest.WMB>; // give file names in angular brackets
///////////////////////////////////////////////////////////////// // define a splash screen with the required A4/A5 logo bmap splashmap = <logodark.pcx>; // the default logo in templates panel splashscreen { bmap = splashmap; flags = refresh,d3d; }
//////////////////////////////////////////////////////////////////////////// // The following script controls the sky sky horizon_sky { // A backdrop texture's horizontal size must be a power of 2; // the vertical size does not matter type = <horizon.pcx>; tilt = -10; flags = scene,overlay,visible; layer = 3; }
///////////////////////////////////////////////////////////////// // The main() function is started at game start function main() { // set some common flags and variables // warn_level = 2; // announce bad texture sizes and bad wdl code tex_share = on; // map entities share their textures
// center the splash screen for non-640x480 resolutions, and display it splashscreen.pos_x = (screen_size.x - bmap_width(splashmap))/2; splashscreen.pos_y = (screen_size.y - bmap_height(splashmap))/2; splashscreen.visible = on; // wait 3 frames (for triple buffering) until it is flipped to the foreground wait(3); splashscreen. visible = off bmap_purge(spashmap); // remove splashscreen from video memory main_back(); } //now this funktion will be called from the menu panel funktion main_strt() {
// now load the level level_load(level_str); // freeze the game freeze_mode = 1; wait(1); panels_off();//added for"ultima_panel.wdl" // load some global variables, like sound volume //load_status();//use musik_level & sound_level vars // display the initial message msg_show(mission_str,10); // initialize lens flares when edition supports flares ifdef CAPS_FLARE; lensflare_start(); endif; // use the new 3rd person camera move_view_cap = 1; // un-freeze the game freeze_mode = 0; // client_move(); // for a possible multiplayer game // call further functions here... }
///////////////////////////////////////////////////////////////// // The following definitions are for the pro edition window composer // to define the start and exit window of the application. WINDOW WINSTART { TITLE "3D GameStudio"; SIZE 480,320; MODE IMAGE; //STANDARD; BG_COLOR RGB(240,240,240); FRAME FTYP1,0,0,480,320; // BUTTON BUTTON_START,SYS_DEFAULT,"Start",400,288,72,24; BUTTON BUTTON_QUIT,SYS_DEFAULT,"Abort",400,288,72,24; TEXT_STDOUT "Arial",RGB(0,0,0),10,10,460,280; }
/* no exit window at all.. WINDOW WINEND { TITLE "Finished"; SIZE 540,320; MODE STANDARD; BG_COLOR RGB(0,0,0); TEXT_STDOUT "",RGB(255,40,40),10,20,520,270;
SET FONT "",RGB(0,255,255); TEXT "Any key to exit",10,270; }*/
///////////////////////////////////////////////////////////////// //INCLUDE <debug.wdl>;
|
|
|
Re: Menu Script
[Re: Shifter]
#74970
05/21/06 15:52
05/21/06 15:52
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
Es wäre nett von dir zu schreiben WELCHES tut du gemacht hast, und wo man das finden kann. Desweiteren was funktioniert nicht? Wenn eine error kommt: error posten Kommt kein error: was sollte passieren und passiert nicht und wenn etwas komisch passiert inwieweit es von dem eigentlich abweicht.
danke.
EDIT: Die function die nicht zu funktionieren scheint hast du auch nicht gepostet "function main_back()" wäre was mich interessiert der rest sieht ziemlich normal aus.
Last edited by Thunder; 05/21/06 15:54.
|
|
|
Re: Menu Script
[Re: Shifter]
#74974
05/22/06 06:12
05/22/06 06:12
|
Joined: Aug 2003
Posts: 7,439 Red Dwarf
Michael_Schwarz
Senior Expert
|
Senior Expert
Joined: Aug 2003
Posts: 7,439
Red Dwarf
|
du hast geschrieben: funktion main_strt() sollte wohl eher fun ction main_strt() sein
"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
|
|
|
Re: Menu Script
[Re: Shifter]
#74976
05/22/06 13:51
05/22/06 13:51
|
Joined: Aug 2003
Posts: 7,439 Red Dwarf
Michael_Schwarz
Senior Expert
|
Senior Expert
Joined: Aug 2003
Posts: 7,439
Red Dwarf
|
du kannst keine bmap mehrmals den gleichen namen geben, du müsstest d.h. den BMAPs verschiedene namen geben:
option_map1 option_map2 option_map3 etc...
"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
|
|
|
Re: Menu Script
[Re: Michael_Schwarz]
#74977
05/22/06 14:58
05/22/06 14:58
|
Joined: Mar 2006
Posts: 32 Deutschland, Grevenbroich
Shifter
OP
Newbie
|
OP
Newbie
Joined: Mar 2006
Posts: 32
Deutschland, Grevenbroich
|
Hallo habe ich auch nicht, die Fehlermeldung ist die selbe jedoch bezogen auf jeweils verschiedenen Dateien (optin_map, main_map usw.)
//////////////////////// //FUNCTION DEFINITIONS// //////////////////////// function scrollCredits(); // forward declaration
////////////////////// //DEFINE DEFINITIONS// //////////////////////
//define and initialize your defines for the text for the credit menu //DO NOT MODIFY define TEXT_PANEL_OFFSET_X, 80; // offset for x pos of visible text define TEXT_PANEL_OFFSET_Y, 230; // offset for y position of visible text define SCROLL_SPEED, 1; // scroll faster == bigger number define NUM_CREDIT_STRINGS, 31; // how many strings in the TEXT?
define vid_tog_low, 6; define vid_tog_high, 7;
var set_vid; ////////////////////// //BITMAP DEFINITIONS// //////////////////////
//define your bmp for the main menu //DO NOT MODIFY bmap main_map <mainmenu.bmp>;
//define your bmp for the option menu //DO NOT MODIFY bmap option_map <optionmenu.bmp>;
//define your bmp for the CREDIT menu //DO NOT MODIFY bmap credit_bmp <creditmenu.bmp>;
//define your bmp for the button off //DO NOT MODIFY bmap but_off_map <butoff.bmp>;
//define your bmp for the button on //DO NOT MODIFY bmap but_on_map <butover.bmp>;
//define your bmp for fade //DO NOT MODIFY bmap black_map <blk.bmp>;
///////////////////// //SOUND DEFINITIONS// /////////////////////
//define your sound for the main menu //DO NOT MODIFY music main_sound <Menusound.mid>;
//define your sound for the main menu //DO NOT MODIFY music credit_sound <Creditsound.mid>;
//define your sound for the main menu //DO NOT MODIFY sound but_sound <Butsound.wav>;
//////////////////////// //VARIABLE DEFINITIONS// ////////////////////////
//define your var to stop and start the main menu music //DO NOT MODIFY var main_sound_handle;
//define your var to stop and start the credit menu music //DO NOT MODIFY var credit_sound_handle;
//define your var to control the sound level //DO NOT MODIFY var sound_level = 50;
//define your var to control the music level //DO NOT MODIFY var music_level = 30;
//define your var to control the videos res //DO NOT MODIFY var vid_mode = 6;
//define your var to control the panel fades //DO NOT MODIFY var fade_timer;
//define your var to control the game_state //DO NOT MODIFY var g_state = 0;
//define your var to control the text scrolling //DO NOT MODIFY var credits_scrolling = off;
////////////////////////////////// //CREDIT STRING FONT DEFINITIONS// ////////////////////////////////// font credit_font, <Impact8.bmp>, 10, 15; // height is 15
/////////////////////////// //CREDIT TEXT DEFINITIONS// ///////////////////////////
//define your text object for your credit string // DO NOT MODIFY text credit_txt { layer 3; pos_x = 0; // we'll set it with code pos_y = 0; // we'll set it with code font = standard_font; size_y = 150; // char_height * visible rows (15 * 10) offset_y = 0; strings = NUM_CREDIT_STRINGS; string = "*********************************************************************************"; string = "Realspawn and Raiden Present: The Ultimate Complete Menu WDL"; string = "*********************************************************************************"; string = " "; string = "Concept and Idea: Realspawn"; string = " "; string = "Images: Realspawn"; string = " "; string = "Sounds: Realspawn"; string = " "; string = "Start Midi: Loops Of Fury by Chemical Brothers"; string = " "; string = "Options Midi: Snadstorm by Darude"; string = " "; string = "Programming: Raiden"; string = " "; string = " "; string = " "; string = "Special Credit: Neonlite, for his contribution of the scrolling text code"; string = " "; string = "**********************************************************************************"; string = " "; string = "This menu system has been brought to you by: U.L.S. Leaders in gaming software!!!"; string = " "; string = "**********************************************************************************"; string = " "; string = " "; string = " "; string = ""; string = " "; string = ""; flags = d3d; } ///////////////////// //PANEL DEFINITIONS// /////////////////////
//define your main startup panel //DO NOT MODIFY panel main_panel { bmap = main_map; layer = 1; flags = refresh,d3d; } //define your main buttons startup panel //DO NOT MODIFY panel main_buttons_panel { layer = 2; button = 10,180,but_on_map,but_off_map,but_on_map,main_strt,null,over_sound; button = 10,245,but_on_map,but_off_map,but_on_map,options,null,over_sound; button = 10,310,but_on_map,but_off_map,but_on_map,quit,null,over_sound; button = 10,375,but_on_map,but_off_map,but_on_map,toggle_credits,null,over_sound; flags = refresh,overlay,d3d;//overlay needed for buttons }
//define your option panel //DO NOT MODIFY panel option_panel { bmap = option_map; layer = 1; flags = refresh,d3d; } //define your option buttons panel //DO NOT MODIFY panel option_buttons_panel { layer = 2; hslider = 270,175,300,but_on_map,0,100,sound_level; hslider = 270,240,300,but_on_map,0,100,music_level; hslider = 270,305,300,but_on_map,vid_tog_low,vid_tog_high,vid_mode; button = 10,375,but_on_map,but_off_map,but_on_map,main_back,null,over_sound; flags = refresh,overlay,d3d;//overlay needed for buttons }
//define your credit panel //DO NOT MODIFY panel credit_pan { layer 1; pos_x = 0; // we'll set it with code pos_y = 0; // we'll set it with code bmap credit_bmp; flags = refresh, d3d; }
//define your credit buttons panel //DO NOT MODIFY panel credit_buttons_panel { layer = 2; button = 0,410,but_on_map,but_off_map,but_on_map,main_back,null,over_sound; flags = refresh,overlay,d3d;//overlay needed for buttons }
//define your black panel //DO NOT MODIFY panel black_panel { bmap = black_map; layer = 4; flags = refresh,transparent,d3d; } string v[4]; text shw_vid_mode { font = standard_font; layer = 9; pos_x = 50; pos_y = 50; string = v; flags = visible; }
/////////////////// //END DEFINITIONS// ///////////////////
/*****************************************************************************/
/////////////////// //PANEL FUNCTIONS// ///////////////////
//function for sound to play when mouse is over button //DO NOT MODIFY function over_sound() { snd_play(but_sound,sound_level,0); }
//function to quit from main menu //DO NOT MODIFY function quit() { exit; }
//function to shutdown panels and sound from main_start() //DO NOT MODIFY function panels_off() { g_state = 1;//break the loop for music volume and video resolution switch_video(vid_mode,0,0); black_panel.visible = off; credit_pan.visible = off; credit_txt.visible = off; credits_scrolling = off; // stop scrolling credits function credit_buttons_panel.visible = off; option_panel.visible = off; option_buttons_panel.visible = off; main_panel.visible = off; main_buttons_panel.visible = off; //snd_stop(main_sound_handle); //snd_stop(credit_sound_handle); }
function adjust_mid_vol() { while(g_state == 0) { midi_vol = music_level; if(vid_mode <= 6.5) { vid_mode = video_mode; } if(vid_mode >= 6.5) { vid_mode = video_mode + 1; } wait(1); } } // play a song if volume was set at beginning function start_song() { midi_vol = music_level; //wait(4); // wait until LOAD_INFO has loaded the last volume setting if(midi_vol > 0) { play_song_once(main_sound,music_level); } } //play a new song for the options function option_song() { midi_vol = music_level; //wait(4); // wait until LOAD_INFO has loaded the last volume setting if(midi_vol > 0) { play_song_once(credit_sound,music_level); } } //kill music for switch back between main and credit function kill_music() { midi_vol = 0; } //function to switch to main panel this will also start from main //DO NOT MODIFY function main_back() { kill_music(); start_song(); adjust_mid_vol(); //set up fade in fade_timer = 0; black_panel.alpha = 0; black_panel.visible = on; while(fade_timer < 100) { black_panel.alpha += 1; fade_timer += 1; wait(1); } fade_timer = 100; black_panel.alpha = 100; credit_pan.visible = off; credit_txt.visible = off; credits_scrolling = off; // stop scrolling credits function credit_buttons_panel.visible = off; option_panel.visible = off; option_buttons_panel.visible = off; waitt(16);//1 secs black main_panel.visible = on; main_buttons_panel.visible = on; //snd_stop(main_sound_handle); //snd_stop(credit_sound_handle); //if(midi_vol > 0) { play_song_once(main_sound,music_level); } //set up fade out while(fade_timer > 0) { black_panel.alpha -= 0.5; fade_timer -= 0.5; wait(1); } black_panel.alpha = 0; black_panel.visible = off; }
//function to switch to options panel //DO NOT MODIFY function options() { //set up fade in fade_timer = 0; black_panel.alpha = 0; black_panel.visible = on; while(fade_timer < 100) { black_panel.alpha += 1; fade_timer += 1; wait(1); } fade_timer = 100; black_panel.alpha = 100; main_panel.visible = off; main_buttons_panel.visible = off; waitt(16);//2 secs black option_panel.visible = on; option_buttons_panel.visible = on; //set up fade out while(fade_timer > 0) { black_panel.alpha -= 0.5; fade_timer -= 0.5; wait(1); } black_panel.alpha = 0; black_panel.visible = off; }
//function to switch to credit panel //DO NOT MODIFY function toggle_credits() { kill_music(); option_song(); adjust_mid_vol(); if(credit_pan.visible == off) { // turn it on! // center the panel to the screen credit_pan.pos_x = (screen_size.x - bmap_width(credit_bmp)) / 2; credit_pan.pos_y = (screen_size.y - bmap_height(credit_bmp)) / 2; // position TEXT in relation to panel credit_txt.pos_x = credit_pan.pos_x + TEXT_PANEL_OFFSET_X; credit_txt.pos_y = credit_pan.pos_y + TEXT_PANEL_OFFSET_Y; //set up fade in fade_timer = 0; black_panel.alpha = 0; black_panel.visible = on; while(fade_timer < 100) { black_panel.alpha += 1; fade_timer += 1; wait(1); } fade_timer = 100; black_panel.alpha = 100; main_panel.visible = off; main_buttons_panel.visible = off; option_panel.visible = off; option_buttons_panel.visible = off; waitt(16);//2 secs black // turn them on credit_pan.visible = on; credit_buttons_panel.visible = on; credit_txt.visible = on; // reset scrolling credit_txt.offset_y = 0; //snd_stop(credit_sound_handle); //snd_stop(main_sound_handle); //if(midi_vol > 0) { play_song_once(credit_sound,music_level); } //set up fade out while(fade_timer > 0) { black_panel.alpha -= 0.5; fade_timer -= 0.5; wait(1); } black_panel.alpha = 0; black_panel.visible = off; // scroll the TEXT scrollCredits(); } else { // turn them off credit_pan.visible = off; credit_txt.visible = off; credits_scrolling = off; // stop scrolling credits function } }
//function to scroll text in credit panel //DO NOT MODIFY function scrollCredits() { exclusive_global; waitt(48); // 3 seconds before scrolling credits_scrolling = on; while(credits_scrolling == on) { credit_txt.offset_y += time * SCROLL_SPEED; if(credit_txt.offset_y >= credit_txt.char_y * NUM_CREDIT_STRINGS) { waitt(16); // 1 second before showing beginning text again credit_txt.offset_y = 0; // restart scrolling waitt(48); // 3 seconds before scrolling } wait(1); } }
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|