• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

lincore

Recruit
2 Badges
Mar 16, 2012
5
0
  • Europa Universalis III: Chronicles
  • 500k Club
When starting Skylines it fails to compile my mod complaining that it couldn't find the ColossalFramework namespace. I've seen the framework used in other mods, so I wonder what I am doing wrong. I assume that the source file is all I need to add to the Source directory, right?
Any ideas?
Thanks.


PS. Here's my code (don't laugh :~)
Code:
//mods/InfographMod/Source/InfographMod.cs:
using System;
using ColossalFramework;
using ICities;


namespace InfographMod
{
    public class Mod : IUserMod {
        const string MOD_NAME = "Graphs, I guess";
        const string MOD_DESCRIPTION = "Provides historical graphs documenting your cities' development.";
        public string Name { get { return MOD_NAME; } }
        public string Description { get { return MOD_DESCRIPTION; } }
    }

    public class LoadingHook : ILoadingExtension {
        public void OnCreated(ILoading loading) {}

        public void OnLevelLoaded(LoadMode mode) {
            if (mode != LoadMode.LoadGame || mode != LoadMode.NewGame) return;
            if (!Singleton<StatisticsManager>.exists) return;
            StatisticsManager statistics = Singleton<StatisticsManager>.instance;
            var crimestats = statistics.Get(StatisticType.CrimeRate);
            CODebug.Log(LogChannel.Modding, "Crime Rate: " + crimestats.GetLatestFloat().ToString());
        }

        public void OnLevelUnloading() {}
        public void OnReleased() {}
    }
}
 
Ah! I've already set up a solution in vs 2013 but I was under the assumption that skylines' compiler would produce the same result as if I built the binary myself. Thanks for pointing this out, though!