AGS API?

Started by stuh505, Thu 03/03/2005 02:13:52

Previous topic - Next topic

stuh505

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?

scotch

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.

stuh505

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...

RickJ


stuh505

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.

Pumaman

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.

Scorpiorus

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.

Rui 'Trovatore' Pires

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?
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Scorpiorus

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.

SMF spam blocked by CleanTalk