Not logged inOpenClonk Forum
Up Topic Plants library

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Clonkonaut
I added the Place() function in the plants library. Parameters are simple: int amount, proplist rectangle (Zapper committed Rectangle() yesterday or so).
These two are the standard parameters (for now, see below). The whole function is basicall a wrapper for PlaceVegetation but certain plant may overload it to do custom stuff. Also more parameters may be added by plants.
Just call on any definition you want to place. Tree_Coniferous->Place(10); (standard rectangle is the whole landscape).

In addition, I made a little helper function PlaceForest (in System.ocg/Creation.c). Parameters are: array plants, int x, int y, int width
plants is an array with plants that occur in the forest. The first value is the main plant of the forest, the others will spawn randomly within (it's not guaranteed that everything is in there though) in little groups. Start and ends of the forest will consist of smaller plants, the rest is fully grown.
x is the starting point of the forest, width the width, y is the lowest point from which to start to look for the surface.

I added PlaceForest() in Goldmine so you can have a look at it. At a matter of fact, I forgot a soil check. Will do that tomorrow ;)
Maybe a note to anyone who feels responsible for fire (Zapper?): One flint is enough to burn down the whole forest. Maybe incineration is a bit too strong?

The other reason why I opened the topic is to ask some further questions about what is wanted:

->Place() only places fully grown plants. Adding a growth parameter to it is easy, just passing that to PlaceVegetation. Wanted yes or no? Will increase the number of standard parameters for Place() (bear in mind that if you want to access some custom parameters of plants, you will always have to fill in the standard params first. Keeping these as few as possible spares some work and traps).

I had the idea of artificially confining plants to certain areas of the maps. That would be a bool keep_area parameter for Place(), making certain that the plants and their offspring will not exceed the given rectangle. Wanted yes or no? Again adding a standard parameter. Eleutherotes noted that it's also possible to contain plants somewhere by adding "natural" borders like non soil material. Although one have to make certain that these borders are big enough so the travel distance of the offspring will not cover it.

And the last thing, what about foreground trees? I always liked the mod in CR. It's an tremendously easy way of spicing things up and give one the feeling that these trees are "all around you". The downsides are of course things like covered object and so on. But hey, don't let your stuff lie around in a forest!

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill