[Help] Custom Weapon Icon causing CTD

Making or wanting help making your own asset? Check in here
Post Reply
yuyoia
Posts: 8
Joined: 2010-04-06 22:26

[Help] Custom Weapon Icon causing CTD

Post by yuyoia »

Hello,

I am messing with a SP mod ultimate coop, but I am adding some weapons from AIX, which work so far so, as long as I remove the custom hud weapon icons form the weapon tweaks. I am wondering why bf2 will crash if I try to use the custom hud icons even though I placed them in the correct directory in the menu_client.zip which should be hud/ingame/weapons/icons/hud ,correct?

I did search the forums for other similar problems, and a few people had issues with map textures and vehicles, but I did not find any solution referring to how to fix this issue with weapon icons. I assume I am forgetting to add the new icon's to a reference list or something? Some one mentioned having an issue similar to this but converting the tga's to dds. I tried that too but unfortunately the icon's are not in dimension of powers of 2, which DDS needs to be.

I appreciate the other modders and devs knowledge and time!

Thank you.
AncientMan
Retired PR Developer
Posts: 5111
Joined: 2007-05-22 07:42

Re: Custom Weapon Icon causing CTD

Post by AncientMan »

You need to have tga files in the atlas, BF2 won't read .tga files by themselves. If you don't know how to make an atlas, you need it to be a dds file. You can either fix up the size of the icon by and directly saving it as a dds file, or I think, flip the tga image vertically, save it as a tga, then rename it from tga to dds.
Image
yuyoia
Posts: 8
Joined: 2010-04-06 22:26

Re: Custom Weapon Icon causing CTD

Post by yuyoia »

will try it. Thanks for the speedy info!

okay. I got it to work by renaming the tga a dds and flipping it, but this will only work for the "selectIcon" and not the weaponIcon or the altWeaponIcon. So it looks like I will have to learn how to modify or make my own atlas?
Last edited by yuyoia on 2010-04-09 02:58, edited 1 time in total.
yuyoia
Posts: 8
Joined: 2010-04-06 22:26

Re: Custom Weapon Icon causing CTD

Post by yuyoia »

[R-DEV]AncientMan wrote:If you don't know how to make an atlas, you need it to be a dds file.
is there a decent tool other than nvidia's atlas browser and command line assembler for making and editing atlases?
AncientMan
Retired PR Developer
Posts: 5111
Joined: 2007-05-22 07:42

Re: Custom Weapon Icon causing CTD

Post by AncientMan »

That's not how you do atlas's :p . BF2 has it's own tool, there's a bunch of readme's on the internets about BF2 hud atlas's, but it's kinda complicated if you haven't delved in it before. PR uses it's own custom script to make things really simple, but I can't really send you that since it wouldn't work for you without a bunch of edits.

I don't see why it wouldn't work for all hud elements, the weapon tweak file just needs to be set up to point to the right image name and extension, and it needs to be unique (can't be overwriting an existing image in the atlas, since the atlas would overwrite it).

But yeah, anyway, just save it as a straight .dds file then (DXT1 with no mipmaps and no alpha if there is no alpha, DXT5 with no mipmaps if there is an alpha channel). If it won't let you save because of the size, then resize it to a power of 2 number (1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc etc), ignoring correct proportions. It won't matter, because when it gets inserted back into the hud, it'll be resized again to fit the right size, stretching the incorrect proportion image into correct proportions, if that makes sense. In other words, stretch the image to the right size, then save it, and it should go back to the right size when bf2 puts the image on the hud. It should work anyway, it works in my head :p .
Image
Post Reply

Return to “PR:BF2 Community Modding”