Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: stuh505 on Thu 03/03/2005 02:13:52

Title: AGS API?
Post by: stuh505 on Thu 03/03/2005 02:13:52
I've seen the AGS plugin API thing...but I'm not sure that's what I want.

Basically, I would like to bypass the AGS scripting editor...and just do all my scripting in C++...but be able to call internal AGS functions from there.  I haven't seen any AGS cpp/h files available for download though.

Can I get some feedback on what would be the best way to do this?
Title: Re: AGS API?
Post by: scotch on Thu 03/03/2005 02:22:43
Well, the API is what you want really, just request hooks to the events that you need scripts for (probably all of them), calling script functions seems harder, I haven't needed to do that but I can't see a way directly.  You could write wrapper functions in AGS using in parameters and call them using CallGameScriptFunction...
It strikes me as a bit pointless though, one of the reasons scripting languages are added to game engines is to enable you to develop rapidly, without the clutter and unneeded complexity of scripting the gameplay in a real programming language.
Title: Re: AGS API?
Post by: stuh505 on Thu 03/03/2005 03:10:54
QuoteIt strikes me as a bit pointless though, one of the reasons scripting languages are added to game engines is to enable you to develop rapidly, without the clutter and unneeded complexity of scripting the gameplay in a real programming language.

The AGS scripting language does not offer the kind of control that I need in order to program my game.  I have spent a significant amount of time using the AGS language already, but due to it's limitations, I have found it extremely inefficient to program some mathematical situations...and I expect to have many more.  I will also be writing my own language parser.  And I also want to have much more control over what gets displayed on the screen...for instance I want a text log. 

All in all, I would much rather be able to just write the whole thing using C++...so all I need is some libraries from the AGS API in order to give me access to the internal functions.  Wrapper functions do not make sense...
Title: Re: AGS API?
Post by: RickJ on Thu 03/03/2005 03:49:55
Quote
All in all, I would much rather be able to just write the whole thing using C++...so all I need is some libraries ...

Here are a few...
http://www.talula.demon.co.uk/allegro/
http://www.libsdl.org/index.php
http://gamedev.sourceforge.net/
http://vz4.sourceforge.net/
http://www.openrpg.com/
http://www.grinninglizard.com/kyra/
http://www.swig.org/exec.html
http://gameq.sourceforge.net/index.php?page=info
http://www.questml.com/editor/

And there are many more at source forge
sourceforge.net (http://sourceforge.net)

Hope this is helpful to you ...
Title: Re: AGS API?
Post by: stuh505 on Thu 03/03/2005 04:15:05
Rick,

Actually...I meant libraries for the AGS API...but I had no idea there were more basic libraries existing just for making games...thanks a lot for those links.  I think I'll try that.
Title: Re: AGS API?
Post by: Pumaman on Thu 03/03/2005 19:09:31
Exposing all the script commands externally via COM or something might be possible, but would be a large amount of work for relatively little use.

Two possible solutions:
1) Write a C++ AGS plugin to perform your mathematical calculations, and then call it from the script when you need them done.
2) If the AGS script language is lacking something that's necessary for what you're trying to do, you're free to suggest it as an enhancement.
3) The final option, of course, if you want complete control over the game is to write your own engine from scratch, though that involves a significant amount of effort as I'm sure you can imagine.
Title: Re: AGS API?
Post by: Scorpiorus on Sat 05/03/2005 20:30:39
As for calling AGS internal script functions from within the plugin take a look at GetScriptFunctionAddress from the API.

By the way, handling script logic via a plugin would also mean you have to take care of saving/restoring all plugin variables that have something to do with the current game state, unlike script variables that are automatically saved/restored by the engine itself.
Title: Re: AGS API?
Post by: Rui 'Trovatore' Pires on Sun 06/03/2005 11:57:38
Speaking of which, does the flashlight plugin STILL not save its state? If not, and seeing as it's been a long time since I last saw it's author, is it at all possible for anyone to edit it him/herself and make that much-needed change?
Title: Re: AGS API?
Post by: Scorpiorus on Sun 06/03/2005 12:22:08
Practically speaking, the source code of the plugin is really needed to make any changes. So, contacting the author may be a way to go. But I'm not certain whether the latest available version of the plugin doesn't save its state.