Adding new trees and mobs

Place to get help with not working mods / modding interface.
jaxterity
Inserter
Inserter
Posts: 26
Joined: Sun Nov 09, 2014 7:26 am
Contact:

Adding new trees and mobs

Post 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.
ghosrath
Burner Inserter
Burner Inserter
Posts: 13
Joined: Mon Jul 28, 2014 8:56 am
Contact:

Re: Adding new trees and mobs

Post 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)
Post Reply

Return to “Modding help”