Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: PyroScriptび「 v2.0

  1. #1

    PyroScriptび「 v2.0

    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.
    Jarrod Davis
    Technical Director @ Piradyne Games

  2. #2

    PyroScriptび「 v2.0

    Aren't you using Lua anymore?

    Im currently working on a python scripting unit, and looking your methods gave me many ideas to do something similar

    ps: The current pyrogine website are outdated :?
    From brazil (:

    Pascal pownz!

  3. #3

    PyroScriptび「 v2.0

    Not at this time, no. I really wanted to keep with a pascal/delphi syntax since it's my primary development language.

    Oh your working on python scripting. Nice. Let me know if I can be of help. At some point I may release the source to my lua stuff.

    Hmm... site is outdated for you? Tell me, what is the IP you get when you ping pyrogine.com? It maybe the DNS has not updated to your part of the world. Maybe your browser is picking up some cached IPs? Have you tried flushing your browser cache?

    This is how the current site looks:

    Jarrod Davis
    Technical Director @ Piradyne Games

  4. #4

    PyroScriptび「 v2.0

    Yes exactly that website (66.6.102.192) but the last news are from july 2007 and there are no download stuff :?

    you are right pascal syntax for scripting are aways welcome , but i'm python addicted
    From brazil (:

    Pascal pownz!

  5. #5

    PyroScriptび「 v2.0

    The IP should end in .193. The downloads, e-commerce, tutorials and the rest of the site will be back up soon. We've had some hacking issues that I've been dealing with so slowly bringing the site back online as we deal with this and some other problems. New builds should be released soon.

    I wanted pascal syntax, the speed of native code and fast/easy interop between native and script. I wish you success with your python scripting solution. Things must be simple and easy to use yet robust. What I try to do is design from the end user perspective. Keep your API clean with minimal dependencies and be self subscribing.
    Jarrod Davis
    Technical Director @ Piradyne Games

  6. #6

    PyroScriptび「 v2.0

    how can i get pyroscript 1.0 ? i really want it for inspiration

    what are you using for native code, COCO ?
    From brazil (:

    Pascal pownz!

  7. #7

    PyroScriptび「 v2.0

    Check your PM.
    Jarrod Davis
    Technical Director @ Piradyne Games

  8. #8

    PyroScriptび「 v2.0

    Hmm... having some trouble posting. If you did not get my PM drop me an email.
    Jarrod Davis
    Technical Director @ Piradyne Games

  9. #9

    PyroScriptび「 v2.0

    sorry but i forget your mail : mine is arthurprs(at)gmail(dot)com
    From brazil (:

    Pascal pownz!

  10. #10

    PyroScriptび「 v2.0

    Did you get my mail?
    Jarrod Davis
    Technical Director @ Piradyne Games

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL