Skip to content

Releases: int19h/Bannerlord.CSharp.Scripting

C# Scripting 1.3.0

28 Aug 23:52
Compare
Choose a tag to compare

Support for Bannerlord 1.8.0.

Generate .csproj file in addition to omnisharp.json for the Scripts folder; fixes various code completion issues when editing scripts in VSCode.

C# Scripting 1.2.0

13 Jun 02:56
Compare
Choose a tag to compare

Support for Bannerlord 1.7.2.

C# Scripting 1.1.1

12 Sep 21:18
Compare
Choose a tag to compare

Fix crash when starting a new campaign.

C# Scripting 1.1.0

12 Sep 06:36
Compare
Choose a tag to compare

Requires Bannerlord 1.6.x.

Sample scripts are updated for Bannerlord 1.6.x.

Scripts can ignore visibility and access non-public members directly without using Reflection.

Scripts can use preprocessor symbols to detect Bannerlord version at compile-time.

Scripts can implement SubModule.OnGameStart and register custom campaign behaviors.

Generated .rsp file enables code completion for members coming from #loaded scripts regardless of path.

C# Scripting 1.0.0

28 Feb 01:41
Compare
Choose a tag to compare

Major rewrite: different syntax for defining and calling scripts, per-campaign scripts, more helper globals etc. See the README for details.

WARNING: scripts written for csx 0.1.0 and 0.2.0 have to be ported to work with the new version. Given a script such as:

// test.csx
foreach (var arg in Arguments) Log.WriteLine(arg);

the easiest way to adapt it is to wrap it in a params function:

// test.csx
void test(params string[] Arguments) {
  foreach (var arg in Arguments) Log.WriteLine(arg);
}

csx 0.2.0

23 Jan 16:11
Compare
Choose a tag to compare
csx 0.2.0 Pre-release
Pre-release

Scripts for csx.run are now loaded from ...\Documents\Mount and Blade II Bannerlord\Scripts.
WARNING: existing scripts are not moved automatically! If you're already using v0.1.0, you'll have to move them manually.

csx.eval can now evaluate statements, and not just expressions. Due to limitations of the Bannerlord console, you have to use use ., in lieu of ;.

Script state (declared variables etc) is preserved between invocations of csx.eval. Thus, it's possible to store an object reference to a variable, and then repeatedly re-use it in the console. A new command, csx.reset, was added to clear the state.

Since there's no longer a limit on console output in Bannerlord, Log.Write...() goes to console only by default. Use Log.ToFile() to also log to a file. If script fails with an exception, all output produced with Log.Write...() is still printed to console, right before the error message.

Implicit namespace imports used by csx.eval are now configurable via ...\Documents\Mount and Blade II Bannerlord\Configs\csx.xml.

csx 0.1.0

24 May 01:32
Compare
Choose a tag to compare
csx 0.1.0 Pre-release
Pre-release

Initial release.