How to use foliage?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Redline
2nd Lieutenant
2nd Lieutenant
Posts: 396
Joined: Tue Jan 16, 2007 4:22 pm
Projects :: Space to Ground [reworking]
Games I'm Playing :: Different Games
xbox live or psn: No gamertag set
Location: The left side of the moon
Contact:

How to use foliage?

Post by Redline »

Some worlds like Endor or Felucia work with Foliage.
As far as know it's for the adding of grass or bushes.
Otherwise you would have to place the grass 1000 of times on the map.
Also you would have to rotate and place the grass on mountains and this would take much time and many nerves.

Okay, so what I've to do? Is it some work in the world abc.req?
Where can I tell the game which types of objects it shall load?
Hidden/Spoiler:
Image
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: How to use foliage?

Post by THEWULFMAN »

There are 4 Foliage levels, as you can see in ZE. They each are a callback in the .prp (Prop File). The Prop file is called for in your worlds .req.

You can check out Felucia's stock files. It will have a prop file, and using that you can see how it's setup. I added some comments to the first section, marked in bolded blue.

fel.prp
Hidden/Spoiler:
Layer(0) // layer level
{
SpreadFactor(0.2);
Mesh()
{
File("fel1_prop_foliage_b.msh", 100); // model name
Frequency(70); // how frequently it will place the object
Scale(1); // how big they will be
Lighting(1); // no idea, maybe asking if it is to be affected by lighting or not
Stiffness(0.0); // again, no idea
AIVisibilityFactor(0.2,0.5); // how much the AI's view range will be decreased inside the foliaged area
}
}

Layer(1)
{
SpreadFactor(0.7);
Mesh()
{
File("fel1_bldg_pitcher_bush.msh", 100);
Frequency(70);
Scale(1.0);
Stiffness(0.1);
ColorVariation(0.4);
UseCollision(1);
Lighting(1);
AIVisibilityFactor(1.0,1.0);
Sound("fel_amb_wildlife", 8.0, 2.0);
CollisionSound("foliage_collision");
}
}

Layer(2)
{
SpreadFactor(0.3);
Mesh()
{
File("fel1_prop_foliage_d.msh", 100);
Frequency(60);
Scale(1.0);
Stiffness(0.0);
CollisionSound("foliage_collision");
AIVisibilityFactor(1.0,1.0);
}
}

Layer(3)
{
SpreadFactor(0.2);
Mesh()
{
GrassPatch("fel1_prop_thick_bush.odf", 95);
File("editor_prop_bush.msh", 95);
Frequency(95);
Scale(0.45);
Lighting(1);
Stiffness(0.0);
Sound("fel_amb_wildlife", 8.0, 2.0);
CollisionSound("foliage_collision");
AIVisibilityFactor(0.1,0.25);
}
}

TreeLine()
{
Path("jungle1")
{
Distance(20);
BorderOdf("fel1_prop_hellbush");
}
}
It's exceedingly helpful, practically a necessity. Like, I used them for adding tons of rocks all over my Titan map, which would have been nearly impossible to do otherwise.
User avatar
AceMastermind
Gametoast Staff
Gametoast Staff
Posts: 3285
Joined: Mon Aug 21, 2006 6:23 am
Contact:

Re: How to use foliage?

Post by AceMastermind »

Post Reply