please help
it is good ???
http://www.imagup.com/data/1154961190.html
please help
it is good ???
http://www.imagup.com/data/1154961190.html
Last edited by kakarot; Jun 21 2012 at 16:29.
What's your question? What are you trying to do?
Two small questions:
1) In the example code on the wiki:
And calling it in Arma2:Code:using System.AddIn; using AddInView; namespace MyPlugin { [AddIn("MyPlugin")] public class MyPlugin : Arma2NetMethodAddIn { public string Hello() { return "Hello world!"; } } }
How would you call the Hello method in Arma2 with parameters/arguments?Code:_result = call compile ("Arma2Net.Unmanaged" callExtension "MyPlugin [Hello]");
2) What's the difference between Arma2NetMethodAddIn and Arma2NetAddIn? I noticed they are both used throughout the various examples on the Wiki.
Thank you very much.
If it was for example
Then you'd useCode:using System.AddIn; using AddInView; namespace MyPlugin { [AddIn("MyPlugin")] public class MyPlugin : Arma2NetMethodAddIn { public string Hello(string blah) { return "Hello world!"; } } }
First element of the array is always the method name, and any elements of the array after that are considered the method's arguments.Code:_result = call compile ("Arma2Net.Unmanaged" callExtension "MyPlugin [Hello, asdf]");
Arma2NetAddIn is the most generic addin type. It does not support any of the fancy stuff (e.g. direct calling of methods) like what Arma2NetMethodAddIn does, but Arma2NetAddIn lets you customise how you use and call it. I use it with PythonPlugin and RubyPlugin. It does not analyse the arguments and directly passes them on to the Run method.
Code:_result = call compile ("Arma2Net.Unmanaged" callExtension "Py 1+1");
Arma2NET 1.11 changelog:
- Added a scripting system, allowing C# code to be modified at runtime. Errors and warnings are stored in the Arma2NET log.
- Overhauled the Arma2Net.Managed.Expressions namespace.
- Format.SqfAsDouble now uses an invariant culture to improve portability.
- Improved readability of logs and added additional information.
Any code using the Arma2Net.Managed.Expressions namespace might need a recompile.
Documentation about the new scripting system can be found here: https://bitbucket.org/Scott_NZ/arma2net/wiki/Scripts
Download:
ZIP: https://bitbucket.org/Scott_NZ/arma2...a2NET-1.11.zip
Installer: https://bitbucket.org/Scott_NZ/arma2...aller-1.11.msi
Awesome, you rock!
Another question, in Bridge.cpp, I'm running into the "ResultTooLong" exception. How is this determined? Is there a hard limit as part of the Arma2 method for passing data? I'm curious how you are calculating it because I need to account for it and return appropriately. Cheers!
It's passed from Arma 2. Arma2NET has a mechanism for dealing with this - the maxResultSize parameter you've probably seen. With Arma2NetMethodAddIn, you can mark your methods with [MaxResultSize] and then add an 'int maxResultSize' parameter. As long as you don't return something longer than this then it should be fine. If this is too much effort then just make sure you don't return a result >4095 characters.
Ahh, I had forgotten about this:
http://community.bistudio.com/wiki/E...considerations
Given that a character is stored as one byte in C#, it's limited to 4000 characters (thus 4 Kilobytes)?
Just a heads up:
There's currently a bug with the new scripting feature which I thought I fixed but it looks like it has gotten past my testing. Make sure that you have at least one line before the C# code such as a blank line or a #r directive.
Also, because of how Mono.CSharp works it'll probably trip up when you try to #r System.dll for example due to there being multiple versions of it. Try to specify the full path to it.
Small Arma2NET 1.11.1 update released:
- Fixed issue where script files were being read wrongly.
- Renamed #r directive to //reference so that files can compile normally.
The Scripts wiki page has been updated accordingly.
https://bitbucket.org/Scott_NZ/arma2...NET-1.11.1.zip
https://bitbucket.org/Scott_NZ/arma2...ler-1.11.1.msi