Jump to content
Sign in to follow this  
djukel

New universal dynamic grass script

Recommended Posts

Hi

Is it possible to use the script in the .cpp with keeping the improvements on other islands than FDF ones ?

rock.gif

edit : So i'll go to test it , wink_o.gif , I'm sure that'll be really nice

Share this post


Link to post
Share on other sites

It can be implemented on any Island, but it needs a bit "work".

I tell you how it works. Depending on size of the island must determine 400-800 spots - placing a "flagcarrier" object for example - on each map. Every spot is an central point wherefrom grass will spread out on 200 meters radius. You should cover the whole map placing spots and take care that radius not reaches roads, cities or water. And also take care between distance neighbouring two spots will be less than 200 meters! It is a pretty long work but you should do it once. When you finished you open mission.sqm file and collect position of "flags" to a file - see @grass_pos.sqs - and done! Covering the whole eastborder island - what is the biggest map - and collect positions will last 8 hours for me.

This script combining with ecp/dkm mod island detection script could be put easily to config.cpp file. But first have to cover with spots all (default) island we want to use.

Share this post


Link to post
Share on other sites

I uploaded version to Nogova island. All spot position in this version wasn't convert to script file, so you can see in mission editor how "flag" objects lays on map.

Nogova_testmission

Share this post


Link to post
Share on other sites

If anybody interested to help me to convert all (default or addon) maps to one script I tell you what should have to do.

For example Novoga is ready to convertion. See Nogova testmission.

this is the first spot position in mission.sqm (NOGOVA VERSION) file

--------------------------------------------------------------------

class Item0

{

position[]={8467.720703,59.887508,4405.636230};

id=1;

side="EMPTY";

vehicle="Flagcarrier";

leader=1;

skill=0.600000;

text="grass1";

};

here is the result how to convert position to an array in a script file

----------------------------------------------------------------------

;#1 -> here mark the number of position for debug and edit, number comes from "text="grass1""

_pos = [8467,4405,59] -> this is the rounded numbers of x,y,z coordinates

GMR_AllGrassTargets = GMR_AllGrassTargets + [_pos] -> here put position to an array

The work is to go through all 800 position and write is to a file that way. I would be happy if somebody could help me in this. smile_o.gif

Share this post


Link to post
Share on other sites

can the ai look through that grass, i can't remember what was with the uwar, but then it'll become uninteresting.

Share this post


Link to post
Share on other sites
can the ai look through that grass, i can't remember what was with the uwar, but then it'll become uninteresting.

All grass object are destroyed, therefore Ai can look through and can shot through them. I tested but you could test too. wink_o.gif

Share this post


Link to post
Share on other sites

i meant, if i try to hide in the grass, so that the ai cannot spot me, but i'll give it a try

Share this post


Link to post
Share on other sites

Heres what you do  biggrin_o.gif

Download this nifty program I just made, it will take the positions of all empty vehicles you place in an sqm and convert it into an sqs with the positions added into a variable.

sqm2sqs

It is a command line program, you really just have to drag your mission.sqm onto it, (sqm2sqs.exe yourmission.sqm) and it will make a sqs file in the same directory. (You need java installed for it to work, get it from java.com)

It works well with that sample mission he just posted, just make one like that for every island and run it with this to get your script.

of course I'm making it to eventually convert more pieces of an sqm into an sqs... but this should save anyone doing anything like djukel has demonstrated here, lots of time.

I havent tested the program much, if you want the information in the SQS layed out differently, ask and i'll make another exe for you.

Share this post


Link to post
Share on other sites
Download this nifty program I just made, it will take the positions of all empty vehicles you place in an sqm and convert it into an sqs with the positions added into a variable.

Whooo!

Thank you very much. You saved us from lots of boring work hours. I hope it is work I haven't tested jut because have to d/l JAVA application to run your program. smile_o.gif

Share this post


Link to post
Share on other sites
I hope it is work I haven't tested jut because have to d/l JAVA application to run your program.

Hi!

I can not start your program. I downloaded JRE1.1 Java software and installed for win98. When I execute command line

