Question about foliage
Moderator: Moderators
-
YTF
- First Lance Corporal

- Posts: 124
- Joined: Thu Jul 10, 2008 3:53 pm
Question about foliage
I have an issue with foliage. I place it in my map using the Zeroeditor Foliage button, but when I munge the map, it doesn't show up ingame. Do I have to add any lines in the LUA or anything like that? Thanks.
- Bantha55
- 2nd Lieutenant

- Posts: 407
- Joined: Sun Jun 10, 2007 1:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Germany
- Contact:
Re: Question about foliage
I don´t know if this works for bf1 but it does for bf2:
Code: Select all
FOLIAGE EDIT MODE
Foliage is defined in the PRP file using text editor and subsequently applied using the FOLIAGE BRUSH tools. There are four foliage layers as defined and simple controls for brush SIZE and SHAPE because foliage is applied in an erratic fashion. There are also FILL WORLD and ERASE WORLD buttons that apply and remove foliage across the entire terrain. In the game assets provided some of the foliage is set up to appear in the editor as small white disks, while other foliage is fully rendered. This was done on a case by case basis to make it easier to use the editor by increasing render times and visual clutter to work around.
Foliage properties are written to the prop (prp) file. The format is below for two types, the first utilizes a mesh called editor_grasspatch.msh which appears in the editor as a white disk. The second layer utilizes the most typical type of foliage used is the second example which also has multiple types of foliage in a single layer.
Layer(0)
{
SpreadFactor(0.1);
Mesh()
{
GrassPatch("nab_prop_grass.odf", 50);
File("editor_grasspatch.msh", 50);
Frequency(100);
Scale(1);
Stiffness(0.0);
}
}
Layer(1)
{
SpreadFactor(0.4);
Mesh()
{
File("end_prop_fern5.msh", 30);
Frequency(20);
Scale(1);
Stiffness(0.0);
CollisionSound("foliage_collision");
ColorVariation(0.2);
}
Mesh()
{
File("end_prop_treeclump_1.msh", 50);
Frequency(80);
Scale(1);
Stiffness(0.0);
CollisionSound("foliage_collision");
ColorVariation(0.2);
}
}
The spreadfactor determines the density of the foliage on a particular tile. The lower the number the more dense. The number that appears in the File line at the end of the mesh or object specifies the view distance where the foliage fades in or out in meters. The frequency represents the percent of that particular layer that is made up of that individual mesh. In the above samples for layer 1, one mesh constitutes 20% percent of the foliage and the other 80% on a given tile when painted. Scale scales the foliage object. Stiffness determines how stiff an object is. If set to 0 the foliage tends to tilt with the terrain, but if set higher it becomes more erect and straight, such as when a tree would be planted on a hill and you want the tree to be pointed towards the sky rather that at angle. Collision sound is a sound hook that triggers a sound when something collides with the foliage. ColorVariation provides a color deviation in the foliage so it does not all appear as the same object.
There is another type of foliage in the game that does not utilize the EDIT FOLIAGE mode but rather the PATH EDIT mode but it will be described here. This type of foliage is referred to as Hell Bushes and they are created by defining a path that functions like a string of popcorn where the popcorn are object meshes. The density of the objects along the string are determined by the distance property defined in the PRP file using syntax like that below. Examples of Hell Bushes in the game are the bushes that encircle Yavin 1.
TreeLine()
{
Path("jungle1")
{
Distance(28);
BorderOdf("end_prop_treebill.odf");
}
}-
YTF
- First Lance Corporal

- Posts: 124
- Joined: Thu Jul 10, 2008 3:53 pm
Re: Question about foliage
No luck. I looked through the PRP file and could find nothing wrong with it. I did look in my world's REQ, however, and found these lines:
REQN
{
"prop"
--"ENDV"
}
I erased the hyphens, but it still didn't work. Do I have to change anything in my REQ?
REQN
{
"prop"
--"ENDV"
}
I erased the hyphens, but it still didn't work. Do I have to change anything in my REQ?
- Bantha55
- 2nd Lieutenant

- Posts: 407
- Joined: Sun Jun 10, 2007 1:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Germany
- Contact:
Re: Question about foliage
you don´t need to in bf2 but i don´t know if you have to in bf1... I´m only modding for bf2
