OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: polska on 08 Oct 2008, 20:14:13
-
I like the grass that is bundled with BRG 3 but it only comes in a tiny little patch. Is there a way to make a huge section of it at once? :confused:
-
It depends on what you're trying to achieve. Are you making a mission or creating an island? Who's going to be hiding in it, the player or the enemy?
It'll take some effort to learn how to use it well, but maybe you could consider Unscripted War's Dynamic Grass:
ThruYerStErNuM's page (http://www.waskosky.com/projects/environment/grass.htm) and the
thread at BI forums (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=2d00de3dd20d235d1e83dab496a13b10;act=ST;f=4;t=41630).
Being dynamically generated, it appears around the player (and hides him somewhat) but only where the island- / mission-maker says so.
-
I like the grass from BRG 3 though. What I mean is going into the mission editor and placing it like a regular unit. I want a large field of it instead of tiny little patches, so my guys and the enemys can hide in the vegetations for long and realistic battles.
-
I'm sorry, I don't have an answer to your question.
However, you might want to have a look at Berghoff's Malden, Everon & Kolgujev (http://ofp.gamepark.cz/index.php?showthis=9788) (Cold War Crisis islands) adapted to use Nature Pack 3. Then any mission you played on those islands would see a lot more grass.
I think one of the issues with single, large swathes of grass being used in the mission editor is that they wouldn't follow the contours of the land.
-
You could do this with a script. If you find out the class name of the grass 'unit', you could create a looping script which would place (for example) a square consisting of 200 copies of the same grass unit. That way you could place a single game logic in the middle of where you want the field to be, and in its init field run the script which would use the game logic's position and generate the field around it.
-
Any idea where I might find some info about making this script?
Removed quote of entire previous post - Planck
-
Place gamelogic on map where you want field. In its init field put
this exec "makefield.sqs"
_field = _this
_fieldx = getpos _field select 0
_fieldy = getpos _field select 1
_xdist = 3
_ydist = 3
_cols = 5
_rows = 5
_x = _fieldx - (_cols/2) * _xdist
_y = _fieldy - (_rows/2) * _ydist
_sceneryname = "TablePub"
_colcount = 0
_rowcount = 0
_totalcount = 0
#loop
f = _sceneryname camcreate [_x, _y, 0]
_x = _x + _xdist
_colcount = _colcount + 1
_totalcount = _totalcount + 1
?!(_colcount == _cols):goto "loop"
_colcount = 0
_x = _fieldx - (_cols/2) * _xdist
_y = _y + _ydist
_rowcount = _rowcount + 1
?!(_rowcount == _rows):goto "loop"
_rowcount = 0
?!(_totalcount >= (_cols*_rows)):goto "loop"
exit
Replace the 'TablePub' with the classname of your grass, and adjust the rows, cols, xdist and ydist to suit.
On a more serious note, I've twice now requested by PM that you not quote the post to which you are replying. I am willing to assume you don't know how to read your PMs, so I shall say it once more here:
Do not quote the post to which you are replying. It wastes space and bandwidth.
-
Now it works, but the grass seems to be "sunk". Only about 1/4 its total height is showing. :confused:
-
Height above ground level is controlled by the third number in this line:
f = _sceneryname camcreate [_x, _y, 0]currently it is 0 (zero). Units are metres so raise it to 0.25 or maybe even 0.5.
-
Works now. Thanks. :)