A new version of PyroScript coming soon. The new version now has Pascal/Delphi syntax with a simple and powerful API.

* Compiled script add-on for PyroGine (native code)
* Pascal/Delphi syntax
* Simple & powerful API
* Easily register native objects
* Easily access script define objects

This is the current API for PyroScript 2:
[pascal]procedure Pyro_Script_Reset;
function Pyro_Script_RegisterNamespace(aLevelId: Integer; const aNamespace: PChar): Integer;
function Pyro_Script_RegisterRecordType(aLevelId: Integer; const aTypeName: PChar): Integer;
function Pyro_Script_RegisterRecordTypeField(aTypeId: Integer; const aFieldName: PChar; aFieldTypeID: Integer; aFieldShift: Integer = -1): Integer;
function Pyro_Script_RegisterHeader(aLevelId: Integer; const aHeader: PChar; aAddress: Pointer = nil; aMethodIndex: Integer = 0): Integer;
function Pyro_Script_RegisterClassType(aLevelId: Integer; aClass: TClass): Integer;
function Pyro_Script_RegisterProperty(aLevelId: Integer; const aHeader: PChar): Integer;
function Pyro_Script_RegisterVariable(aLevelId: Integer; const aVarName: PChar; aTypeId: Integer; aAddress: Pointer = nil): Integer;
function Pyro_Script_RegisterTypeAlias(aLevelId:Integer; const aTypeName: PChar; aOriginTypeId: Integer): Integer;
function Pyro_Script_RegisterPointerType(aLevelId: Integer; const aTypeName: PChar; aOriginTypeId: Integer): Integer;
procedure Pyro_Script_AddCodeFromFile(aSyntax: TPyroScriptSyntax; const aFilename: PChar);
procedure Pyro_Script_AddCodeFromArchive(aSyntax: TPyroScriptSyntax; aArchive: TPyroArchive; const aFilename: PChar);
function Pyro_Script_Compile: Boolean;
function Pyro_Script_Compiled: Boolean;
procedure Pyro_Script_Run;
function Pyro_Script_CreateObject(const aClassName: string): TObject;
procedure Pyro_Script_DestroyObject(aObject: TObject);
function Pyro_Script_GetHandle(aLevelId: Integer; const aMemberName: PChar; aCaseSensitive: Boolean): Integer;
function Pyro_Script_GetAddress(aLevelId: Integer; const aMemberName: PChar; aCaseSensitive: Boolean): Pointer;
function Pyro_Script_CallRoutine(aThis, aAddress: Pointer; const aParams: array of const; aCallConv: TPyroCallingConvention; aResult: TPyroResultType; aResultSize: Integer=0): Pointer;
function Pyro_Script_ErrorCount: Integer; stdcall;
function Pyro_Script_Error(aIndex: Integer): PChar;
function Pyro_Script_ErrorMessage(aIndex: Integer): PChar;
function Pyro_Script_ErrorModuleName(aIndex: Integer): PChar;
function Pyro_Script_ErrorLine(aIndex: Integer): PChar;
function Pyro_Script_ErrorLineNumber(aIndex: Integer): Integer;
[/pascal]

Here is a simple example of how to load, compile, run and access script defined objects:
[pascal]procedure native_msg(aMsg: PChar);
begin
MessageBox(0, aMsg, 'debug', MB_OK);
end;

var
Archive: Integer;
I: Integer;
Addr: Pointer;
begin
Archive := Pyro_UnzipArchive_Open('media.arc');

Pyro_Script_Reset;
Pyro_Script_RegisterHeader(0, 'procedure native_msg(s: string);', @native_msg);
Pyro_Script_AddCodeFromArchive(synPascal, Archive, 'media/scripts/simple.pas');
if Pyro_Script_Compile then
begin
Pyro_Script_Run;
Addr := Pyro_Script_GetAddress(0, 'script_msg', False);
if Assigned(Addr) then
begin
Pyro_Script_CallRoutine(nil, Addr, ['SWEET!'], ccREGISTER, rtVOID);
end;
end
else
begin
for I := 0 to Pyro_Script_ErrorCount - 1 do
begin
MessageBox(0, Pyro_Script_Error(I), 'debug', MB_OK);
end;
end;

Pyro_Object_Destroy(Archive);
end.
[/pascal]

This a simple example script that is used in the example code above:
[pascal]// simple script
procedure script_msg(aMsg: string);
var
s: string;
begin
s := 'Calling a script routine from native! ' + aMsg;
native_msg(PChar(s));
end;


begin
native_msg('Cool! Calling a native routine from script');
end.[/pascal]

You can even create an instance of a script defined class and call it's methods. I hope to post a beta build soon.