Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Scripting

  1. #11

    Re: Scripting

    I'm using Turbo Delphi.

    I'm using v0.4.3 now but that doesn't change anything.

    If I write
    [pascal]function TShip.NextFrame: Boolean;
    begin
    Result := inherited NextFrame;
    end;[/pascal]

    like you suggested it will compile, but then I get the following error written in the console:
    Exception EAccessViolation in module PyroGine.dll at 0000C047.
    Access violation at address 01B6C047 in module 'PyroGine.dll'. Read of address 0
    0000000.
    I've done some tracing and the error appears to occur at the following line:

    [pascal]i := Script.RegisterClassType(0, TShip);[/pascal]

    I'll try and do some more experimenting later on.

    Imagine I've written something clever here inspiring you to make something awesome. If that happens give me credits

  2. #12

    Re: Scripting

    Working on it.... I'll update you soon.
    Jarrod Davis
    Technical Director @ Piradyne Games

  3. #13

    Re: Scripting

    Phew.... ok I think I finally got it resolved now. Turned out to be an issue with Ansi vs Unicode. Everything will be transparent to the developer as far as usage goes, but I had to modify the code base that deals with scripting to handle this particular case. I've tested PGE in Delphi 5 (the lowest version I officially support) through D2010 so it should work for everyone that has been having issues recently. I will post an update shortly.

    Thanks.
    Jarrod Davis
    Technical Director @ Piradyne Games

  4. #14

    Re: Scripting

    Ok cool,

    sorry to bring up bugs in your code
    Imagine I've written something clever here inspiring you to make something awesome. If that happens give me credits

  5. #15

    Re: Scripting

    Ok, I think I got all the latest reported issues resolved now. Please download this build which if there are no reported issues will become the new official v0.4.3 release. I recommend everyone using PGE to upgrade to this build ASAP.

    Some comments:[*]When you update to a new build, make sure the DLLs have been updated and it's best to update any lingering .DCUs in the sdk\delphi folder. [*]Ansi TObject and unicode TObject are different enough that I had to separate out the scripting system. If your using Ansi Delphi you will need to distribute PGScript.dll along with your application. The ansi version of the scripting system is in there. I had to do it this way in order for things to continue working transparently for the developer. PGE is written in D2010 so TObject in the PyroGine.dll is Unicode. When you register a class in D7 for example, the scripting engine will try and register an ansi version which will eventually crash the system. The way I have it now, all should be ok.[*]It is now mandatory to add PGShareMem at the first line in your project uses section. There will be error message displayed if not. This assures that shared memory exist between your app and the PGE DLL so strings and objects are managed properly.

    Ok cool,

    sorry to bring up bugs in your code Laugh
    No worries, it's a good thing really. This helps me to get these problems identified and resolved so thanks to everyone for the feedback.
    Jarrod Davis
    Technical Director @ Piradyne Games

  6. #16

    Re: Scripting

    I've downloaded it and it seems to work fine now.
    At least I could compile your example and run it (after remembering to add PGShareMem)
    Imagine I've written something clever here inspiring you to make something awesome. If that happens give me credits

  7. #17

    Re: Scripting

    Wonderful. Good to know.

    Thanks.
    Jarrod Davis
    Technical Director @ Piradyne Games

  8. #18

    Re: Scripting

    Btw I did get a few warnings about PGShareMem using some deprecated memory classes. Don't know if you are aware of them already (or if you even care), but I thought I would mention them just to make sure you've seen them.

    [Pascal Warning] PGShareMem.pas(23): W1000 Symbol 'THeapStatus' is deprecated
    [Pascal Warning] PGShareMem.pas(39): W1000 Symbol 'TMemoryManager' is deprecated
    [Pascal Warning] PGShareMem.pas(40): W1000 Symbol 'TMemoryManager' is deprecated
    [Pascal Warning] PGShareMem.pas(41): W1000 Symbol 'TMemoryManager' is deprecated
    [Pascal Warning] PGShareMem.pas(53): W1000 Symbol 'TMemoryManager' is deprecated
    [Pascal Warning] PGShareMem.pas(55): W1000 Symbol 'GetMemoryManager' is deprecated
    [Pascal Warning] PGShareMem.pas(82): W1000 Symbol 'SetMemoryManager' is deprecated
    [Pascal Warning] PGShareMem.pas(94): W1000 Symbol 'SetMemoryManager' is deprecated
    Imagine I've written something clever here inspiring you to make something awesome. If that happens give me credits

  9. #19

    Re: Scripting

    Hi,

    Yea I know about them. I will add some conditionals later to prevent this. It's because I have to support older versions of Delphi where in later versions those routines have been replaced by different/enhanced ones.

    Thanks.
    Jarrod Davis
    Technical Director @ Piradyne Games

Page 2 of 2 FirstFirst 12

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
  •