Foliage tutorial

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
User avatar
acryptozoo
Master Bounty Hunter
Master Bounty Hunter
Posts: 1642
Joined: Wed Jun 03, 2009 3:14 pm
Projects :: Yavin Mappack
Games I'm Playing :: Homeworld 2
xbox live or psn: acryptozoo
Location: in the jungles of Yavin IV
Contact:

Foliage tutorial

Post by acryptozoo »

I recently noticed that Gt was void of a tutorial for foliage
so i though i should write one to help future and currenty people with adding foliage
adding foliage is easy lets say you want to add the rock's from geonosis as
your foliage
-search for and open geo.prp with notepad of some sort (in geo's world1 folder)
- once you got it copy this:
------------------------------------------------------

Code: Select all

Layer(0)
{
	SpreadFactor(0.2);
 	Mesh()
	{
		File("geo_prop_flatrocks.msh", 40);
		Frequency(30);
		Scale(1);
		Stiffness(0.0);
		UseCollision();
	}
 	Mesh()
	{
		File("geo_prop_flatrocks_2.msh", 30);
		Frequency(70);
		Scale(1.0);
		Stiffness(0.0);
	}
Layer(1)
	{
		SpreadFactor(0.3);
		Mesh()
		{
			GrassPatch("geo_prop_pebble.odf", 30);
			File("editor_prop_bush.msh", 30);
			Frequency(100);
			Scale(1);
			Stiffness(0.0);
		}
	}
} 
---------------------------------------------------
from it into another notepad now you can add another layer of rocks if you want,
by the below adding you can add 3 more layers five layers total
------------------------------------------------
Layer(2,3 or 4 )

Code: Select all

	{
		SpreadFactor(0.3); <-----  controls  how spread out they are
 		Mesh()
		{
			GrassPatch("geo_prop_pebble.odf", 30); <----- odf file for the foilage
			File("editor_prop_bush.msh", 30);<----- the msh for the foilage
			Frequency(100);<----- how frequent they appear( if you have more than one msh in you layer) if not leave it at 100
			Scale(1);<----- how big they are 
			Stiffness(0.0);<----- amount of collison they have
		}
---------------------------------------------------
now click SAVE AS and type in ABC.prp <----- change abc to your three letter world name
now drop ABC.prp into the world1 folder

and now open up ZE and click on the Foliage tab
and paint accordingly and change the layers to change it up
there you go :wink:
User avatar
commander501stappo
Jedi
Jedi
Posts: 1016
Joined: Tue Sep 28, 2010 8:13 am
Games I'm Playing :: Skyrim BF4 KSP CIV V
xbox live or psn: DarthAppo
Location: In a galaxy very, very close by...

Re: Foilage tut

Post by commander501stappo »

Nice tut, I'll try it when I'm up to my next land map :P
User avatar
Firefang
Major
Major
Posts: 518
Joined: Mon Nov 15, 2010 8:55 pm
Location: California

Re: Foilage tut

Post by Firefang »

commander501stappo wrote:Nice tut, I'll try it when I'm up to my next land map :P
I agree
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Foilage tut

Post by Marth8880 »

Great tutorial, acryptozoo! Thank you very much for this; there wasn't one when I needed it but that was a while ago and somebody helped me.
modmaster13
General
General
Posts: 777
Joined: Wed Aug 18, 2010 4:23 pm
Games I'm Playing :: COD SWBF
xbox live or psn: KrypticcElementt
Location: Twitter @_KrypticElement
Contact:

Re: Foilage tut

Post by modmaster13 »

This should be in the FAQ's!
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Foilage tut

Post by Maveritchell »

modmaster13 wrote:This should be in the FAQ's!
There isn't one because there is already a very clear tutorial included with the stock documentation:
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");
}
}
Post Reply