Jump to content
Official BF Editor Forums

Edit Vehicle Hud


Gasgat

Recommended Posts

Hi!

I've been editing the US humvee to make it more realistic in hope of that the Project reality team would add it to the mod which would mean a great deal to me, However i'm new to the editor but i'm a quick learner.

So here's the question: How do I add a painted flag to the humvees HUD? Do I have to do some advanced working in 3D max?

Thank you!

Link to comment
Share on other sites

First - the material manager section is way off target - i'll move your thread to Object Editor.

And no, no work in 3DS is necessary. You need to add a texture with your flag to the HUD setup of the Hummer. There is no custom vehicle HUD for the Hummer ( can't speak for PR though, they might have one ) , you need to set one up or add a HUD to the driver's weapon ( the car_horn , hehehe )

Look for the lines

ObjectTemplate.weaponHud.guiIndex NN
ObjectTemplate.weaponHud.altGuiIndex NN

in the weaponHUD component. There's a reference file in /menu/HUD/HUDsetup/GUIIndex.txt which tells you the vanilla GUI indices - ranging from a simple crosshair ( index 5 ) up to the filled HUD's of the helicopters.

Edited by mschoeldgen[Xww2]
Link to comment
Share on other sites

ObjectTemplate.weaponHud.altGuiIndex

is used when in zoomed mode.

You can create your own HUD by copying existing one (they are placed in Menu_server.zip\HUD\HudSetup\Vehicles), giving it unique name and changing all HUD names to your custom one.

For example, if you're using LAV-25 one as a base, press Ctrl+H and change all the LAV25 in the file to, e.g., HMMWV. Don't change text that is placed just after hudBuilder.setPictureNodeTexture - it's path to texture!

Then, change HUD's Guiindex:hudBuilder.setNodeLogicShowVariable EQUAL GuiIndex 15 - change 15 to whatever you want, but it must be unique. See that GUIIndex.txt file mschoeldgen[Xww2] mentioned before to find free one. I am using numbers from 100 usually.

OK. Now, HUD editing itself.

Here's a picture node, that will display some drawings on your HUD.

hudBuilder.createPictureNode LAV25Hud LAV25Crosshair 272 265 256 128

hudBuilder.setPictureNodeTexture Ingame\Vehicles\Icons\Hud\Land\Lav25\LAV25_cross.tga

hudBuilder.setNodeColor 0 0.8 0 0.8

In this case, LAV25Hud directs to parent HUD split node's name (it's on the top of the file usually).

LAV25Crosshair - unique node's name.

272 265 256 128 - first 2 values are X and Y coords from the top-left corner of the screen, max values (right-bottom corner) are 800 for X and 600 for Y. Last two are node's size, X and Y. See your image's size for this values.

Ingame\Vehicles\Icons\Hud\Land\Lav25\LAV25_cross.tga - path to the texture.

hudBuilder.setNodeColor 0 0.8 0 0.8 - node's color. First three values are color in RGB format (get color on Paint and divide it's RGB values by 255 to get these ones). Last 0.8 is picture's opacity. 1 is solid, 0 is invisible.

Well, that's all about simple picture nodes... There are some more advanced parameters that can make your picture appear on some event or change position and rotation, but now you don't need it now.

Edited by sashaNar
Link to comment
Share on other sites

  • 1 month later...

So there is none... I am making the Battlefield Tweaker, it can display HUD's, but only images I made in the editor.

I'll try to add a HUD displayer, which can control all the variables used in HUD's. I have only one question:

How do the variables work? As example the target\lock-on part of the F18 HUD:

