Getting meta data for Script Object's member
As the title says, I'm trying to get meta data for a member variable in a script class using the Script Builder.
To grab the meta data, I need the variable's (property's) global property id. But all I can grab about the property from the script object is the name and typeId.
So where can I get the property ID?
I'd rather not have to iterate through all the variables in the script engine.
[Edited by - Wavesonics on May 26, 2009 2:59:55 PM]
I'm not sure what exactly you're asking. If you can get a property's name and type ID that means that you already have the property ID since you need that in order to query the asIScriptObject for the name and type ID. From the type ID you can use asIScriptEngine's member functions GetTypeDeclaration() and/or GetObjectTypeById() to find out more about the type of a given property.
*edit*
I was confused, in the example I assumed things were being smarter than they were:
[factory func = CreateOgre, editable: myPosition, editable: myStrength [10, 100]] class COgre { vector3 myPosition; int myStrength; }
I thought "editable: myPosition" would bind to that variable or something, sorry... just being stupid again.
FYI WitchLord: the ScriptBuilder's Metadata tutorial uses a deprecated function: asIScriptEngine::GetGlobalVarCount()
[Edited by - Wavesonics on May 26, 2009 3:44:15 PM]
Quote: Original post by Wavesonics
FYI WitchLord: the ScriptBuilder's Metadata tutorial uses a deprecated function: asIScriptEngine::GetGlobalVarCount()
Thanks, I'll update the manual.
--
The metadata implementation in CScriptBuilder can obviously be improved a great deal. I just implemented the minimum to show how it can be done without changing the core library.
If you make any improvements to it and want to share with the rest of the community, I'd gladly update the version in the library.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement