While not exactly like what you are after the following may be of some assistance too.
Its tested and works well but not consistantly as expected.
Code:
function fade_tree()
{
my.scale_x=8;//just my scale values here
my.scale_y=8;
my.scale_z=8;
while(1)
{
my.transparent = on;
my.passable = on;
if(vec_dist(player.x, my.x) < 3000)
{
my.alpha -= 2*time_step;
if (my.scale_x > 3)//more of my scaling stuff
{
my.scale_x += 0.5 * time;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
}
}
if(vec_dist(player.x, my.x) > 3000)
{
if(my.alpha < 99)
{
my.alpha += 2*time_step;
if (my.scale_x > 8)//same ol same old
{
my.scale_x =8;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
}
}
if(my.alpha > 90)
{
my.transparent = off;
}
}
wait(1);
}
}
action world_tree
{
my.polygon = on;
plant_object();// saves manual placement by leaving in the air
fade_tree();
}