Jump to content

[Question] Trouble with Seed spawn on Biomes


Recommended Posts

So again hello everyone. Its been a while since I'm working on Dupes Cuisine Mod, which is available on Steam here. I'm updating this mod, and introducing a new crop and recipes. However I'm facing a trouble while trying to force the seeds of these news crops in the vanilla biome. The code I'm using to archive this is as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using Harmony;
using ProcGen;

namespace Dupes_Cuisine
{
    public class Plant_Subworld_Patch
    {

        public List<string> tags { get; private set; }

        [HarmonyPatch(typeof(SettingsCache), "LoadFiles")]
        public static class KakawaSeed_Patch
        {

            internal static void Postfix()
            {
                foreach (WeightedBiome weightedBiome in SettingsCache.subworlds["subworlds/forest/ForestStart"].biomes)
                {

                    weightedBiome.tags.Add("KakawaSeed");
                }
                Debug.Log(string.Join(",", SettingsCache.mobs.MobLookupTable.Keys.ToArray<string>()));
            }
        }
    }
}

If I place any vanilla game seeds ids on this, it works perfectly. The seeds will spawn on the selected biome, alright. However, if I use any of my mod's seeds ids, it don't work. I'm no expert in C#, and I'm still learning a lot on how to properly code for ONI. With this said, I just want tips on how to archive this with my seeds ids. Anyone could point me the right direction on how to solve this?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
×
  • Create New...