BUTR / BUTR/Bannerlord.BuildResources

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

Open
#38 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
7
Forks
2
PR merge metrics
No merged PRs in 30d

Description

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

```csharp
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

```plaintext
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

```xml


0.0.1
net472;net6
x64
true
10.0
enable
false
false
$(MSBuildProjectName)
$(MSBuildProjectName)

$(BANNERLORD_GAME_DIR)
true





true



true
true



2.2.2
1.0.1.50
3.2.0.77





```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided .csproj and supported-game-version.txt, then inspect how ExtendedBuild defines game-version conditions when multiple version groups are selected. Reproduce a build targeting both the 1.0.x/1.1.x and 1.2.x groups and compare the generated compilation symbols or build output. Done means both groups compile with the appropriate GetAtmosphereModel signature.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.