hudBuilder.createObjectMarkerNode 		F18HeatHud F18Marker 224 139 352 321
hudBuilder.setObjectMarkerNodeTexture 		0 Ingame\Vehicles\Icons\Hud\Air\Attack\F15\HeatSeeking\lockBoxFriendly.tga
hudBuilder.setObjectMarkerNodeTexture 		1 Ingame\Vehicles\Icons\Hud\Air\Attack\F15\HeatSeeking\lockBox.tga
hudBuilder.setObjectMarkerNodeTexture 		2 Ingame\Vehicles\Icons\Hud\Air\Attack\F15\HeatSeeking\lockBoxLocked.tga
hudBuilder.setObjectMarkerNodeTexture 		3 Ingame\Vehicles\Icons\Hud\Land\Tunguska\rangeLine.tga
hudBuilder.setObjectMarkerNodeTextureSize	0 32 32
hudBuilder.setObjectMarkerNodeTextureSize	1 32 32
hudBuilder.setObjectMarkerNodeTextureSize	2 64 64
hudBuilder.setObjectMarkerNodeTextureSize	3 16 256
hudBuilder.setObjectMarkerNodeObjects 		4
hudBuilder.setObjectMarkerNodeWeapon 		1
hudBuilder.setNodeColor		 		0 0.8 0 1

Any help please? ;)

Oh and something else:

I am working on a compiler to extract all .tga and .dds files found in texture atlasses.

Any need for an atlas generator? (thought there is one, but just asking :lol: )

Link to comment
Share on other sites

There is no variable in the code extract you've posted :P

There's some variables available in HUD's , here's a few of them:

hudBuilder.setActiveObject            IglaHud IGLAMarkerLabel0TextNode 
hudBuilder.setTextNodeStringVariable        IGLAMarkerLabel0String
hudBuilder.setActiveObject            IglaHud IGLAMarkerLabel0
hudBuilder.setNodeShowVariable             IGLAMarkerLabel0Show

hudBuilder.setActiveObject            IglaHud IGLAMarkerLabel1TextNode 
hudBuilder.setTextNodeStringVariable        IGLAMarkerLabel1String
hudBuilder.setActiveObject            IglaHud IGLAMarkerLabel1
hudBuilder.setNodeShowVariable             IGLAMarkerLabel1Show

hudBuilder.setActiveObject            IglaHud IGLAMarkerLabel2TextNode
hudBuilder.setTextNodeStringVariable        IGLAMarkerLabel2String
hudBuilder.setActiveObject            IglaHud IGLAMarkerLabel2
hudBuilder.setNodeShowVariable             IGLAMarkerLabel2Show

hudBuilder.setActiveObject            IglaHud IGLAMarkerLabel3TextNode
hudBuilder.setTextNodeStringVariable        IGLAMarkerLabel3String
hudBuilder.setActiveObject            IglaHud IGLAMarkerLabel3
hudBuilder.setNodeShowVariable             IGLAMarkerLabel3Show

hudBuilder.createPictureNode            IglaHud IGLACrossHair 274 175 256 256
hudBuilder.setPictureNodeTexture         Ingame\Vehicles\Icons\Hud\Land\Tunguska\crosshair.tga
hudBuilder.setNodeColor                0.925 0.424 0.267 1

hudBuilder.createPictureNode            IglaHud IGLAHeatLock 353 460 128 32
hudBuilder.setPictureNodeTexture         Ingame\Vehicles\Icons\Hud\Land\Tunguska\missileLock.tga
hudBuilder.setNodeColor                0.925 0.424 0.267 1
hudBuilder.setNodeShowVariable             IGLAMarkerObjectMarkerNodeLockedShow

BF2 comes with a customized Atlas builder. The generic version can be found at http://developer.nvidia.com

Edited by mschoeldgen[Xww2]
Link to comment
Share on other sites

Ah ok, now I understand. But there is one thing that troubles me, and that are the string variables:

- IGLAMarkerLabel0String

- IGLAMarkerLabel1String

- IGLAMarkerLabel2String

- IGLAMarkerLabel3String

- F15LaserTargetLabel0String

- F15LaserTargetLabel1String

- F15LaserTargetLabel2String

- F15LaserTargetLabel3String

Where are the exact strings?

