Game Development Community

Foliage and Terrain

by Stephen · in Torque Game Engine · 06/04/2008 (5:18 pm) · 4 replies

Is there a way to keep foliage stay on a defined terrain. Say you have two different terrains, grass and dirt on the terrain. So when you set up some foliage it will only spawn on the grass and not the dirt.

#1
06/04/2008 (6:12 pm)
You'd need to go edit the foliagereplicator code, and have it peek at the terrain texture right before placing each foliage item. I have seen it mentioned somewhere before, and in fact it's something I'll be doing myself soon.
#2
06/04/2008 (6:37 pm)
A good place to start looking at code would be Ben Garneys forest pack. It's free, it does what you are looking to do, only with trees. You should be able to convert it to work with foliage fairly easily.
#3
06/20/2008 (10:02 am)
Quote:You'd need to go edit the foliagereplicator code,

Can this be done in script, or does it have to be a source edit?

Thanks!

Tony