Page 1 of 1

Leaves and trunk have to have the same amount of levels

Posted: Sun Nov 11, 2018 2:39 pm
by darkfrei
How to reproduce:
Change both frame_count to 1:

Code: Select all

for i, tree in pairs (data.raw.tree) do
  if tree.variations then
    tree.variations = {tree.variations[1]}
    tree.variations[1].trunk.hr_version = nil
    tree.variations[1].leaves.hr_version = nil
    tree.variations[1].trunk.frame_count = 1 -- here must be more than leaves.frame_count
    tree.variations[1].leaves.frame_count = 1
  end
end
But this code has no problem:

Code: Select all

for i, tree in pairs (data.raw.tree) do
  if tree.variations then
    tree.variations = {tree.variations[1]}
    tree.variations[1].trunk.hr_version = nil
    tree.variations[1].leaves.hr_version = nil
    tree.variations[1].trunk.frame_count = 2
    tree.variations[1].leaves.frame_count = 1
  end
end

Re: Leaves and trunk have to have the same amount of levels

Posted: Sun Nov 11, 2018 2:44 pm
by darkfrei
Also, now leaf_generation and branch_generation cannot be nil, there is another error.

Re: Leaves and trunk have to have the same amount of levels

Posted: Sun Nov 11, 2018 4:11 pm
by Rseding91
Thanks for the report. I've improved the error for 0.17. It's actually checking that:

If you have shadows defined: shadow frame count must be == leaves frame count + 1

If you don't have shadows defined: trunk frame count must be == leaves frame count + 1