Jump to content
Sign in to follow this  
Maestro

С#.NET to ArmA2 Script Compiler

Recommended Posts

Hi guys,

Recently I started a project: that have main target: compile .NET project to sqf scripts for ArmA2.

What prompted:

Having some experience in creating scripts for A2, constantly faced with the problem of the lack of a normal editor and debugger scripts A2 like VisualStudio.

Therefore, the idea to write recompiler.

Scripts are written in a familiar C#.NET or VB.NET

Interested in the question whether there are similar projects already? Has no desire to spend time reinventing the wheel.

I've searched but found no

What do you this about this? Will this tool usefull, or it can dead today :)

Now I have some working compiler prototype that can compile. NET script to SQF and supports about ~15% commands of ArmA2 API (from Wiki).

http://code.google.com/p/arma2warfare/source/browse/#svn%2Ftrunk%2FTools%2Fa2script.net

Edited by Maestro

Share this post


Link to post
Share on other sites
What do you this about this? Will this tool usefull, or it can dead today

Very interesting idea meastro. I think the main issue with these kinds of front-end tools (which I've considered myself in the past) are ...

1) The number of people who are willing to use a 'proper' programming language is probably smaller than the number of those who are willing to pick up 'scripting'. Ie you're going to be appealing to quite a small subset of users.

2) It becomes unclear just what subset of the native environment is supported (can I write LINQ queries over enumerators for example?) , meaning that you are probably pushing this to an even smaller set of programmers than in #1.

3) Any system that provides a significant transformation between source and executable formats means that the debug experience is going to be horrible. Ie, debugging machine-generated sqf in arma is going to be pretty unpleasant.

Wrt debugging, C#/VB would certainly provide a much richer grammar and framework but the other major issue is that almost any 'real' script relies on input from the engine. Even now, squint is quite close to being able to run sqf in a virtual environment so debugging a simple list-sort algorithm is quite conceivable. As soon as you hit a 'native' function such as addAction though, your are into the world of trying to emulate much of the arma engine. There are over 500 of those native functions last time I looked so even if you were willing to put the work in, it's quite a big project to create a virtual debugger. Last time I polled opinion on the skype dev channel there was very little interest in such a thing (even amongst active developers).

Anyway, I don't wish to sound negative - it does sound like a very interesting project and I would be interested to see how it progresses :)

Edited by sbsmac

Share this post


Link to post
Share on other sites

>can I write LINQ queries over enumerators for example?

Yes you can

var pos111 = new double[] {1, 1, 1, 1, 1, 1, 1, 0};

var pos1 = pos111.Where(m => m != 0).ToArray();

Will compiled To

_source = [1, 1, 1, 1, 1, 1, 1, 0];

_numArray2 = [_source, {

Private["_m","_res"];

_m = _this;

_res = if !(_m == 0) then { true } else {false};

_res;

}] call SystemLinq_EnumerableWhereOfTSource call SystemLinq_EnumerableToArrayOfTSource;

>There are over 500 of those native functions last time I looked so even if you were willing to put the work in, it's quite a big project to create a virtual debugger.

virtual debugger and interact with arma2 environment is not my target.

This is a very difficult task. In which will always be behind, because API arma2 constantly changing

Edited by Maestro

Share this post


Link to post
Share on other sites

Seems like to me this IS reinventing the wheel, in a way. If a compiler can be made for C# into sqf, and you say the primary reasons are .net metaprogramming tools and the vs IDE(I presume?), why not instead work on an SQF ide and new sqf extensions, with their own compiler to turn it into regular sqf. Seems there'd be a lot less work, and a lot more results.

Share this post


Link to post
Share on other sites
Seems like to me this IS reinventing the wheel

VisualStudio has a set of tools and plug-ins to facilitate and accelerate the development and quality improvement.

And if start develop own IDE specifically for SQF obtain (mac squint) - lack of these tools. In this case, I did not see the point to do anything and use a notepad (or squint), ie leave everything as it is now.

Although ideally it would be if BIS would forego its scripting language in favor of industrial languages JAVA or C#.NET. Make public API (.NET or java) for use and manipulate arma objects from high level languages.

In this case do not need reinvent the wheel specialized IDE for SQF

Share this post


Link to post
Share on other sites

There is a commercial IDE for VBS based on NetBeans.

It was shown on the developers website for a while, but has been eventually removed.

In any case it was pretty much doing all the basic things you expect from an IDE for the

given environment.

Developer site: http://www.simcentric.com.au/

Edited by .kju [PvPscene]

Share this post


Link to post
Share on other sites

hmm interesting. But I think this tool is not supported by ArmA2 or in future by ArmA3. This tool special for VBS which probably has C/C++ interfaces for intergration, but A2 does not have :(

Edited by Maestro

Share this post


Link to post
Share on other sites

From what I know it was before the time VBS had gotten the C++ interface.

They considered to release a free version at some point, yet for some reason decided otherwise unfortunately.

I cannot judge if you approach is useful or not. Just pointing out that others have

completed an adaptation of an IDE for SQF. That's all. :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×