Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: a-v-o on Tue 24/06/2003 23:33:21

Title: delphi plugin tutorial: Upgrade: direct use of script function
Post by: a-v-o on Tue 24/06/2003 23:33:21
In this new version there is a new unit (U_AGS_script_functions.pas). This unit wraps the access to many AGS script functions, so that they can be used in the plugin like normal delphi functions:

procedure CenterPlayerCharacter;
begin
       MoveCharacter (GetPlayerCharacter, 160, 100);
end;

Not all script functions are wrapped yet. And I only tested PlaySound, so you have the chance to become an alpha tester  ;D .

One function isn't available :o : IsSpeechVoxAvailable
Maybe CJ can check why GetScriptFunctionAddress doesn't give a pointer for this function.

More script functions will be available soon or on request.
Title: Re:delphi plugin tutorial: Upgrade: direct use of script function
Post by: Scorpiorus on Wed 25/06/2003 09:35:05
Good work, a-v-o. :)

Quote from: a-v-o on Tue 24/06/2003 23:33:21One function isn't available :o : IsSpeechVoxAvailable
it's a defined alias. Original name IsVoxAvailable. ;)

p.s.
I have some 'c'-written declarations. Maybe I could provide them as well. Unfortunately it takes a time to write the whole interface list of functions (+parameters). The number of AGS user functions has rised up well for the last (two) year(s).


-Cheers
Title: Re:delphi plugin tutorial: Upgrade: direct use of script function
Post by: a-v-o on Wed 25/06/2003 10:29:59
It seems, that you're right. In the help file there is the keyword IsVoxAvailable in the index and it shows IsSpeechVoxAvailable.
OK, I redirect this. Thanks.

thanks for offering the c-code. I got the current list by copy and paste the declarations from the help file and then reformat them. Took me about 2 hours.

To do this work once is ok, but I fear the updates. It would be good to have a complete list of declarations, so that I could compare the old and new versions to see which functions are added (or removed).
Title: Re:delphi plugin tutorial: Upgrade: direct use of script function
Post by: Pumaman on Wed 25/06/2003 22:26:20
Good work!

As for the updates, whenever a new AGS version is released, the changelog always lists any new text script functions, so it shouldn't be too difficult to just add those.
Title: Re:delphi plugin tutorial: Upgrade: direct use of script function
Post by: a-v-o on Wed 25/06/2003 23:53:13
Oh, CJ, so I should read the changelog?  :o Hmmm... I'll give it a try.  ;)

Version (..._255b.zip):

- added room / screen functions.

- Changed error handling during initialization:
I realized that an error message was shown, but the game started though. Now AbortGame is called so that the game won't start, if an error occured (e.g. missing script functions).

I suggest, everybody who uses the tutorial as base of his/her dlls, copy and paste all below the unit line from AGS_delphi_tutorial.dpr into his/her own AGS*.dpr. Or do a file diff and replace the different lines.