Custom Foliage Issues [Solved]

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
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Custom Foliage Issues [Solved]

Post by Superm9 »

I am having some issues with creating custom foliage. I am trying to create a wheat-like foliage (called barq); but when I put it ingame it looks like a really bad field of multicolored squares, with the wheat texture (which I believe was created by ryukaji for Caleb1117) sitting in the middle of the square; here's what I mean:
Hidden/Spoiler:
Image
Yeah...

Here is the wheat's .odf file:
Hidden/Spoiler:
[GameObjectClass]

ClassLabel = "grasspatch"
GeometryName = "editor_grasspatch.msh"


[Properties]

MinSize = "2.5"
MaxSize = "3.5"
Alpha = "1.0"
NumParticles = "40"
MaxDistance = "40"
Texture = "qla_barq1"
NumParts = "1"
RadiusFadeMin = "4.0"
RadiusFadeMax = "5.0"

DarknessMin = "0.5"
DarknessMax = "1.0"
The image for the wheat (I saved it as a 256 by 512 image - are those ok dimensions, seeing as they aren't the same power of 2?)
Hidden/Spoiler:
Image
My .prp file (the significant bit):
Hidden/Spoiler:
Layer(3)
{
SpreadFactor(0.1);
Mesh()
{
GrassPatch("qla_barq1.odf", 40);
File("editor_grasspatch.msh", 80);
Frequency(100);
Scale(1);
Stiffness(0.0);
CollisionSound("foliage_collision");
ColorVariation(0.2);
AIVisibilityFactor(0.40,0.9);
}
}
Can anyone give me a basic pointer on how to create custom foliage (or if anyone has a wheat-like foliage ready-made, I'll take that too :wink: )?

Thanks!
User avatar
bobfinkl
Rebel Colonel
Rebel Colonel
Posts: 593
Joined: Sun Jul 13, 2008 9:01 am
Projects :: Lots of unreleased stuff
Games I'm Playing :: Life
xbox live or psn: No gamertag set
Location: The quaint little city gametoast.

Re: Custom Foliage Issues

Post by bobfinkl »

Just make the white on the wheat texture transparent and remove this line from the .prp file.

ColorVariation(0.2);
YaNkFaN
Field Commander
Field Commander
Posts: 943
Joined: Sat Dec 13, 2008 8:17 am

Re: Custom Foliage Issues

Post by YaNkFaN »

you need an alpha channel on the texture
User avatar
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Custom Foliage Issues

Post by Superm9 »

I just realized that when I saved the barq (wheat) texture, I saved it as a 24-bit, and not a 32-bit, picture - 24-bit doesn't save the empty space, it fills it in with white. When I did this, the wheat/barq texture showed up just fine ingame.

Thanks! :thumbs:
Post Reply