API update needed please

Started by goodohman, Wed 17/11/2010 23:15:19

Previous topic - Next topic

goodohman

Hello CJ, I hope you'll have the time for this.

1. The API needs exposing of the new Audio objects and Attributes (anything else?)

2. BTW I've noticed that GetManagedObjectAddressByKey() never seem to return NULL, only addresses with 8 bytes increments.

3. for GetScriptFunctionAddress() - which f() are considered "script functions"? those which are not instantiated object methods? like Room.foo() and Screen.foo() ???

4. Could you PLEASE expose the managed objects' names?

Thanks!

Oh yes... in the risk that I might get kicked out - is there any way to remove a rectangle from being updated in your OnPaint?
or is it an absolute necessity to actually edit the raw BITMAP and that's it? (re the DirectShow flickering problem)

Thank you some more!



monkey0506

I'm not 100% certain on this..but I'm pretty sure that "script function" just refers to any function within the AGS script, regardless of whether it's a member function or not.

Also, seeing as none of the managed objects have names outside of the context of their own respective game projects, I don't see how that could be useful within an engine plugin. I mean, what good would cEgo or gMygui do you in the plugin API if the game in question might not even have those? And AFAIK there's no way in C++ to convert a string into a script object of the same name (no variable variables).

goodohman

Thanks monkey,

Do you mean that extender functions can also be taken?
Then how do you use them in this way???

The prime reason for using the names...
I was thinking of going away from AGS scripting at all, and using C# plugin to script ALL the game (much like the XAGE dude was suggesting for his XAGE Editor). Then, I would only call a HandleMyAction() function in the plugin within key events in the AGS game, actually most of them can be called from the unhandled_event event, and the others can be called by RequestEventHook() within the plugin itself.
This way, I can have ALL the game scripted inside the DLL with all the ease and benefits of C# and .NET
So, to keep synchronization between the AGS objects, I didn't want to have a conversion table, but rather call the objects by their name.
One good possibility is to use .NET's Dictionary<String, AGSxxx> then for example, upon a room enter event,
the AGSObjects, hotspots,etc... is being "filled" in the current dictionary, and to access an object I just use a string indexing, for example AGSObjects["oDoorKey"] which returns a reference to that object.
So I wanted to have the names so I can "connect" them to the right object when doing the loop on the engine->GetNumObjects()... but since there are no names within the objects, I thought that actually I can enumerate all the objects from WITHIN the AGS script, then I can have all the names within the plugin.
I hope my explanation makes sense :)

btw:
One interesting "side effect" of using this approach is, that by changing the game's "logic" dll, you can actually change all how the game evolves (all the story line) while still keeping all the "materials" (graphics, rooms, audio, etc...)


Pumaman

Quote from: goodohman on Wed 17/11/2010 23:15:19
1. The API needs exposing of the new Audio objects and Attributes (anything else?)

Good point, the AudioClip stuff should be exposed to the plugins.

Quote
2. BTW I've noticed that GetManagedObjectAddressByKey() never seem to return NULL, only addresses with 8 bytes increments.

When would you expect it to return null? Where did you get an invalid key from?

Quote3. for GetScriptFunctionAddress() - which f() are considered "script functions"? those which are not instantiated object methods? like Room.foo() and Screen.foo() ???

You can use GetScriptFunctionAddress to get any of the built-in AGS script functions. For example, PlayVideo is a script function.
Character.Tint is a script function (though the struct member functions are requested as "Character::Tint" to GetSCriptFuntionAddress);

Quote4. Could you PLEASE expose the managed objects' names?

What do you mean?

goodohman


Hello CJ! It's a great honor to meet your maker :)
Apologize for the long delay, I have not been here (or there) for some time.

1. API - you'll probably want to add AudioChannel and Attributes as well?

2. I thouhgt that it would return null with any unregistered object

3. How would you use then a class method in the code?

4. The internal names used in the editor for the objects/hotspots/etc...

Thanks!

Pumaman

1. yes it needs audio channels too

2. The GetManagedObjectAddressByKey function asks you to pass in a key, not an object

3. Pass the actual object as the first parameter

4. ah ok, I see what you mean

SMF spam blocked by CleanTalk