Home   Help Search Login Register  

Author Topic: Making large fields of grass  (Read 2866 times)

0 Members and 1 Guest are viewing this topic.

Offline polska

  • Members
  • *
Making large fields of grass
« 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:

Walter_E_Kurtz

  • Guest
Re: Making large fields of grass
« Reply #1 on: 08 Oct 2008, 22:51:37 »
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 and the
thread at BI forums.

Being dynamically generated, it appears around the player (and hides him somewhat) but only where the island- / mission-maker says so.

Offline polska

  • Members
  • *
Re: Making large fields of grass
« Reply #2 on: 09 Oct 2008, 04:00:53 »
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.
« Last Edit: 09 Oct 2008, 04:03:02 by polska »

Walter_E_Kurtz

  • Guest
Re: Making large fields of grass
« Reply #3 on: 09 Oct 2008, 14:13:51 »
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 (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.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Making large fields of grass
« Reply #4 on: 09 Oct 2008, 14:50:22 »
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.

Offline polska

  • Members
  • *
Re: Making large fields of grass
« Reply #5 on: 09 Oct 2008, 16:21:39 »
Any idea where I might find some info about making this script?





Removed quote of entire previous post - Planck
« Last Edit: 09 Oct 2008, 18:18:36 by Planck »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Making large fields of grass
« Reply #6 on: 09 Oct 2008, 18:38:25 »
Place gamelogic on map where you want field. In its init field put

Code: [Select]
this exec "makefield.sqs"
Code: (makefield.sqs) [Select]
_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.
« Last Edit: 09 Oct 2008, 20:23:56 by bedges »

Offline polska

  • Members
  • *
Re: Making large fields of grass
« Reply #7 on: 09 Oct 2008, 19:55:52 »
Now it works, but the grass seems to be "sunk". Only about 1/4 its total height is showing. :confused:
« Last Edit: 09 Oct 2008, 23:35:43 by polska »

Walter_E_Kurtz

  • Guest
Re: Making large fields of grass
« Reply #8 on: 10 Oct 2008, 13:07:18 »
Height above ground level is controlled by the third number in this line:
Code: [Select]
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.
« Last Edit: 10 Oct 2008, 14:54:14 by bedges »

Offline polska

  • Members
  • *
Re: Making large fields of grass
« Reply #9 on: 10 Oct 2008, 18:36:53 »
Works now. Thanks. :)