project reality header
Go Back   Project Reality Forums > PR:BF2 Mod Forums > PR:BF2 Community Modding > Modding Tutorials
01 Oct 2024, 00:00:00 (PRT)
Register Developer Blogs Members List Search Quick Links
Modding Tutorials Information and tutorials related to modding BF2.

Reply
 
Thread Tools Display Modes
Old 2013-02-21, 17:56   #1
[R-DEV]Mineral
PR:BF2 Lead Designer
Supporting Member
PR Server License Administrator

Mineral's Avatar
Default Using Custom Texture Suffix In Editor and bf2meshviewer

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:


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.


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:
[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:
[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.

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:
Quote:
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:
ResourceHandler.AddCustomTextureSuffix "Woodland"
Like last time simply copy this line and add your own suffix to it, so it looks like this:
Code:
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:
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:
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.

Mineral is offline Reply With Quote
Old 2013-05-25, 22:46   #2
Rabbit
Default Re: [Tutorial] using (costum)texture prefix in editor and bf2meshviewer

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.
Rabbit is offline Reply With Quote
Old 2013-05-26, 15:18   #3
[R-DEV]Mineral
PR:BF2 Lead Designer
Supporting Member
PR Server License Administrator

Mineral's Avatar
Default Re: [Tutorial] using (costum)texture prefix in editor and bf2meshviewer

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

Mineral is offline Reply With Quote
Old 2013-05-26, 16:26   #4
CTRifle
Retired PR Developer

CTRifle's Avatar
Default re: [Tutorial] using custom texture suffix in editor and bf2meshviewer

Well I made a custom suffix, but he wants woodlands, not desert which is the default, easy fix. I'll just rename them


CTRifle is offline Reply With Quote
Old 2013-05-28, 12:24   #5
Rabbit
Default re: [Tutorial] using custom texture suffix in editor and bf2meshviewer

Quote:
Originally Posted by CTRifle View Post
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
Rabbit is offline Reply With Quote
Old 2013-05-28, 13:29   #6
CTRifle
Retired PR Developer

CTRifle's Avatar
Default re: [Tutorial] using custom texture suffix in editor and bf2meshviewer

Well did you unzip the textures into your pr edit?


CTRifle is offline Reply With Quote
Reply


Tags
bf2, bf2meshviewer, costumtexture, custom, editor, prefix, suffix, texture, tutorial

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 19:26.