also, to get your grass directly on the ground put this in the grass' action (behavior):
var tr;
var res;
vec_set (tr, my.x);
tr.z -= 999999;
res = c_trace (my.x, tr, ignore_me + ignore_you + ignore_passable + use_polygon);
if (res != 0)
{
vec_set(my.x, target);
}
for that to work, you have to make sure that the model's center is at the bottom of the grass, unless you want to make some grass look smaller, to make some diversity, then do this:
var grheight = 10;//if grass is too far in the ground, make the number smaller, if you want it to go down more, make this number more
var tr;
var res;
vec_set (tr, my.x);
tr.z -= 999999;
res = c_trace (my.x, tr, ignore_me + ignore_you + ignore_passable + use_polygon);
if (res != 0)
{
vec_set(tr.x, target.x);
tr.z -= random (grheight);
vec_set(my.x, tr);
}
also if you are using model grass, i also recommend using this in the action as well:
my.pan = random (360);
don't place either of the codes in a while loop, just put it in an action that you apply to the grass, i assume you have one since you will be fading out the grass, one last important thing to say, since you will have multiple versions of the same model or sprite with the same action make sure you do this:
var grass_num = -1;
action grass_act
{
grass_num += 1;
my.skill68 = grass_num; //any skill will work here, just use one that the grass doesn't use anywhere else
blah blah code....
}
Last edited by mpdeveloper_B; 01/09/08 04:51.