View Full Version : Menu Modding - Error Log
serthy
21st April 2014, 09:25
Hello, 
is there a way to test menus by not connecting to my server?
Currently modify my menus, start a dedicated homeserver, connect and in the clients console the menu errors will show up. However this is really time consuming. Isnt there a way to show the errors in the logfile of the server? The standard menu errors (quickmessage) are shown there too.
I tried all combinations of developer/script_developer/logfile, but cannot get it to work.
Im just curious, because Tally mentioned something like that here:
http://killtube.org/showthread.php?1082-CoD2-create-functions-in-menu-files!
I've already contacted him, unfortunately he isnt into cod modding at this time and cant tell me his setup un detail. Anyway, thanks Tally for your quick answer!
IzNoGoD
21st April 2014, 09:33
What happens when you put it in the ui_mp folder instead of the scriptmenus folder?
serthy
26th April 2014, 11:11
Did some testings:
 in cod2/ui_mp/ingame.txt i added the entry loadMenu { "ui_mp/scriptmenus/testmenu.menu" }
 now its shows a lot of errors, however these aren't correct. it complains about every entry in the menuDef:
Loading 'ui_mp/scriptmenus/testmenu.menu'...
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 13: unknown menu keyword name
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 14: unknown menu keyword testmenu
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 14: unknown menu keyword rect
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 14: unknown menu keyword 0
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 14: unknown menu keyword 0
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 14: unknown menu keyword 640
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 14: unknown menu keyword 480
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 15: unknown menu keyword focuscolor
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 15: unknown menu keyword .98
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 15: unknown menu keyword .827
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 15: unknown menu keyword .58
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 15: unknown menu keyword 1
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 16: unknown menu keyword style
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 16: unknown menu keyword 0
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 17: unknown menu keyword blurWorld
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 17: unknown menu keyword 5.0
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 18: unknown menu keyword onEsc
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 19: unknown menu keyword {
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 20: unknown menu keyword close
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 20: unknown menu keyword testmenu
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 20: unknown menu keyword ;
Menu load error: ui_mp/scriptmenus/testmenu.menu, line 21: menu has no name
 with my testmenu.menu as follow:
#include "ui_mp/menudef.h"
#define ORIGIN_TITLE			80 64
#define ORIGIN_AUTOASSIGN		80 80
#define ORIGIN_ALLIES			80 100
#define ORIGIN_AXIS			80 120
#define ORIGIN_SPECTATOR		80 140
#define ORIGIN_BACK			80 165
{
	menuDef
	{
		name			testmenu
		rect			0 0 640 480
		focuscolor		GLOBAL_FOCUSED_COLOR
		style			WINDOW_STYLE_EMPTY
		blurWorld		5.0
		onEsc
		{
			close testmenu;
		}
		onClose
		{
		}
		itemDef 
		{
			name			"button_back"
			visible		1
			rect			0 0 128 24
			origin			ORIGIN_BACK
			forecolor		GLOBAL_UNFOCUSED_COLOR
			type			ITEM_TYPE_BUTTON
			text			"@Back"
			textfont		UI_FONT_NORMAL
			textscale		0.33
			textaligny		20
			textalignx		128
			textalign		ITEM_ALIGN_RIGHT
			action
			{
				play "mouse_click";
				close testmenu;
				open ingame;
			}
			onFocus
			{
				play "mouse_over";
			}
		}
	}
}
 when i add some non existent menus the console doesnt complain:
{	
 	loadMenu { "ui_mp/ingame.menu" } // THERE IS NO UI_MP/INGAME.MENU!!!!!!!!!!!!!!
	loadMenu { "ui_mp/ingame_controls.menu" }
	loadMenu { "ui_mp/ingame_options.menu" }		// loadMenu { "ui_mp/ingame_options.menu" }
	loadMenu { "ui_mp/ingame_system.menu" }		// loadMenu { "ui_mp/ingame_system.menu" }
	loadMenu { "ui_mp/ingame_leave.menu" }
	loadMenu { "ui_mp/ingame_callvote.menu" }
	loadMenu { "ui_mp/wm_quickmessage.menu" }
	loadMenu { "ui_mp/scriptmenus/testmenu.menu" }
	loadMenu { "ui_mp/scriptmenus/ingame.menu" } // INGAME.MENU IS IN SCRIPTMENUS SUBDIR!!!!! NOW CONSOLE COMPLAINS THE SAME AS IN MY TESTMENU
 	loadMenu { "ui_mp/I_DO_NOT_EXIST.menu" }
}
Menu load error: ui_mp/scriptmenus/ingame.menu, line 21: menu has no name
	Loading 'ui_mp/I_DO_NOT_EXIST.menu'...
------- Game Initialization -------
Well, where do I fail here?
Tally
26th April 2014, 12:54
Don't put your menu in the scriptmenus folder. loadMenu{} is a method to load a menu which otherwise could not be precached. Do not use it on script menus. 
If you put a menu in scriptmenus folder, precache it via the normal method in a gsc file.
Loveboy
26th April 2014, 12:58
I don't know what here is wrong :D
But should be that the mistake?
		name			testmenu
should be to
		name			"testmenu"
serthy
26th April 2014, 13:20
I'd like to test menus that are precached and can do a response -> scriptmenus.
However I failed to get error messages shown on such menus without having a client (me) connecting to the server.
@Loveboy:
There are 3 types of menu variables: numbers, strings and items.
The parameter 'name' is an item its contents can be either an item or a string.
Strings and items are handles in a similar way, there are only a few differences.
Stock CoD2 menus using items not strings as name parameter
serthy
26th April 2014, 18:02
ui_mp/hud.txt ui_mp/menus.txt and ui_mp/ingame.txt need to be in an *.iwd container to get loaded.
ui_mp and ui_mp/scriptmenus can remain in the main directory for testing.
just in case somebody needs this later
IzNoGoD
26th April 2014, 19:36
About the errors you saw: I saw this too in 1.2 with the qm menu, errors dont show at map_rotate iirc
Tally
27th April 2014, 12:28
I don't know what here is wrong :D
But should be that the mistake?
		name			testmenu
should be to
		name			"testmenu"
I'll add a couple of notes to this - You can do itemDef{} names either as a string or without the quote marks. In fact, you don't need a name for an itemDef{} unless you are hiding/showing the item via code. The only time a name is essential is with a menudef{} and it must be a string. Menus are precached by this name and if it is missing you will get a script compile error and your server wont start.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.