General Category > Private Alpha Discussion

Modding Difficulties

(1/2) > >>

BadgerBadger:
I am trying to do a test of the modding capabilities of AI War 2 on my linux box to try to make it easier to get more Science. I note there's already a "Debug Give Science", which is what I'm looking for, but for some unknown reason it's not showing up in the in-game UI. 

That aside, when I try to build the AIWarExternalCode.csproj project, I get some errors. I tried xbuild and monodevelop and get the same error in this snippet of code. Here is the output from xbuild:

Errors:

/home/steam/AIWar2/AIWarExternalCode/AIWarExternalCode.csproj (default targets) ->
/usr/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) ->

   src/UIs/Window_InGameNonUnitActionMenu.cs(117,28): error CS1110: `Arcen.AIW2.External.NonUnitActionMenuModeExtensionMethods.GetIsAllowed(this Arcen.AIW2.External.NonUnitActionMenuMode)': Extension methods require `System.Runtime.CompilerServices.ExtensionAttribute' type to be available. Are you missing an assembly reference?
   src/UIs/Window_InGamePlanetActionMenu.cs(173,28): error CS1110: `Arcen.AIW2.External.PlanetActionMenuModeExtensionMethods.GetIsAllowedFor(this Arcen.AIW2.External.PlanetActionMenuMode, Arcen.AIW2.Core.Planet)': Extension methods require `System.Runtime.CompilerServices.ExtensionAttribute' type to be available. Are you missing an assembly reference?
   src/UIs/Window_InGameUnitActionMenu.cs(223,28): error CS1110: `Arcen.AIW2.External.UnitActionMenuModeExtensionMethods.GetIsAllowedFor(this Arcen.AIW2.External.UnitActionMenuMode, Arcen.AIW2.Core.GameEntity)': Extension methods require `System.Runtime.CompilerServices.ExtensionAttribute' type to be available. Are you missing an assembly reference?


    public static class NonUnitActionMenuModeExtensionMethods
    {
        public static bool GetIsAllowed( this NonUnitActionMenuMode Item ) <==== This seems to be one of the troublesome lines
        {
            switch ( Item )
            {
                case NonUnitActionMenuMode.Tech:
                    return true;
                case NonUnitActionMenuMode.DebugTracing:
                    return true;
                default:
                    return false;
            }
        }
    }

I am running mono 4.4.2

BadgerBadger:
I found a workaround to this; posting here if anyone else needs it. I created the following  file:

 [user@hostname UIs]$ pwd
~/AIWar2/AIWarExternalCode/src/UIs
[
user@hostname UIs]$ cat ExtenstionAttribute.cs
 namespace System.Runtime.CompilerServices
 {
   public class ExtensionAttribute : Attribute { }
 }

And now it compiles happily, and I'm pleased to inform you that rewiring the "Give Metal" button to "Give Science" works.

keith.lamothe:
Wonderful! Thanks for testing, and for reporting how it went :)

BadgerBadger:
If you're here, why doesn't the "Give Science" button appear? The code all seems to be there.

keith.lamothe:
As shipped, it's commented out in the xml.

     <!--
     <element type="Button" x="0.0" y="48.0" width="10" height="6" type_name="bGiveScience" />
     -->

Navigation

[0] Message Index

[#] Next page

Go to full version