Originally Posted By: Superku
Originally Posted By: Superku
Use pixel instructions to read the grass channel of the blendmap, then you will know if there's supposed to be grass.

can you explain it to me ,can you tell me the witch code should I use to read grass channel in blendmap and how to use it to another functiion .I use this code to create grass.
Code:
function generate_grass()
{

	var player_position1;
	var player_position2;
	while (player == NULL) {wait (1);}
	while (1)
	{
		vec_set (temp.x, player.x);
		temp.x += 1000 - random(1500);
		vec_set (temp.y, player.y);
		temp.y += 1000 - random(1500);
		temp.z = player.z + 200;
		// not too close to the player and the player has moved recently?
		if ((abs(temp.x - player.x) > 600) || (abs(temp.y - player.y) > 600))
		{
			// increase the nexus if you want to have more than 2000 bushes at once
			if (((player_position1.x != player_position2.x) && (number_of_bushes <8000)) || (total_frames < 300))
			{
				if (random(1) > 0.1 )
				{
					ent_create (grass1_mdl, temp.x, place_grass);
				}
				else
				{
					ent_create (grass2_mdl, temp.x, place_grass);
				}
			}
			vec_set (player_position1.x, player.x);
			wait (1);
			vec_set (player_position2.x, player.x);
		}
		wait(0);
	}
}