Why not use "Locked on" instead of F15LaserTargetLabel2String?

If I want to make a HUD editor I need to know how these strings work and where they are.

Thanks for the help you gave me so far ;)

Edit:

Good news: I figured out how all those variables work (except those strings though)

They are divided into the following groups:

- AlphaVariable

- PosVariable

- RGBVariables

- RotateVariable

- ShowVariable

- StringVariable

- ValueVariable

Just like program coding, you can add a reference to a previous node, as example:

Show variable F15LaserTargetLabel0Show

Pos variable Ah1zHoverHoverNodeXPos

HoverNode is the type.

This means a fresh HUD Simulator will be made :P

Still, I do not understand where and what those strings are :(

Edited by bergerkiller
Link to comment
Share on other sites

Wow I simulated a compass! ;)

Forget about the strings, they will just be add-ons anyways.

Another question:

hudBuilder.createCompassNode F18PilotHud F18Compass 3 290 166 220 32 1 0

What is the 3, 290, 166, 220, 32, 1 and 0?

I guess 3 is Xpos, 290 is Ypos, but what about the others? :huh:

Link to comment
Share on other sites

3 is the type - can't help you much here. there's at least values from 0 to 3 in this one.

290 is X coordinate of the topleft corner , 166 is the Y coordinate ( starting from top of the screen ! higher numbers will display lower on the screen ) of topleft corner.

220 is the width of the picture , 32 is the height of the picture.

1 - no idea , probably a display property. 0 - same here.

Link to comment
Share on other sites

290 is X coordinate of the topleft corner , 166 is the Y coordinate ( starting from top of the screen ! higher numbers will display lower on the screen ) of topleft corner.

Man you saved my life! :lol:

I almost started on a function to change this coordinate to bottom left or from the middle.

Now I can just set a value. Woho :P

One more thing:

What is the default size of the HUD screen? 800 x 600?

Because the HUD's are always displayed in the middle, no change when changing screen size.

(That's why I thought from the middle of the screen)

EDIT:

I can't thanks you enough MS. Because of that answer the program is already working!

I can set the image color then set a rotation and then position it according to the values you discribed above.

I also figured out the used size was indeed 800 x 600.

To suite the editor, I have scaled it down to 400 x 300, and I added an image scaler.

I tried to make the f15 HUD missile HUD, and it worked! It placed the image precisely in the middle when I used the coordinates described in the HUD.

Finally, I added a image storage system, so I can draw multiple images.

Final thing to do, which will not be very hard, is to make an Image blender, so I can draw all images.

It is working, unbelievable! :D

Edited by bergerkiller
Link to comment
Share on other sites

  • 4 weeks later...

Lol I already can :P

It can open .dds and .tga files, convert them to resource bitmaps and paint them using position, rotation,size, color and more.

Last thing to do is multi node display, so you can see the overall picture.

(seeing only one picturenode is not enough if you position textnodes in it as example)

To see it, I made a small WIP of the picture Node displayer.

(Copy your menu textures in the "textures" folder)

Download WIP of Picture Node Editor

Edited by bergerkiller
Link to comment
Share on other sites

Works! The only problem is that after changing color with big (1024) pics it freeses and "thinks" for 5-10 secs before changes are shown.

It's very nice! if it will be able to combine 2+ nodes (at least text/pic) you'll be our hero berger!

Edited by sashaNar
Link to comment
Share on other sites

Lol I already can :P

It can open .dds and .tga files, convert them to resource bitmaps and paint them using position, rotation,size, color and more.

Last thing to do is multi node display, so you can see the overall picture.

(seeing only one picturenode is not enough if you position textnodes in it as example)

To see it, I made a small WIP of the picture Node displayer.

(Copy your menu textures in the "textures" folder)

Download WIP of Picture Node Editor

is there a read me or tutorial around i would like to make our huds better like aix did but

i can't seem to figure out how to use this..

thx.

Link to comment
Share on other sites

  • 13 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...