High grass script?

Posted By: thorus

High grass script? - 12/22/12 08:05

hy guys, anyone know where i can find a grass placing script for Lite_c ? or how should i fill all the green plains with high grass? thanks
Posted By: sivan

Re: High grass script? - 12/22/12 15:21

you can find the "infinite terrain" script in samples folder. it places sprites and models onto terrain at random positions in a given qusantity.

if you want to cover only a specific area of the terrain, you should use c_trace with SCAN_TEXTURE to check which texture is hit at given position, or tetxure colour at hit position.
Posted By: thorus

Re: High grass script? - 12/22/12 19:33

thanks, but when i try that.. it doesnt work i get a error when i use the script with my level.wmb,

couse in the script they use a level_("terrain.hmp");

how can i change the script
action place_grass()
{
vec_scale(my.scale_x,0.1+random(0.1));
ent_terrain_place(my,level_terrain,0,55); <--- here i get an error!!!!!
my.alpha = 70;
my.flags |= PASSABLE | TRANSLUCENT;
my.eflags |= CLIP1; // clip away at 50% LOD range
my.emask &= ~DYNAMIC;
}
that it work also with wmb, atm it works with hmp..

thanks
Posted By: sivan

Re: High grass script? - 12/22/12 20:28

if your wmb contains a terrain, in the main script define: ENTITY* terrain_entity; , create an action that contains: terrain_entity = me; , assign this action to the terrain in WED Properties menu, then you can put this name into ent_terrain_place(my, terrain_entity,0,55); it should work fine.
Posted By: thorus

Re: High grass script? - 12/22/12 21:03

hi, thanks for the fast answer but the next problem is, i use a multitex3 shader already for the terrain, so the action slot in map probs.. is gone smirk

any clue how to fix that? please ? laugh
Posted By: sivan

Re: High grass script? - 12/22/12 21:34

you can set the shader in your new action by: fx_terraintex3(); , or by: my.material = mtl_terraintex3; , or if you have a MATERIAL* declared and assigned already for the terrain put there a line: effect="terraintex3.fx";
Posted By: thorus

Re: High grass script? - 12/23/12 08:07

thanks for your time, but there spawn no gras smirk no error but no gras here smirk
here the code:
#define NUM_GRASS 4000

ENTITY* level_terrain; // the current terrain

Code:
action blabla() <------- this action i have on my terrain in the level! 
{
	level_terrain = me;
	fx_modelTex3Nm();
}

action place_grass()
{
	vec_scale(my.scale_x,0.1+random(0.1));
	ent_terrain_place(my,level_terrain,0,55);
	my.alpha = 70;
	my.flags |= PASSABLE | TRANSLUCENT;
	my.eflags |= CLIP1; // clip away at 50% LOD range
	my.emask &= ~DYNAMIC;
}
function_main()
{
        level_load("lost_lands.wmb");
	int i;
	for (i=0; i < NUM_GRASS; i++)
	ent_create("grass_x3.dds",NULL,place_grass);
	wait(1);
}



please help laugh
Posted By: thorus

Re: High grass script? - 12/25/12 09:41

have done, thanks anyway
© 2024 lite-C Forums