Jump to content
Sign in to follow this  
djukel

New universal dynamic grass script

Recommended Posts

Thanks Djukel!

I understand that the density is set by the first parameter I was just wondering if you could make specific areas on the map more grassy this way.

/Christer (a.k.a KeyCat)

Share this post


Link to post
Share on other sites

Here you go Albert...

grass2.jpg

Again, Djukels script makes ThruYerStErNuM's addon shine! Lets hope he may update it someday with a few more grass colors for the other islands wink_o.gif

/Christer (a.k.a KeyCat)

Share this post


Link to post
Share on other sites

Found a slight error in the code...

To get randomized height on the grass open the file build_grass.sqs and change the following line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#Movegrass

{_angle = random 359;_pos = [((_ppos select 0) + ((random _radius) * cos (_angle))), ((_ppos select 1) + ((random _radius) * sin (_angle))), 0],_dist = [getpos player,_pos] call GMR_distance3D; if(_dist > 30 and _dist < 200) then {_x setpos _pos}} forEach  _move

To:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#Movegrass

{_angle = random 359;_pos = [((_ppos select 0) + ((random _radius) * cos (_angle))), ((_ppos select 1) + ((random _radius) * sin (_angle))), ((-1 + (random 1)^3) / 3)],_dist = [getpos player,_pos] call GMR_distance3D; if(_dist > 30 and _dist < 200) then {_x setpos _pos}} forEach  _move

/Christer (a.k.a KeyCat)

Share this post


Link to post
Share on other sites

wow, looks great to me!  smile_o.gif I hope this is implemented into some main stream mods.. Of course only if it does not cause heavy MP lags! But as far as the visual aspects are concerned I must say it looks amasing!

Could you ask the guys from FDF to implement it? That would be highly appreciated!

Share this post


Link to post
Share on other sites
Found a slight error in the code...

To get randomized height on the grass open the file build_grass.sqs and change the following line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#Movegrass

{_angle = random 359;_pos = [((_ppos select 0) + ((random _radius) * cos (_angle))), ((_ppos select 1) + ((random _radius) * sin (_angle))), 0],_dist = [getpos player,_pos] call GMR_distance3D; if(_dist > 30 and _dist < 200) then {_x setpos _pos}} forEach  _move

To:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#Movegrass

{_angle = random 359;_pos = [((_ppos select 0) + ((random _radius) * cos (_angle))), ((_ppos select 1) + ((random _radius) * sin (_angle))), ((-1 + (random 1)^3) / 3)],_dist = [getpos player,_pos] call GMR_distance3D; if(_dist > 30 and _dist < 200) then {_x setpos _pos}} forEach  _move

/Christer (a.k.a KeyCat)

Can you post a link to the fized script ready to use?

Share this post


Link to post
Share on other sites
Can you post a link to the fized script ready to use?

@ Firefly: I will not post alternate versions without Djukel's approval, best is if he update his original script.

Until that [eventually] happens you have to open up notepad and cut & paste if you want my tweaks/fixes, I mean it's not really that hard to do wink_o.gif

@ Albert: There are some other things to think about other than the lag issue when implementing this grass for multiplayer so it should defiently be optional and low grass is best for MP due to AI LOS issues.

Regarding FDF - I don't play the FDF-mod... Why don't you ask them yourself?

/Christer (a.k.a KeyCat)

Share this post


Link to post
Share on other sites

Keycat! You can update my script freely without my approval if it will better than old. wink_o.gif

I have "grass_pos_XXXXX.sqs" for FDF Eastborder island too, if somebody need this PM a mail addres and I send it.

Share this post


Link to post
Share on other sites

Yes please i wan´t the grass for eastborder !

seems all the new great features are a lttle bit later in a new

fdf version "like animation enhancement" .

But this is without changing something from them , so i surley will test it.

THX

Share this post


Link to post
Share on other sites
Keycat! You can update my script freely without my approval if it will better than old.  wink_o.gif

Copy that Djukel!

When I'm finished I will wrap up my "tweaked" version of this cool script and make it available to anyone that want's it. It will be aimed for use in MP co-op missions but works equally well for SP.

/Christer (a.k.a KeyCat)

Share this post


Link to post
Share on other sites

whats about the knowsabout and hiding in grass ...

shooting while in grass ?

because if we have more of it ...it is nice when AI can´t shoot us ...but we can also not shoot out it in the most grass versions....

MCPXXL

Share this post


Link to post
Share on other sites
whats about the knowsabout and hiding in grass ...

shooting while in grass ?

because if we have more of it ...it is nice when AI can´t shoot us ...but we can also not shoot out it in the most grass versions....

MCPXXL

Dynamicgrass to FDF mod

Grass object are destroyed, AI can look throught and fire them.

If you want to disable this modiffy lines in build_grass.sqs

from:

_die = true

to

_die = false

Share this post


Link to post
Share on other sites

thx a lot will test it today on our dedicated server

MCP

Share this post


Link to post
Share on other sites

I do no see anything about local server ?

So i think it is like lauumax local ?

MCP

Share this post


Link to post
Share on other sites

@keycat or djukel: would you consider to make a grass script for malden and kolgujev? that would be pretty usefull for the FFUR mod too smile_o.gif

Share this post


Link to post
Share on other sites
I do no see anything about local server ?

