Black & White Community

Black & White => Modding and Scripting => Topic started by: Zefire on May 24, 2020, 03:55 am

Title: Trees, Wood, and Global Settings
Post by: Zefire on May 24, 2020, 03:55 am
Don't know if anyone needs this, but I thought I'd just post what I learned.

In the various Land scripts, SET_GLOBAL_LAND_BALANCE(5, 2.000000) controls how much wood you get from each tree.  5 is the setting for Trees-Wood and 2.000000 means each tree will produce 2x the wood. 


So here is how CREATE_NEW_TREE then works.

CREATE_NEW_TREE(Forest#, "X-Cord,Y-Cord",TreeType, ?, Rotation, TreeSizeStart, TreeSizeMax)

Forest#, Not sure why the game assigns a tree to a "forest" but it does.  Think it has something to do with Villagers and chopping them down.  Villagers can't chop down a tree that isn't in a "Forest"

Value   BaseWood   Desc
0      700      Maple
1      500      Eucalyptus
2      700      Bonsai
3      350      Pine, Green
4      350      Pine,Yellow
5      800      Oak, Yellow
6      800      Oak Green
7      500      Birch
8      300      Palm, Straight
9      300      Palm, Crooked
10      300      Palm, Leafy
11      300      Palm, Woody
12      350      Pine, Dark Green
13      15      Bush, Yellow
14      15      Bush, Dark Green
15      15      Bush, Green
16      400      Evergreen, Dense
17      400      Evergreen, Sparse
18      700      Evergreen, Dense
19      700      Evergreen, Sparse
20      100      Fence Bush, Dark Green
21      100      Fence Bush, Light Green
22      0      Dead Tree

?, No idea what this does, but it's always 1.  No noticeable effect with any other value.
Rotation, Self explanatory, Value of 0 will align it with X axis.  Value of 1 Looks like it adds 30 degrees of angle but that's just a guess.
TreeSizeStart, is the what the tree starts at when the match starts
TreeSizeMax, is how big the tree will grow to.  Any values over 1.0 will cause it to exceed the base wood values and size.

Another random fact.  Those "Ancient Forest" contain a base of 15,000 wood, or 43 Green Pines trees if picked by hand.  Villager foresters will also return the same amount to the village store.  Also when those forest reduce in size, they will drop 1 Dark Green Pine sapling which can grow and spread.  That being said, I usually replant "Ancient Forest" forest at the start of every game.  It can produce quite a bit more wood then 15,000 if replanted and left to grow over time.

Anyone know what the other "SET_GLOBAL_LAND_BALANCE" does?  Seems to be 0-6.  4 is villager speed.  6 is on each of the Skirmish maps but I can't tell what it does.  Haven't tested 0-3 yet.
Title: Re: Trees, Wood, and Global Settings
Post by: Zefire on May 24, 2020, 04:01 am
Here's a visual of the trees and their base wood values. (