Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
0 Active | 7 Guests
Online:

LATEST FORUM THREADS

»
Single Player Loadout
CoDWW SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 General
General game questions, comments, and chat.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: Custom taunts mod
Silversh0t
General Member
Since: Apr 30, 2011
Posts: 47
Last: Mar 1, 2012
[view latest posts]
Level 2
Category: CoD2 General
Posted: Wednesday, Feb. 29, 2012 08:41 am
Title says it all. Is there a detailed tutorial describing how that can be accomplished? I'd like to add another 1 or 2 groups of taunts along with the stock ones. I couldn't find anything similar on the web. Thanks in advance.
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD2 General
Posted: Thursday, Mar. 1, 2012 02:20 am
the stock quickmessage menu file is located here:

iw_06.iwd\ui_mp\wm_quickmessage.menu

excerpt:
Code:
		itemDef
		{
			name			"window"
			visible			1
			rect			16 36 0 0
			origin			ORIGIN_QUICKMESSAGEWINDOW
			forecolor		1 1 1 1
			textfont		UI_FONT_NORMAL
			textscale		.24
			textaligny		8
			text			"@QUICKMESSAGE_2_STATEMENTS"
			decoration
		}
		execKey "2" { close quickmessage; open quickstatements }

	
		itemDef
		{
			name			"window"
			visible			1
			rect			16 52 0 0
			origin			ORIGIN_QUICKMESSAGEWINDOW
			forecolor		1 1 1 1
			textfont		UI_FONT_NORMAL
			textscale		.24
			textaligny		8
			text			"@QUICKMESSAGE_3_RESPONSES"
			decoration
		}
		execKey "3" { close quickmessage; open quickresponses }


another category can be added below like this:
Code:
		itemDef
		{
			name			"window"
			visible			1
			rect			16 68 0 0
			origin			ORIGIN_QUICKMESSAGEWINDOW
			forecolor		1 1 1 1
			textfont		UI_FONT_NORMAL
			textscale		.24
			textaligny		8
			text			"@QUICKMESSAGE_4_CUSTOM"
			decoration
		}
		execKey "4" { close quickmessage; open quickcustom }


dont forget to update the positions of the follow-up items (y offset between two items is 16 in this case):

Code:
		itemDef
		{
			name			"window"
			visible			1
			rect			16 84 0 0
			origin			ORIGIN_QUICKMESSAGEWINDOW
			forecolor		1 1 1 1
			textfont		UI_FONT_NORMAL
			textscale		.24
			textaligny		8
			text			"@QUICKMESSAGE_ESC_EXIT"
			decoration
		}

rect 16 68 0 0 -----> rect 16 84 0 0


you'll have to create a localization string for @QUICKMESSAGE_4_CUSTOM

the stock file is here:
localized_english_iw09.iwd\localizedstrings\quickmessage.str

example:
REFERENCE 3_RESPONSES
LANG_ENGLISH "3. Responses"

your entry:
REFERENCE 4_CUSTOM
LANG_ENGLISH "4. Custom"


take one of the quickmessage sub-menus as example and make your own
iw_06.iwd\ui_mp\scriptmenus\quick*.menu

you may call it quickcustom.menu, but the file name doesn't matter actually, what is important, is the menuDef name!

Code:
	menuDef
	{
		name			"quickcommands"


the open command refers to "quickcustom", so you would have to write that as menuDef name
see: execKey "4" { close quickmessage; open quickcustom }

Code:

		itemDef
		{
			name			"window"
			group			ingamebox
			visible			1
			rect			16 20 0 0
			origin			ORIGIN_QUICKMESSAGEWINDOW
			forecolor		1 1 1 1
			textfont		UI_FONT_NORMAL
			textscale		.24
			textaligny		8
			text			"@QUICKMESSAGE_1_FOLLOW_ME"
			decoration
		}
		execKey "1" { scriptMenuResponse "1"; close quickcommands; }


the scheme is: @QUICKMESSAGE_n_description
create localizations for each in the quickmessage.str

execKey "x" means, it will execute the { code in braces } if key "x" is hit

you should use just numbers, 1, 2, 3 ... 9, 0 and change the scriptMenuResponse number accordingly

when key "x" is hit, a menuResponse is send to the script, which called the menu.

it is iw_07.iwd\maps\mp\gametypes\_quickmessages.gsc

you need to precache the menu there and create a variable for the menu (to keep the code style of IW):

game["menu_quickresponses"] = "quickresponses";
add below --> game["menu_quickcustom"] = "quickcustom";

precacheMenu(game["menu_quickresponses"]);
--> precacheMenu(game["menu_quickcustom"]);


add a new function, quickcustom() { ... }

if you don't want to play different taunts depending on team, you could do something like this:

Code:
quickcustom(response)
{
	if(!isdefined(self.pers["team"]) || self.pers["team"] == "spectator" || isdefined(self.spamdelay))
		return;

	self.spamdelay = true;

	switch(response)		
	{
	case "1":
		soundalias = "your_taunt_soundalias1";
		saytext = &"QUICKMESSAGE_YOUR_TAUNT_TEXT1";
		break;

	case "2":
		soundalias = "your_taunt_soundalias1";
		saytext = &"QUICKMESSAGE_YOUR_TAUNT_TEXT2";
		break;
	}
}


you need to create the localizations and soundaliases (of course)

finally, add your function to the iw_07.iwd\maps\mp\gametypes\_menus.gsc

Code:
			if(menu == game["menu_quickcommands"])
				maps\mp\gametypes\_quickmessages::quickcommands(response);
			else if(menu == game["menu_quickstatements"])
				maps\mp\gametypes\_quickmessages::quickstatements(response);
			else if(menu == game["menu_quickresponses"])
				maps\mp\gametypes\_quickmessages::quickresponses(response);
// your new entry:
			else if(menu == game["menu_quickcustom"])
				maps\mp\gametypes\_quickmessages::quickcustom(response);


sorry for compressed text, not my bad :(
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 189
Last: May 18, 2013
[view latest posts]
Level 4
Category: CoD2 General
Posted: Thursday, Mar. 1, 2012 12:03 pm
@Sevenz, Don't forget to locate them in the soundaliases files (csv)
Share |
Silversh0t
General Member
Since: Apr 30, 2011
Posts: 47
Last: Mar 1, 2012
[view latest posts]
Level 2
Category: CoD2 General
Posted: Thursday, Mar. 1, 2012 03:30 pm
I'm really confused. I have no idea where to start from.
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD2 General
Posted: Thursday, Mar. 1, 2012 04:34 pm
@nwestenberg: mentioned it:
Quote:
you need to create the localizations and soundaliases (of course)


extract the files i named and edit them step by step Silvershot!

u may have a look at this for menu scripting:
http://wiki.modsrepository.com/index.php/Call_of_Duty_5:_Menu_Modding_Basics
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD2 General
Posted: Friday, Mar. 2, 2012 06:35 pm
attachment: application(6.8Kb)
example attached, everything prepared
Share |
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 General

Latest Syndicated News

»
Why console gaming is dying
Quote:Consider this: Dedicated gaming sales — including living-room consoles...
Devs: Games are being dumb...
Click 'read more' to view the contents of this post.
Loadout
Gun Crafting to the Max. edited on Sep. 25, 2012 06:57 pm by Morp...
Introducing the Source Fil...
Surprised this wasn't made a long time ago. Sounds like a nice little feature.
Introducing the Source Fil...
The Source Filmmaker (SFM) is the movie-making tool built and used by us he...

Partners & Friends

»