Skip to content

Game version build conditions seem to not be set properly by ExtendedBuild #38

@ddbb07

Description

@ddbb07

Preface

I'm very novice at .NET programming so this might entirely be my fault, so apologies in advance if that's the case.

Description

I'm trying to use ExtendedBuild to easily build targeting multiple game versions, but it seems as though it doesn't set the proper version conditions.

This is the code snippet in question

The CampaignTime argument for the GetAtmosphereModel function was removed in 1.2.0 so i just have to remove it all for all 1.2.x versions.

    MissionInitializerRecord initializerRecord = new(sceneName)
    {
        // Other properties ...
        AtmosphereOnCampaign = Campaign.Current.Models.MapWeatherModel.GetAtmosphereModel(
#if v100 || v101 || v102 || v103 || v110 || v111 || v112 || v113 || v114 || v115 || v116
            CampaignTime.Now,
            MobileParty.MainParty.GetLogicalPosition()
#elif v120 || v121 || v122 || v123 || v124 || v125 || v126 || v127 || v128 || v129 || v1210 || v1211 || v1212
            MobileParty.MainParty.GetLogicalPosition()
#else
#error DEFINE
#endif
        ),
    };

This code build fine if i target either version group (so 1.0.x and 1.1.x at the same time, or 1.2.x alone), but it fails if i target both version groups in the same build.

The error it gives is: There is no argument given that corresponds to the required parameter 'pos' of 'MapWeatherModel.GetAtmosphereModel(CampaignTime, Vec3)'

So it would seem that it's building one of the 1.0.x or 1.1.x versions as it has both arguments, but it's using the wrong code since it only gets one argument. This makes me believe that the right version condition isn't set.

Is this me doing something wrong, have i misundestood how it's supposed to function, or is ExtendedBuild not behaving as expected. Any help would be appreciated.

Relevant files

supported-game-version.txt
v1.2.12
v1.2.11
v1.2.10
v1.2.9
v1.2.8
v1.2.7
v1.2.6
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.6
v1.1.5
v1.1.4
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.3
v1.0.2
v1.0.1
v1.0.0

.csproj
<Project Sdk="Bannerlord.BUTRModule.Sdk/1.1.0.124">
  <PropertyGroup>
    <Version>0.0.1</Version>
    <TargetFrameworks>net472;net6</TargetFrameworks>
    <Platforms>x64</Platforms>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    <LangVersion>10.0</LangVersion>
    <Nullable>enable</Nullable>
    <BuildForWindows>false</BuildForWindows>
    <BuildForWindowsStore>false</BuildForWindowsStore>
    <ModuleId>$(MSBuildProjectName)</ModuleId>
    <ModuleName>$(MSBuildProjectName)</ModuleName>
    <ModuleUrl></ModuleUrl>
    <GameFolder>$(BANNERLORD_GAME_DIR)</GameFolder>
    <ExtendedBuild>true</ExtendedBuild>
    <!-- Module manually override GameVersion -->
    <!-- <OverrideGameVersion>v1.0.0</OverrideGameVersion> -->
  </PropertyGroup>
  <PropertyGroup Condition="$(TargetFramework) == 'net472'">
    <!-- Steam/GOG/Epic versions of the game -->
    <BuildForWindows>true</BuildForWindows>
  </PropertyGroup>
  <PropertyGroup Condition="$(TargetFramework) == 'net6'">
    <!-- Xbox Game Pass PC version of the game -->
    <BuildForWindowsStore>true</BuildForWindowsStore>
    <EnableWindowsTargeting>true</EnableWindowsTargeting>
  </PropertyGroup>
  <!-- Development Variables -->
  <PropertyGroup>
    <HarmonyVersion>2.2.2</HarmonyVersion>
    <BUTRModuleLoaderVersion>1.0.1.50</BUTRModuleLoaderVersion>
    <HarmonyExtensionsVersion>3.2.0.77</HarmonyExtensionsVersion>
    <!--
    <BUTRSharedVersion>3.0.0.135</BUTRSharedVersion>
    <BUTRModuleManagerVersion>5.0.198</BUTRModuleManagerVersion>
    -->
  </PropertyGroup>
  <ItemGroup>
    <PackageReference
      Include="Newtonsoft.Json"
      Version="13.0.1"
      PrivateAssets="all"
      IncludeAssets="compile"
    />
    <PackageReference
      Include="BUTR.Harmony.Analyzer"
      Version="1.0.1.50"
      PrivateAssets="all"
      IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive"
    />
  </ItemGroup>
</Project>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions