Page 1 of 1

How to setup the trunk of tree variations?

Posted: Tue Oct 20, 2020 2:11 pm
by Poutinator
I don't get how they are supposed to be setup. The documentation says that the trunk is supposed to have one more frame than the leaves. Why is that the case? While the leaves changes according to the tree stage, the trunk is staying the same.

Also, by looking at the data.raw visualiser in this post, I can see that the base tree have one frame for the trunk and tree for the leaves, witch break the rule specified in the documentation. If I try to do the same thing, I get an error message telling the frame count is incorrect.

Right now my solution is to make an animation with the correct frame count using the same sprite for the trunk in each one. It feels more like a hack than a good solution.

Am I not understanding how tree work correctly? What would be the correct way of having a single trunk for many leaves sprites?

Re: How to setup the trunk of tree variations?

Posted: Wed Oct 21, 2020 9:35 am
by Bilka
Hey, the frame_count restriction for trunk only applies if shadow isn't loaded. I fixed the documentation to indicate this.

Why this works like that: If your shadow is part of the trunk sprites, then the leaf shadow will be visible there. This means that the leaf progression is visible in the sprite so you need different trunk sprites for the different leaf progressions. You can see this in action in the 0.16.51 tree definitions and graphics, so maybe download that old version if you want to get more familiar with that method of defining the tree graphics. For illustration I have attached the 0.16.51 hr-tree-01-a-trunk.png.

Re: How to setup the trunk of tree variations?

Posted: Wed Oct 21, 2020 2:00 pm
by Poutinator
The problem was that I didn't have shadows.

Thank you! That's really helpful. :D