Foliage Collision

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
samw40
Posts: 1
Joined: Fri Jan 20, 2012 1:32 pm
Projects :: No Mod project currently.
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Foliage Collision

Post by samw40 »

I have a question...

So I've placed my foliage, 3 layers, but I'd like to do three things:

1) Add collision to Layer 1. There's a 1 next to UseCollision, and I set the Stiffness to 1.0, but I can still walk right on through it.

2) I'd like to add several different items to a single layer. For example, could I add fel1_bldg_bladder.msh and fel1_bldg_segmented.msh to Layer 1, so that it mixes up the foliage a little bit? How would I format that in the file? Otherwise, it just keeps repeating the same plant over and over again.

3) Is there a way to change the view distance for foliage fading from view? Because when I walk too far away, all of the foliage disappears.

So yeah. And finally, the terrain fades to white when I get a little ways away from, say, a hill. I know that this is a setting in the .sky file, but what do I change?

Here's my XWR.prp file:

Code: Select all

Layer(0)
{
    SpreadFactor(0.2);
    Mesh()
	{	
		File("fel1_prop_foliage_b.msh", 100);
		Frequency(70);
		Scale(1);
		Lighting(1);
		Stiffness(0.0);
		AIVisibilityFactor(0.2,0.5);
	}
}

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");
    	}
}
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: Foliage Collision

Post by Marth8880 »

Welcome to Gametoast! :)
samw40 wrote:1) Add collision to Layer 1. There's a 1 next to UseCollision, and I set the Stiffness to 1.0, but I can still walk right on through it.
The model that the foliage uses probably has an OPTION file that calls for no collision. Try to find that file and remove a "-nocollision" bit from it if it's present.
samw40 wrote:2) I'd like to add several different items to a single layer. For example, could I add fel1_bldg_bladder.msh and fel1_bldg_segmented.msh to Layer 1, so that it mixes up the foliage a little bit? How would I format that in the file? Otherwise, it just keeps repeating the same plant over and over again.
I don't know if this would work or not, but what you could try to do is something like this:
Hidden/Spoiler:
Layer(1)
{
SpreadFactor(0.7);
Mesh()
{
File("fel1_bldg_pitcher_bush.msh", "fel1_bldg_bladder.msh", "fel1_bldg_segmented.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");
}
}
Or alternatively:
Hidden/Spoiler:
Layer(1)
{
SpreadFactor(0.7);
Mesh()
{
File("fel1_bldg_pitcher_bush.msh", 100);
File("fel1_bldg_bladder.msh", 100);
File("fel1_bldg_segmented.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");
}
}
samw40 wrote:3) Is there a way to change the view distance for foliage fading from view? Because when I walk too far away, all of the foliage disappears.
Try messing around with the NearSceneRange() and FarSceneRange() settings in your .sky file, though I'm not sure if they affect foliage in any way.
samw40 wrote:So yeah. And finally, the terrain fades to white when I get a little ways away from, say, a hill. I know that this is a setting in the .sky file, but what do I change?
Look in the Mos Eisley .sky file for a reference to LowResTerrain(). Copy the lines associated with it over to your .sky file and change what you need to make it reference your own low res (doesn't *have* to be low res - only preferred for those with weaker machines) terrain texture.
Post Reply