Forum Mod Bakery Docs

Place objects randomly on grass planes?

Posted in Support
Please login to contribute to the conversation.
Hello,

I just started to dig out this old game, found this community and had fun modding new higher resolution pictures into the game.
That's quite nice, but I would like to have more plastical grass.

So would it be possible to copy the flower objects, create a new game object from that, add another texture and use this as grass which is randomly spreaded over all grass planes in a level?
I think you would need some Lua scripting, that's okay, but where do I find that specific object in the game files (the flowers in level 1) and how do I create a new object of them and put it in the game?
Is there a little tutorial anywhere around?

Here is a screenshot of my new textures:
I just changed most of the terrain so far, for me it's a big visible difference now. And I think it would look quite nice when there is some grass standing around :D

Thank you.

---

Edit: I just found the video tutorial post and the "scripting basics" tutorial. I'll take a look now. Sorry for opening this post first...
[deleted user]
4 yrs ago (Statistics)
(No worries, it's better to ask a question than to remain silent!)
The flowers are located inside the region file, the levels are separated into several region files, and the one you're gonna be looking for is l1z1.p3d
If you want to actually place the flowers as models - it's gonna involve some blender trickery (mostly rouitne copy-pasting, but still)
Alternatively, you can "integrate" the flowers as textures into the grass texture, but now every single grass 'tile' will have the damn flowers everywhere, that's easy to fix too
Create a Set, and add multiple textures inside it, this way the game will randomly choose which texture to use per level reload

(btw, gotta admit, the flower model/sprite/whateveritisimblind is gorgeous 👀)
I figured out how to put some grass manually in the level, but okay, not the best method I think.

What exactly do you mean with ""integrate" the flowers as textures into the grass texture"? How would I do that?
[deleted user]
4 yrs ago (Statistics)
You could create a 'Set' chunk in the P3D editor by pressing the right mouse button on the file directory at the very top of the P3D file and clicking "New" -> "Set"
Then, click RMB on the Set chunk itself -> "New" -> "Texture", and add a desired texture. Rinse and repeat until every texture has been added
The Set chunk is just a glorified Texture chunk, it lets the game pick any Texture chunk inside it and use it, then if the level reloads - the texture will be picked up again. For short - it's a randomized texture
Although now that I think of it - it won't be the best solution either, since it affects EVERY texture. I.e. if you were to add flowers to the grass texture, and randomize it through the Set chunk - there would be either no flowers at all or flowers everywhere, so, it's best to add them through Blender after all (or, whichever program do you use over there)
Okay, thanks for your tips, I now figured out how to create random objects all over the grass planes with Blender scripting, which outputs an xml which I can import via Lucas Pure3D Editor. Nice, that's kind of a handy workflow.

But there are some problems, grass is placed on some concrete and stuff like the tiles in front of Flanders house, because this stuff is also just placed on a grass tiled map. And there should be more differences in those grass things, and maybe more of them...
But that's a thing for later.

Here's a pic:

Edit:
Okay, I had to do it: A bit more grass, and 2 different kinds.
Looks quite nice, but in tree shadows they are much too bright. Well... Any ideas how to handle that?

Pic:

Edit2:
If there's interest in testing the mod, look here: https://donutteam.com/forum/topic/3746