So i think it is like lauumax local ?

The orginal script runs local on a client but since it use the "createVehicle" command to generate the grass objects they will be visible on all other client machines in MP games. This however generates additional network traffic and in our case it created to much lag.

By changing one single line in the script you can make it more network friendly (see my previous post on how). This creates some other issues with AI LOS you must think about but at least it does not generate any additional network traffic and don't create any lag if your computer can handle the grass...

@ Tomislav: If no one else makes them I plan to do the grass data files for Malden and Kolgujev later (no time frame) but the main problem is that current grass objects don't look to good on thoose island. You/we have to try to "convince" ThruYerStErNuM that we need some different grass color for those islands and maybe some low white/frosty grass for winter islands as well wink_o.gif

/Christer (a.k.a KeyCat)

Share this post


Link to post
Share on other sites

It is really cool in Game :-)

Made with Keycats Modifikations

FDF East-Boarder

Fri%20Apr%2022%2018-15-15%202005_nr93.jpg

Fri%20Apr%2022%2018-15-16%202005_nr95.jpg

Fri%20Apr%2022%2018-15-17%202005_nr96.jpg

Fri%20Apr%2022%2018-15-18%202005_nr98.jpg

MCP

Share this post


Link to post
Share on other sites

Yeah, I have so much unfinished foliage work, I usually just get excited about working on scripting ideas so I dont spend any time making more 3d/2d stuff. I will sort through my old textures and models and see if I can get new stuff done by monday.

Frankly, seeing placebo post a screenshot with my grass in it, then the very next day seeing that he is going to announce flashpoint 2 stuff at e3 with marek... it gives a little weekend kick...

About the scripts:

My original script had the concept of making grass not appear wherever something placed on the map does. This new script makes grass ONLY appear where the marks on the map occur. (or where the list of positions says they did) In an ideal dynamic environment, we would want the script to detect what types of textures were on the ground and make grass wherever appropriate, regardless of the map. It might be a good idea to make a script that would allow invisible signal objects that map makers can place, and then the type of object would define what types of grass and foliage should be generated whenever a player approaches. I don't mind passing off the scripting work for this to djukel now though  biggrin_o.gif

The only tradeoff in practice seems to be that the grass is not as dense for a given amount of performance, but it could probably be tweaked to seem very similar to the original script.

Share this post


Link to post
Share on other sites

Don´t look into the current script deep.

I think the hight over Ground should be in to.

So you see my missions with Helos.... think i a player in a hight mor the some meters shouldnt see  grass. (performance)

MCP

PS: Found many Grass in Rivers and Lakes on Eastboarder

Sun%20Apr%2024%2011-04-59%202005_nr3.jpg

Share this post


Link to post
Share on other sites

ThruYerStErNuM:

Good to hear there some chance you make new grasses, then we could cover all islands. BTW do you really believe that exist a script "to detect what types of textures were on the ground"? I heard many rumors about them but never seen any working script.

MCPXXL:

I made "grass_pos_eastborder.sqs" for FDF 1.1 version. It seems there are some terrian differences between FDF1.1 and FDF1.3 because I can not remember those bridge and river. I am pretty sure this could cause this bug. Unfortunately I can not fix this problem because my gforce card died a couple of weeks ago and my old voodoo3 card can not run with FDF mod. You should fix it youself if you find this error disturbing. I give you all instructions you need.

Script won't work propely if you fly (why need grass anyway?). Distance calculation between player and grass marks work fine if you stay on ground.

Share this post


Link to post
Share on other sites
I will sort through my old textures and models and see if I can get new stuff done by monday.

Thats great news ThruYerStErNuM! Looking forward to any improvments you come up with but if I could have some wishes it would be suitable grass for Kolgujev and Malden but also a white/frosty version for Kegety's (and others) nice winter islands.

Quote[/b] ]

It might be a good idea to make a script that would allow invisible signal objects that map makers can place, and then the type of object would define what types of grass and foliage should be generated whenever a player approaches. I don't mind passing off the scripting work for this to djukel now though  biggrin_o.gif

How about changing the script to be able to use couple of more arrays like GMR_AllGrassTargets1, GMR_AllGrassTargets2 GMR_AllGrassTargets3 for different types of grass (think 3 or 4 would be enough)? Where each array have posistions for one type of grass object. Maybe something djukel will/can look into?

Quote[/b] ]

think the hight over Ground should be in to.

So you see my missions with Helos.... think i a player in a hight mor the some meters shouldnt see grass. (performance)

@ MCPXXL: Don't know if I agree... If implemented I think it should be optional and the extra check takes resources to so payoff maybe isn't that great?

/Christer (a.k.a KeyCat)

Share this post


Link to post
Share on other sites

ThruYerStErNuM,

Forgott to mention one thing. I don't know how hard it is to do for you but it would alos be really nice to be able to place static grass via the editor, that way you could hide/camofluage stuff like CoC's or MapFact's nice AP mines.

In current version I can see the grass listed in the listbox but I can't choose and place anything?

Just an idea wink_o.gif

/Christer (a.k.a KeyCat)

Share this post


Link to post
Share on other sites

looking fantastic ...

Share this post


Link to post
Share on other sites

Simply fantastic :-)

Waiting ..................

MCP

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×