I have a table that lists terain type and tree type that I want to use per terrain type.
How do I randomly select if I have more than 1 tree type.
In my table below, "grass-dry" has two tree types, "sand" has three.
How can I randomly choose one of these tree types each time I hit the table?
Code: Select all
Bi_Industries.tree_type = {
-- Vanilla
["grass-medium"] = "tree-04",
["grass"] = "tree-05",
["grass-dry"] = "tree-01",
["grass-dry"] = "tree-02",
["dirt"] = "tree-06",
["dirt"] = "tree-07",
["dirt-dark"] = "tree-06",
["dirt-dark"] = "tree-07",
["sand"] = "tree-03",
["sand"] = "tree-08",
["sand"] = "tree-09",
["sand-dark"] = "tree-03",
["sand-dark"] = "tree-08",
["sand-dark"] = "tree-09",
["red-desert"] = "tree-06",
["red-desert"] = "tree-07",
["red-desert-dark"] = "tree-06",
["red-desert-dark"] = "tree-07",
}