[solved]Biomes and wild animal spawns

Started by Mightyrick1, April 28, 2016, 02:16:18 PM

Previous topic - Next topic

Mightyrick1

So I have been working on a mod that contains a new animal, the badger, and I've been having some trouble trying to get them to spawn naturally. I've taken a look at the BiomeDef.xml and found the <wildanimals> part, although when I tried to add my animal in there the game wouldn't load the biomes. Does anyone have any experience in this field?
Amateur modder / YT LPer at www.tiny.cc/DDYoutube
mods : Elysian Flags - Mscarsonelle's theme

RemingtonRyder

I'd guess it's an XML problem. Possibly incorrectly closed tags? I've done that myself. A lot.

Mightyrick1

The only code from the biomeDef I ended up using was the defname and the name itself so it would hopefully override the temperate forest list, or rather add my badger to the wildanimal list with a commonality of .5, I tried multiple times and double checked the tags a lot. It seemed like it should have worked, but I'm not sure about it at all. And before someone asks, yes I did include tags that allow badgers to spawn in the wild
Amateur modder / YT LPer at www.tiny.cc/DDYoutube
mods : Elysian Flags - Mscarsonelle's theme

Mightyrick1

Found a workable fix for now, not sure if it messes with compatibility in any way whatsoever, but it works for now.
Turns out you have to copy the entire biome info otherwise things will go haywire, I made the mistake of assuming that if I only wrote a line or 2 that indicated that badgers spawn with a commonality of 0.5 that it would put it in the code, but it probably erased the rest of the biome data, which would explain the error.
Amateur modder / YT LPer at www.tiny.cc/DDYoutube
mods : Elysian Flags - Mscarsonelle's theme

skullywag

dont do it in the biome def you can do it directly in the racedef:


<race>
      <wildBiomes>
        <li>
          <biome>IceSheet</biome>
          <animal>Badger</animal>
          <commonality>1</commonality>
        </li>
        <li>
          <biome>Tundra</biome>
          <animal>Badger</animal>
          <commonality>1</commonality>
        </li>
      </wildBiomes>
</race>


;)
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Mightyrick1

I'll be damned. Learning something new every day :P

Cheers skullywag!
Amateur modder / YT LPer at www.tiny.cc/DDYoutube
mods : Elysian Flags - Mscarsonelle's theme