ensiform Posted December 4, 2006 Share Posted December 4, 2006 Basically I'm working on a little hack that uses the weapon cmds (0-9) for having a menu show up on screen and so that one does not need to stop actually moving, etc just to pull up the voice menu. Basically one just hijacks CG_Weapon_f and checks for if a bool is enabled, and if so skip the rest of the weapon stuff and run the number found through a function that will interpret it as what "menu" you are on and execute the proper cmd. Link to comment Share on other sites More sharing options...
ensiform Posted December 4, 2006 Author Share Posted December 4, 2006 Here's the basic idea of the first menu: http://img232.imageshack.us/img232/1879/20061203203009ctf3ih2.jpg In the future I'll probably add a header, make the stuff fade in and out, and force the number on cancel also, etc. Link to comment Share on other sites More sharing options...
Tinny Posted December 4, 2006 Share Posted December 4, 2006 Just this morning I was thinking about executing a text to voice conversion plugin so for a sec I was scared we thought about the same exact thing. Anyways, its looking nice man. Link to comment Share on other sites More sharing options...
razorace Posted December 4, 2006 Share Posted December 4, 2006 I don't really understand, couldn't you just treat the chat visuals as a part of the hud's menu file? Link to comment Share on other sites More sharing options...
ensiform Posted December 4, 2006 Author Share Posted December 4, 2006 I don't understand what you mean by that? Besides the fact of not being able to use rest of keys/still move, it takes up too much space by drawing all the extra background and crap and the large text, not so gud. Plus there's the fact that I don't use the HUD menu file anymore except when in vehicles. Also: how would it detect which menu they are on, and what numbers do what, etc. Link to comment Share on other sites More sharing options...
razorace Posted December 4, 2006 Share Posted December 4, 2006 I don't know. I was just suggesting a method for rendering it on screen. Link to comment Share on other sites More sharing options...
ensiform Posted December 4, 2006 Author Share Posted December 4, 2006 Plain text beats all the extra visuals any day though Link to comment Share on other sites More sharing options...
ensiform Posted December 5, 2006 Author Share Posted December 5, 2006 Having difficulties forcing some data into my structs: Item struct: typedef struct itemVoice_s { int number; const char *text; // display text const char *command; // command script vec4_t color; } itemVoice_t; Menu struct: typedef struct menuInfo_s { int itemCount; // number of items; const char *name; itemVoice_t *items[10]; // items this menu contains } menuInfo_t; Menu array: menuInfo_t VoiceMenus[64]; Function trying to set the data: Vector4Set is just a separate macro that is exactly like VectorSet only it works on vec4_t instead of vec3_t. void SetMenus(void) { memset(&VoiceMenus, 0, sizeof(VoiceMenus)); // main VoiceMenus[0].name = "main"; // attack button VoiceMenus[0].items[0]->number = 1; VoiceMenus[0].items[0]->text = "VC_ATT"; Vector4Set(VoiceMenus[0].items[0]->color, 1, 1, 1, 1); VoiceMenus[0].items[0]->command = "menu att"; VoiceMenus[0].itemCount++; // defend button VoiceMenus[0].items[1]->number = 2; VoiceMenus[0].items[1]->text = "VC_DEF"; Vector4Set(VoiceMenus[0].items[1]->color, 1, 1, 1, 1); VoiceMenus[0].items[1]->command = "menu def"; VoiceMenus[0].itemCount++; // request button VoiceMenus[0].items[2]->number = 3; VoiceMenus[0].items[2]->text = "VC_REQ"; Vector4Set(VoiceMenus[0].items[2]->color, 1, 1, 1, 1); VoiceMenus[0].items[2]->command = "menu req"; VoiceMenus[0].itemCount++; // reply button VoiceMenus[0].items[3]->number = 4; VoiceMenus[0].items[3]->text = "VC_REPLY"; Vector4Set(VoiceMenus[0].items[3]->color, 1, 1, 1, 1); VoiceMenus[0].items[3]->command = "menu rep"; VoiceMenus[0].itemCount++; // spot button VoiceMenus[0].items[4]->number = 5; VoiceMenus[0].items[4]->text = "VC_SPOT"; Vector4Set(VoiceMenus[0].items[4]->color, 1, 1, 1, 1); VoiceMenus[0].items[4]->command = "menu spot"; VoiceMenus[0].itemCount++; // tactic button VoiceMenus[0].items[5]->number = 6; VoiceMenus[0].items[5]->text = "VC_TACTIC"; Vector4Set(VoiceMenus[0].items[5]->color, 1, 1, 1, 1); VoiceMenus[0].items[5]->command = "menu tac"; VoiceMenus[0].itemCount++; // cancel button VoiceMenus[0].items[6]->number = 3; VoiceMenus[0].items[6]->text = "VC_CANCEL"; Vector4Set(VoiceMenus[0].items[6]->color, 1, 1, 1, 1); VoiceMenus[0].items[6]->command = "close"; VoiceMenus[0].itemCount++; } This basically compiles and all but when the function calls and I debug it, it I get access violation @ the line of setting number of first item, and if I try to move it down to the next line it still does it. Any ideas? I know this is an ugly way to add data to the array but it will suffice for now as I'm wanting to hardcode to test, then I will probably make it customizable and read a file or two. Link to comment Share on other sites More sharing options...
ensiform Posted December 5, 2006 Author Share Posted December 5, 2006 The above has been fixed and slightly modified and now works. Still to come: Headers, make more translucent than I currently have it, adjust the position a bit, make it read from file, and maybe even change the font. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.