I was trying to write a script that uses generic local functions, which is a C# 7.3 feature. I also tried to use Math.Clamp() at some point. Neither seems to be possible out of the box in RunUO (might also apply to ServUO)?

Is there a simple fix for this?

Edit: Editing the .cproj file in the Scripts/ subfolder doesn't seem to do anything.
 
Default RunUO ScriptCompiler can't use language more than C# 4 or 5.
To make this work you need to rewrite a bit default CSharpCodeProvider in ScriptCompiler and start using Roslyn compiler what supports lang version like C# 7.3, etc

Another one method - it's stop using the ScriptCompiler and compile scripts yourself via IDE (i.e. Visual Studio) . Means the same way as the server core is assembled (means Server folder). Also it's possible to move Scripts and Server folders in one project, in this case you will have only one exe file as output.

Also look at how the current compilation works in the latest ServUO builds, they support version C# 7.3, and are also launched using .NETCore
 
Back