Using Custom Texture Suffix In Editor and bf2meshviewer

Information and tutorials related to modding BF2.
Post Reply
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Using Custom Texture Suffix In Editor and bf2meshviewer

Post by Mineral »

I'm writing this down because quite a few people have asked me this already :) If it's in the wrong place or a duplicate of an old one please remove!

BF2 has the handy feature that it can load a different set of textures for certain objects if the mappers chooses too. For example quite a few vehicles, statics and other objects have a woodland texture next to their normal one. For example this US m1a2 tank:
Image
This happens because of this specific object there are existing 'woodland' textures.
When you look at it's main color texture called:
'A2partc_c.dds'
you can see there is also a copy of that called
'A2parts_c_Woodland.dds'

So if a mapper chooses his map is a woodland map, he can choose this in his editor settings and then all objects that have textures with a woodland texture suffix will be loaded. By standard the editor and bf2meshviewer already have the option to load these, i'll show you.

BF2MESHVIEWER
In bf2meshviewer, after loading your object go to Options->Texture Suffix--> and then choose the one you want. Since you are still at default settings you will only see None and woodland.
Image
So now your meshviewer will load up the woodland textures (if they exist of your object). Now maybe you have made a costum texture and gave it it's own suffix( _snow,_syria,_desert,...) and you want to see them in meshviewer, this is how you do it.

Open the config.ini file in the directory you installed bf2meshviewer in. Open it with a text editor and in there you will find the following piece of code:

Code: Select all

[Texture Paths]
texpath=1,C:\Program Files (x86)\EA GAMES\Battlefield 2\mods\pr_edit
suffix=woodland
Now it's as simply as copying the last line and changing the suffix to yours, so it for example for _snow becomes this:

Code: Select all

[Texture Paths]
texpath=1,C:\Program Files (x86)\EA GAMES\Battlefield 2\mods\pr_edit
suffix=woodland
suffix=snow
Save this file and now you will see your new suffix in bf3meshviewer.

BF2EDITOR

Now you can do the same for working in the editor. When mapping if you select a certain suffix and you save your map, it will save this in your init.con so if you then load the map ingame it will also load up the correct suffix if you selected one.

When in the editor, go to Render-> Object Costum Texture Mode and select the suffix of your choosing.
Image
then it will load all woodland textures. Now again I will explain how you can add a custom one to that list to load. go to your battlefield2/bf2editor/Settings/Init. So default location is:
C:\Program Files (x86)\EA GAMES\Battlefield 2\bf2editor\Settings\Init
in there open the RecourceInit.con with a texteditor. In there you will find at the bottom:

Code: Select all

ResourceHandler.AddCustomTextureSuffix "Woodland"
Like last time simply copy this line and add your own suffix to it, so it looks like this:

Code: Select all

ResourceHandler.AddCustomTextureSuffix "Woodland"
ResourceHandler.AddCustomTextureSuffix "Snow"
. Now when you restart the editor your costum suffix will be in the list to be loaded. You can also manually add your suffix to your map by opening your levelname/init.con file. In there you will find:

Code: Select all

if v_arg1 == BF2Editor
LevelSettings.CustomTextureSuffix ""
else
texturemanager.customTextureSuffix ""
endIf
simply add your suffix between the "" and it will load the correct suffix. So it looks like this:

Code: Select all

if v_arg1 == BF2Editor
LevelSettings.CustomTextureSuffix "Snow"
else
texturemanager.customTextureSuffix "Snow"
endIf
However if you did not add your suffix to the editor recourceinit.con then next time you safe it will go back to default. i hope this was helpful, if not feel free to ask a question.
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: [Tutorial] using (costum)texture prefix in editor and bf2meshviewer

Post by Rabbit »

So I added it all as said, it shows up in game, and the name shows up in the suffix, but it doesn't actually load in the bf2 editor.
Image

AfSoccer "I just don't see the natural talent."
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: [Tutorial] using (costum)texture prefix in editor and bf2meshviewer

Post by Mineral »

did you extract all textures in your pr_edit? Remember that each time you load your map you need to reselect the suffix in the render options.

Or do you mean that the suffix is not showing in the render options? Cause it should if you follow my instructions. If you still have trouble hit me on xfire rabbit or send a PM :)
Image
CTRifle
Retired PR Developer
Posts: 1056
Joined: 2011-01-03 14:57

re: [Tutorial] using custom texture suffix in editor and bf2meshviewer

Post by CTRifle »

Well I made a custom suffix, but he wants woodlands, not desert which is the default, easy fix. I'll just rename them
Image
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

re: [Tutorial] using custom texture suffix in editor and bf2meshviewer

Post by Rabbit »

CTRifle wrote:Well I made a custom suffix, but he wants woodlands, not desert which is the default, easy fix. I'll just rename them
not just that ct, when I go into the editor to load the shik suffix it doesn't show the new color rocks
Image

AfSoccer "I just don't see the natural talent."
Image
CTRifle
Retired PR Developer
Posts: 1056
Joined: 2011-01-03 14:57

re: [Tutorial] using custom texture suffix in editor and bf2meshviewer

Post by CTRifle »

Well did you unzip the textures into your pr edit?
Image
Image
Post Reply

Return to “Modding Tutorials”