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

Members Online

»
0 Active | 65 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 subscribe
Author Topic: cod2-help me
Ploxxy
General Member
Since: May 1, 2009
Posts: 170
Last: Aug 31, 2011
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, May. 31, 2009 10:18 pm
Hello, im wondering... in mods on cod2..like The Knights.Rifles mod.

The Weapons list/menu has a Mod info..called
Mod.By Knights.Turmoil

but he has it in a close posiition with the weapons
unlike mine, that is far away and i cant seem to figure out how to change it... and its really anoing.

ill keep trying. got any sugjestions??...
Please help me..willing to reply!!!!!!


(i keep trying to change it...but the only thing that seems to work is 0 0 128 24 but there all like that and turmoil some how changed his but its still saying 0 0 128 24)

PLEASE HELP
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Monday, Jun. 1, 2009 07:36 am
With menus there is sometimes an origin parameter which specifies where the box actually is.

Those 4 numbers you posted mean:

< x offset > < y offset > < width > < height >

Where the offsets are from the position specified by the Origin.

edited on Jun. 1, 2009 03:37 am by Pedro699
Share |
Ploxxy
General Member
Since: May 1, 2009
Posts: 170
Last: Aug 31, 2011
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Tuesday, Jun. 2, 2009 08:16 pm
Please describe more... i kinda understand the x and y axis's but im not sure i fully understand
Share |
stealthcod2
General Member
Since: Dec 23, 2008
Posts: 108
Last: Jul 13, 2009
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Jun. 3, 2009 09:03 pm
stealthcod2 add me
Share |
playername
Preferred Member
Since: Aug 24, 2006
Posts: 821
Last: Apr 15, 2011
[view latest posts]
Level 7
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Jun. 3, 2009 10:09 pm
If you could, post the itemDef for your item. Here is an example of two buttons above one another.

Code:

		itemDef 
		{
			name		button1
			text		"Button1"
			type		ITEM_TYPE_BUTTON
			style		WINDOW_STYLE_EMPTY
			textstyle	ITEM_TEXTSTYLE_SHADOWED
			rect		30 190 MAIN_RECT_WIDTH MAIN_RECT_HEIGHT MAIN_RECT_HORZALIGN MAIN_RECT_VERTALIGN 
			textalign	MAIN_TEXTALIGN
			textscale	MAIN_TEXTSCALE		
			textalignx	MAIN_TEXTALIGN_X
			textaligny	MAIN_TEXTALIGN_Y
			forecolor	MAIN_FORECOLOR
			visible		1
			textfont	UI_FONT_NORMAL
			mouseEnter
			{
				play "mouse_over";
			}
			action 
			{ 
				play "mouse_click";
			}
		}

		itemDef 
		{
			name		button2
			text		"Button2"
			type		ITEM_TYPE_BUTTON
			style		WINDOW_STYLE_EMPTY
			textstyle	ITEM_TEXTSTYLE_SHADOWED
			rect		30 200 MAIN_RECT_WIDTH MAIN_RECT_HEIGHT MAIN_RECT_HORZALIGN MAIN_RECT_VERTALIGN 
			textalign	MAIN_TEXTALIGN
			textscale	MAIN_TEXTSCALE		
			textalignx	MAIN_TEXTALIGN_X
			textaligny	MAIN_TEXTALIGN_Y
			forecolor	MAIN_FORECOLOR
			visible		1
			textfont	UI_FONT_NORMAL
			mouseEnter
			{
				play "mouse_over";
			}
			action 
			{ 
				play "mouse_click";
			}
		}


notice the line:
rect 30 190 MAIN_RECT_WIDTH MAIN_RECT_HEIGHT MAIN_RECT_HORZALIGN MAIN_RECT_VERTALIGN

Let me explain this more.
30: This is the X distance. This is left and right movement.
190: This is the Y distance. This is up and down movement.

The next 4 are presets set in the "ui/menudef.h" file. Make sure that you include it by adding the following to the TOP of your menu file:

Code:

#include "ui/menudef.h"

#define MAIN_RECT_WIDTH		210

#define MAIN_RECT_HEIGHT	20

#define MAIN_RECT_HORZALIGN	HORIZONTAL_ALIGN_DEFAULT

#define MAIN_RECT_VERTALIGN	VERTICAL_ALIGN_DEFAULT

nullFew tips for coding.
1. Keep the script as short as possible.
2. Don't comment every line. Only comment portions where they may be needed to point something out.
3. Don't over complicate the script, keep it organized and easy to read.

These help you find simple errors and makes it easy to make changes.
Share |
stealthcod2
General Member
Since: Dec 23, 2008
Posts: 108
Last: Jul 13, 2009
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Jun. 4, 2009 01:34 am
I fixed it for him m8 [cool]

He was changing rect, he was supposed to be changing origin_choice#
Share |
Restricted Access Topic is Locked 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

»