Cool tool, Voyager!
One example of use.
Suppose I want to record the coordinates of the unit.
Initially, when you load the mission in the file Init.sqf (Init.sqs), write
Code:
_initialized = ("ArmA2Ext" callExtension "init");
hint format ["Init: %1",_initialized];
Next, somewhere in the script call
Code:
a=call compile ("ArmA2Ext" callExtension format["MyExample.SavePath %1",_path]);
where in _path - point array (formatted looks like "[[1,2,3],[1,2,4]]").
MyExample.SavePath looks like this:
Code:
//@ArmA2Ext\Sources\SavePath.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using ArmA2;
namespace MyExample {
public class SavePath: IExtension {
public string Call(string args) {
StringBuilder builder = new StringBuilder();
builder.Append(args.Trim());// trim whitespaces from " [[1,2,3],[1,2,4]]"
builder.Append(";\n\n");
File.AppendAllText(@"e:\temp\path.txt", builder.ToString());// @ needed or write double slash "e:\\temp\\path.txt"
return builder.ToString().Length.ToString();
}
}
}
File SavePath.cs may lie in any folder inside the @ArmA2Ext\Sources\ - engine will find it by namespace in file (MyExample).
Arrays of coordinates will be found in the file e:\temp\path.txt