- sqm2sqs.exe missiom.sqm - I got error message: No JVM could be found on your system. Please define exe4J_JAVA_HOME to point an installed JDK or JRE.

Help me what else sofware need or what to do? sad_o.gif

Share this post


Link to post
Share on other sites
do i need any grass mods to run this script or something?

Do you know any grass mod? I haven't seen so far. What is this?

BTW is there any grass addon somewhere? As I saw color of uwar grasses unfortunately do not fit to Kolgujev and Malden island due to their unique ground textures. sad_o.gif

Share this post


Link to post
Share on other sites

Very nice! Don't have time to check it out right now though, but the ECP was thinking about incorporating dynamic grass in somehow. This sounds like it would be the way to go (with permission, of course).

Share this post


Link to post
Share on other sites
Quote[/b] ]You need jre 5 (java 1.5), is that what you got? if so it seems windows 98 doesnt set up java automatically. I think you need the classpath configured to see the jre.

Finally succeed to install JAVA. Your mission decoding program seems to work well. I tested it in 2 islands no errors found. Now I am working on another "grass spread" algorithm which will make better result I hope. smile_o.gif

Quote[/b] ]do i need any grass mods to run this script or something?

Only uwar_grass addon need to run this.

Quote[/b] ]This sounds like it would be the way to go (with permission, of course).

If you do not find/make better you can use it of course. smile_o.gif

Share this post


Link to post
Share on other sites

I decided to continue to post in this thread since this the original thread for this great dynamic grass script.

I've just tested it in multiplayer and there are some bad news and some good news. By default it works in MP but it increases lag a lot since each grass object have to traverse to all clients and continue to do so as the player who inititated the script moves around.

The good side of having the script working this way is that all the grass are "synchronized" (i.e shows at the same place for all but for us it became to laggy when combining with other more important AI scripts etc. (on 512 KB ADSL connections).

However by changing one line in the script you can make it alot more multiplayer friendly and not increase the data sent on the network but the downside of doing it this way is that the grass will not be at the same place for everyone since it's randomly placed but it still increases the immersion a lot IMHO

and thats how our co-op group will use it until we have 100 MBit connections and 5+ GHz CPU's wink_o.gif

This also have the benefit of letting people decide if the have hardware enough to enable the grass, in other words one client could start it with parameter 1000 (high density) while another could use 250 (low density) and maybe a third can't/won't use any grass at all.

How to do it more MP friendly? Open up the file build_grass.sqs and find the following line...

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

_v = _object createVehicle [_n,0]

Then change it to the following and save...

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

_v = _object camCreate [_n,0]

This will change it so the grass only are created locally on the computer that runs the script. I also prefered to have the grass also when it's dark so I just REM-ed out the daytime checks but YMMV.

This being said this is really an AWESOME script and makes ThruYerStErNuM's grass addon shine! Now lets hope we can help eachother by creating "grass_pos_XXXXX.sqs" files for all/most other islands. I will soon start working on doing it for Jakerod's nice Avignon island.

I asked the same Q in the other thread but ask here as well. Are there plans to update the uwar grass addon with grass colors suitable for the Kolgujev and Malden islands?

Lastly.... Djukel and ThruYerStErNuM!!!! A BIG thank you for making and sharing this!

/Christer (a.k.a KeyCat)

Share this post


Link to post
Share on other sites

Djukel,

Have one question... Does the density of the grass increase if you place grass spots closer to each other (i.e letting 200 m radius overlap each other) or does the script pick the first close location?

/Christer (a.k.a KeyCat)

Share this post


Link to post
Share on other sites
Djukel,

Have one question... Does the density of the grass increase if you place grass spots closer to each other (i.e letting 200 m radius overlap each other) or does the script pick the first close location?

/Christer (a.k.a KeyCat)

Yes, the script pick the first (or first 3) closest location, so If you place grass spots closer script will run longer and maybe grass spreading will look a little more smooth (I think). However grass density won't be increased. This depend on something else(see init.sqs).

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  

×