

Scott_NZ
Member-
Content Count
161 -
Joined
-
Last visited
-
Medals
-
Medals
-
Everything posted by Scott_NZ
-
Arma2NET 2.2 Arma2NET is a wrapper used for communicating between managed code and SQF code used in the game Arma 2, adding significant functionality to SQF scripting. Arma2NET gives you the ability to use the .NET Framework from Arma 2. It is designed to be an alternative for those who don't want to use C or C++ with callExtension or Java and the JVM. There is a wide range of language implementations that target the Common Language Runtime, so you can use C#, Python, VB.NET, F#, Ruby code and more, directly from Arma 2. A list of languages that you can use can be found here. Features - Call managed functions and manipulate the return value from SQF. - Check the status of long-running managed functions from SQF using callbacks. - Convert SQF literals (lists, strings, numbers etc) to .NET objects and back. - Extend the functionality of Arma2NET by writing plugins written in any language that compiles to .NET bytecode, such as C#, F# or VB.NET. Included plugins - BaseFunctions - CommandLine (get command line used to start Arma 2) - DateTime (get system time/UTC time) More plugins - IronPython code executor/evaluator. Run .py script files and more from your system. - IronRuby Requirements To use Arma2NET you must be running Arma 2 version 1.62 or later, and .NET Framework 4 Client Profile (Download it from http://www.microsoft.com/download/en/details.aspx?id=24872). Microsoft Visual C++ 2010 must also be installed (Download it from http://www.microsoft.com/en-us/download/details.aspx?id=8328). Documentation Wiki home: https://bitbucket.org/Scott_NZ/arma2net/wiki/Home Getting started with Arma2NET: https://bitbucket.org/Scott_NZ/arma2net/wiki/Getting_started Introductory tutorial: https://bitbucket.org/Scott_NZ/arma2net/wiki/Tutorial Dev-Heaven: https://dev-heaven.net/projects/a2n Please create a ticket for bugs/features at https://dev-heaven.net/projects/a2n/issues or https://bitbucket.org/Scott_NZ/arma2net/issues Example C#: using Arma2Net.AddInProxy; namespace MyPlugin { [AddIn("MyPlugin")] public class MyPlugin : MethodAddIn { public string Hello() { return "Hello world!"; } } } SQF: _result = call compile ("Arma2Net.Unmanaged" callExtension "MyPlugin [Hello]"); hint _result; Changelog Download ZIP archive: https://bitbucket.org/Scott_NZ/arma2net/downloads/Arma2NET-2.2.zip MSI installer: https://bitbucket.org/Scott_NZ/arma2net/downloads/Arma2NET-2.2.msi Any other downloads can be found here: https://bitbucket.org/Scott_NZ/arma2net/downloads
-
Try making Arma2NET.log readonly.
-
What version of Arma2NET are you using?
-
You can redistribute the @Arma2NET folder, per the license: http://www.apache.org/licenses/LICENSE-2.0.html
-
The Mono .dll is only intended for Mono for Windows. It's not going to work on Linux natively (Wine might work but I can't help you with that). https://github.com/ScottNZ/Arma2NET/tree/linux has what I'm up to regarding Linux support, but it isn't quite finished. If you read over the last few pages in this thread you should find some instructions on how to get it working in some fashion.
-
If it all works you can try running it on an Arma 3 server. Try placing the .so in the server root folder and have an Addins subfolder with the usual things inside there.
-
If you want to test the current Linux code, make sure you have a recent enough version of 32-bit Mono (can try 64-bit but I doubt it will work on the Linux server later) and MonoDevelop and then do the following: 1. git clone https://github.com/ScottNZ/Arma2NET.git 2. cd Arma2NET 3. git checkout linux 4. Build Arma2Net.sln with a reasonably recent version of MonoDevelop, or edit the .sln and .csproj files with a text editor to downgrade the version if you want to use an old version. You'll have to upgrade MD or downgrade the .sln if the .sln opens in the MD text editor instead of actually opening as a sln. It'll probably partly fail (but Arma2Net.Addins should still build, which is what we're after) since I have a C++/CLI project in there which MonoDevelop isn't going to understand. 5. Copy the built Arma2Net.Addins.dll and the DateTime etc addins into the Linux directory, keeping the folder structure, so have Arma2Net.Addins.dll in there and an Addins folder, with a DateTimeAddin subfolder and DateTimeAddin.dll inside the subfolder. 6. Use 'make' in the Linux directory to build Arma2Net.so and RVExtensionTest 7. Test by using ./RVExtensionTest and then trying eg 'DateTime now' in the prompt.
-
I've been focusing on implementing Linux support over this, but progress has been slow without testers.
-
No. It's a hard limit imposed by the game itself. If you want to return results larger than what it allows you'll have to split your results up into chunks and return each chunk separately.
-
Do you need argument parsing as well?
-
There's a basic example of an async addin here. MethodAddin is on the roadmap.
-
Yes. You can export multiple addins from the same assembly if you need more granularity, or have a look at the source for AsyncAddinInvocationMethod and adapt it to your needs.
-
You can easily assign an integer identifier yourself when calling and return it later as part of a result string.
-
Probably something like: "Arma2Net" callExtension "Foo" where Foo is an addin that uses AsyncAddinInvocationMethod. It's invoked asynchronously, and the result is added to a queue when it's finished. You can then use "Arma2Net" callExtension "Foo getresult" to get a result at the front of the queue. It's also removed from the queue at that stage. I also recently added an option for just throwing away results instead of queueing them, and an option for clearing all the results.
-
It's missing a few things like the Format class (can still borrow it from the old A2N if you need it atm) but if people are happy with this I could go ahead and prepare it for a proper release. I also noticed that some people have forked A2N and made their own additions. If they want to get them pushed back upstream that would be awesome too.
-
Can you paste your Arma2NET logs and Arma2MySQL logs (if applicable)?
-
hint ("Arma2Net.Unmanaged" callExtension "ClrVersion"); etc work fine for me. I also compiled with VS 2012 Update 3.
-
It should be catching that and returning "throw \"ResultTooLong\"" if the result is too long, and truncating bytes if there are too many in all cases.
-
You can use whatever database system you want. Arma2NET itself doesn't really have a bearing on this database stuff. Most of the actual work is left to the external plugins.
-
Not at the moment since last I checked the callExtension sqf command only works on Windows servers.
-
If you want to compile/execute the string returned from Arma2NET as SQF code then yes. If you are just doing simple string operations, then usually not.
-
[SP] The Day of the Camel - A Hitman style assassination mission
Scott_NZ replied to celery's topic in ARMA 2 & OA - USER MISSIONS
I'm getting the same problem of the dealer running away. I also had the warlord run away from me into the distance too. I've reproed this on 1.62 with and without the beta patch and without mods. -
Try public override string Invoke(string args, int maxResultSize) { return DateTime.Now.DayOfWeek.ToString("D"); } and "Arma2Net.Unmanaged" callExtension "EDDayOfWeek"
-
hint ("Arma2Net.Unmanaged" callExtension format ["SQLstats [pGUID, '%1']", _clientID]) Untested
-
Since you can only use callExtension with plain strings, you need to use format or concatenate/insert/append/etc the string value of your variable to the callExtension argument string.