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

Members Online

»
0 Active | 68 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 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 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Color system of menu files
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 04:31 pm
Hi again [wave]

Does somebody know how the color system of the .menu files works? I thought about RGB values, but there are always 4 values, like here:

Code:
backcolor		1 1 1 .25


Kind regards
Leal
Share |
Dobriy
General Member
Since: Mar 31, 2011
Posts: 96
Last: May 23, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 04:48 pm
Code:
backcolor		1(red) 1(green) 1(blue) .25(transparency)
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 04:52 pm
Oh lol, thank you Dobriy.
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 05:09 pm
I tried that, but I get black with this here and it is supposed to be yellow with no transparency:

Code:
backcolor		255 255 0 1


Do you know what is wrong?

Edit: what that here I get blue, strange thing:

Code:
backcolor		255 255 1 1
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 06:38 pm
range: 0 - 1

for example:

backcolor 0.02 0.31 0.45 0.431

just divide your regular r/g/b values by 255 :

255 == 255 / 255 == 1
0 == 0 / 255 == 0
135 == 135 / 255 == 0.5294
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 08:51 pm
Oh, thanks a lot for the explanation serthy.
Share |
kaje11
General Member
Since: Oct 16, 2010
Posts: 8
Last: Jul 23, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 09:20 pm
Code:
rgbToColor( rgb )
{
	if( !isDefined( rgb ) )
		return (0,0,0);

	return ( ( (int)( (rgb[0] * 10) / 255) / 10 ), ( (int)( (rgb[1] * 10) / 255) / 10 ), ( (int)( (rgb[2] * 10) / 255) / 10 ) );
}


I used that function for huds, for the numbers with only decimal.
You can delete (int) from there, and it will be float.

So I mean, max RGB values are 1, and min. is 0.
You can't use this function in menus, but that's usefull in scripting.
Btw. If I'm right, you can make a bar based on HUD, and make menu blank in that place. "onOpen" in menudef can give you response, if menu was opened, and then make HUD. Delete huds on onClose response. (That should be in your last topic about cvar menu, but I wrote it here :) )
edited on Jan. 6, 2012 02:24 pm by kaje11
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Jan. 6, 2012 10:18 pm
kaje11? good idea, but you're not right ;) try it out, start cod2, join a server and open a menu or the scoreboard, all the 2dhuds will dissappear ;)
Share |
kaje11
General Member
Since: Oct 16, 2010
Posts: 8
Last: Jul 23, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Saturday, Jan. 7, 2012 12:40 pm
And V (quick responses) menu ? :)
Think about it.
It's 100% possible in CoD1, I don't know what about CoD2.
There needs to be a style, or definition which disables huds.

EDIT: Maybe it's just about BLANK in that place in menu ? Scoreboard isn't good example for test my idea.

edited on Jan. 7, 2012 05:41 am by kaje11
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Jan. 7, 2012 01:12 pm
the quick response menu is not opened by a script, its opened by a keypress. You can accomplish the same by forcing a menu open by script which opens another menu through the menu system. Look for the right commands in the quickmessages menu. Huds might stay, but they might disappear. try.
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»