• 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.

Zarine

Field Marshal
134 Badges
Feb 28, 2007
4.827
689
  • Europa Universalis IV: Res Publica
  • Gettysburg
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Majesty 2 Collection
  • March of the Eagles
  • Europa Universalis III Complete
  • For the Motherland
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler: Cold War
  • The Showdown Effect
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Hearts of Iron IV: No Step Back
  • Crusader Kings II: Sword of Islam
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • A Game of Dwarves
  • Commander: Conquest of the Americas
  • Darkest Hour
  • East India Company Collection
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
I want to start a mod with the available API, however, I'm facing a big issue with the initial "using" declarations.
The Debug Journal inform me with the following error :
"Error CS0246: The type or namespace name 'UnityEngine' could not be found. Are you missing a using directive or an assembly reference?"

Here is the current source :
Code:
using ICities;
using UnityEngine;
 
namespace MyMod
{
  public class MyMod: IUserMod
  {
    public string Name { get { return "My Mod"; } }
    public string Description { get { return "This is my mod"; } }
  }
 

}

I'm taking the using directly from the wiki modding API page, so what am I doing wrong?
 
Somehow I was able to pass it now without any real change...

And I'm unable to add "using ColossalFramework.UI;" with the same error while I see other using it without any problems.
 
Are you using Visual Studio for developing the mod?

If so, have you added references to UnityEngine.dll, ICities.dll, Assembly-CSharp.dll, ColossalManged.dll in your Solution Explorer? (Right click References then Add References, Select Browse and go to the \Steam\steamapps\common\Cities_Skylines\Cities_Data\Managed folder and select those files and click Add) .. Now you shouldn't get anymore errors.
 
I have it installed already for work related stuff and indeed that solved my issue and I have my little test working.

However it's a bit sad that the ingame built in one is not working because it seems way nicer for debugging (changing something in the source makes it recompile and launch it immediatly with the change).
Maybe I should open a bug report so that they improve it.
 
Thank you very much.

Do you know if there is something more efficient than compiling, launching game, testing, closing game, compiling, launching...
Like possibility to skip the launching/closing part?
 
If you read the post about setting up VS that i linked earlier, it says at the end of that post on how to make it pretty much reload the mod without closing the game.