Page 1 of 1

Adding new trees and mobs

Posted: Fri Dec 19, 2014 3:14 am
by jaxterity
Hello all.

I am trying to learn how to add new trees (new names that give diff things) as well as new biters or spawn/hives.

I've been looking at base code and trying to copy and paste various bits of code to try to create a new tree but it never seems to place. I've been reading the code for biters/spawn bases and so on but not quite sure how to get/make a new one so I haven't tackled that one yet either.

So I decided to make a post on here and hope you all could help me with this! :) Any tips/helps/examples or so on would be much appreciated.

Re: Adding new trees and mobs

Posted: Fri Dec 19, 2014 8:48 am
by ghosrath
for auto-placing trees i use this:

Code: Select all

local autoplace_utils = require("autoplace_utils")

{
  type = "tree"
  -- rest of properties
  autoplace =
  {
    order = "anOrder"
    peaks = autoplace_utils.peaks({{{35, 0.3}, {5,0}, 0.001}},
                                                 {
                                                    {
                                                         influence = 0.1 -- this tells how many trees there'll be
                                                         noise_layer = "trees"
                                                         noise_persistence = 0.5
                                                    }
                                                 })
  }
}
Play around with the autoplace_utils.peaks settings a bit , i don't know what everything does exactly. (this code is taken from the base game demo-trees.lua)