tModLoader [SOLVED] Modding Help: Compiler Error

rf_illumination

Terrarian
SOLVED :D
I had to use ModCompile_XNA rather than ModCompile_FNA (Releases · tModLoader/tModLoader). I have no idea what the difference is and why using the FNA library previously allowed me to compile mods. I'm so glad it's sorted though.

Hey guys, i'm trying to edit and recompile AlchemistNPC Lite as there's unwanted behaviour in the pricing from one of the NPC's. I haven't changed any of the source code yet (VVV101/AlchemistNPCLite) and i'm getting multiple errors.
Code:
[23:26:21] [15/INFO] [tML]: Building: AlchemistNPCLite
[23:26:22] [15/INFO] [tML]: Compiling AlchemistNPCLite.XNA.dll
[23:26:23] [15/INFO] [tML]: Compilation finished with 0 errors and 0 warnings
[23:26:23] [15/INFO] [tML]: Compiling AlchemistNPCLite.FNA.dll
[23:26:23] [15/INFO] [tML]: Compilation finished with 24 errors and 0 warnings
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\AlchemistNPCLitePlayer.cs(169,64) : error CS0311: The type 'CalamityMod.CalPlayer.CalamityPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'CalamityMod.CalPlayer.CalamityPlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\AlchemistNPCLitePlayer.cs(169,64) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\AlchemistNPCLitePlayer.cs(174,81) : error CS0311: The type 'Redemption.Items.DruidDamageClass.DruidDamagePlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'Redemption.Items.DruidDamageClass.DruidDamagePlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\AlchemistNPCLitePlayer.cs(174,81) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\AlchemistNPCLitePlayer.cs(179,60) : error CS0311: The type 'ThoriumMod.ThoriumPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'ThoriumMod.ThoriumPlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\AlchemistNPCLitePlayer.cs(179,60) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\SpiritComb.cs(47,53) : error CS0311: The type 'SpiritMod.MyPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'SpiritMod.MyPlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\SpiritComb.cs(47,53) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\NinjaSkill.cs(49,64) : error CS0311: The type 'CalamityMod.CalPlayer.CalamityPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'CalamityMod.CalPlayer.CalamityPlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\NinjaSkill.cs(49,64) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\NinjaSkill.cs(56,81) : error CS0311: The type 'Redemption.Items.DruidDamageClass.DruidDamagePlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'Redemption.Items.DruidDamageClass.DruidDamagePlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\NinjaSkill.cs(56,81) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\NinjaSkill.cs(63,60) : error CS0311: The type 'ThoriumMod.ThoriumPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'ThoriumMod.ThoriumPlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\NinjaSkill.cs(63,60) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\MorePotionsComb.cs(56,69) : error CS0311: The type 'MorePotions.MorePotionsPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'MorePotions.MorePotionsPlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\MorePotionsComb.cs(56,69) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.1, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\AlchemistNPCLitePlayer.cs(412,64) : error CS0311: The type 'CalamityMod.CalPlayer.CalamityPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'CalamityMod.CalPlayer.CalamityPlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\AlchemistNPCLitePlayer.cs(412,64) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\CalamityComb.cs(64,81) : error CS0311: The type 'Redemption.Items.DruidDamageClass.DruidDamagePlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'Redemption.Items.DruidDamageClass.DruidDamagePlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\CalamityComb.cs(64,81) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\CalamityComb.cs(69,60) : error CS0311: The type 'ThoriumMod.ThoriumPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'ThoriumMod.ThoriumPlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Buffs\CalamityComb.cs(69,60) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Items\HeartAttackPotion.cs(75,64) : error CS0311: The type 'CalamityMod.CalPlayer.CalamityPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'CalamityMod.CalPlayer.CalamityPlayer' to 'Terraria.ModLoader.ModPlayer'.
[23:26:23] [15/ERROR] [tML]: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\Items\HeartAttackPotion.cs(75,64) : error CS0012: The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
[23:26:23] [15/ERROR] [tML]: Compiling AlchemistNPCLite.FNA.dll failed with 24 errors and 0 warnings
Error: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\AlchemistNPCLitePlayer.cs(169,64) : error CS0311: The type 'CalamityMod.CalPlayer.CalamityPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'CalamityMod.CalPlayer.CalamityPlayer' to 'Terraria.ModLoader.ModPlayer'.
Terraria.ModLoader.Exceptions.BuildException: Compiling AlchemistNPCLite.FNA.dll failed with 24 errors and 0 warnings
Error: C:\Users\Game\Documents\My Games\Terraria\ModLoader\Mod Sources\AlchemistNPCLite\AlchemistNPCLitePlayer.cs(169,64) : error CS0311: The type 'CalamityMod.CalPlayer.CalamityPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'CalamityMod.CalPlayer.CalamityPlayer' to 'Terraria.ModLoader.ModPlayer'.
   at Terraria.ModLoader.Core.ModCompile.CompileMod(BuildingMod mod, String outputPath, IDictionary`2 refs, Boolean xna)
   at Terraria.ModLoader.Core.ModCompile.BuildModForPlatform(BuildingMod mod, Boolean xna)
   at Terraria.ModLoader.Core.ModCompile.Build(BuildingMod mod)
   at Terraria.ModLoader.UI.UIBuildMod.<>c__DisplayClass5_0.<Build>b__0(ModCompile mc)
   at Terraria.ModLoader.UI.UIBuildMod.BuildMod(Action`1 buildAction, Boolean reload)

I think my environment is set up correctly as I can compile other mods just fine. Maybe this mod was designed for an earlier framework? I'm just not sure. I can see that the two errors are:
Code:
The type 'WhateverMod.WhatPlayer.WhateverPlayer' cannot be used as type parameter 'T' in the generic type or method 'Player.GetModPlayer<T>()'. There is no implicit reference conversion from 'WhateverMod.WhatPlayer.WhateverPlayer' to 'Terraria.ModLoader.ModPlayer'.
And
Code:
The type 'ModPlayer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null'.
Your help would be much appreciated. Nearly every link in my browser to a stack overflow page on the subject is purple now and I feel like i'm going in circles. Thanks guys.
 
Last edited:
Top Bottom