Passing script struct without 'any' type?
Can you pass a struct created in script without using the 'any' type?
ie, do I have to do this:
struct my_struct
{
int foo;
};
void scriptfunc( any this_any )
{
my_struct @this_obj;
this_any.Retrieve( this_obj );
this_obj.foo++;
// Do I need to save the this_obj back into this_any?
}
Sorry if the syntax isn't correct, I don't have my code in front of me right now. Also, can you save a script struct to the application without running a script to create it? I'd rather not fill my script code with CreateMyStruct( any this_any ); like functions. Does CreateScriptObject() do the trick?
thnx
/echo (waiting for script struct methods ;)
*edit*
That script function "scriptfunc" is meant to be called from the application.
[Edited by - e c h o on September 30, 2005 5:51:26 AM]
admit nothing, deny everything and make counter accusations.
Yes, CreateScriptObject() can create the script structure for you. Obtain the type id for the script structure with GetTypeIdByDecl(). The script structure can then be passed to the script function using SetArgObject().
It's not yet possible to register application functions that expect a script structure though. I plan on fixing this, by allowing the application to prototype the script structure, just like it would be done in C++.
Methods for the structures are coming, but I can't say when.
It's not yet possible to register application functions that expect a script structure though. I plan on fixing this, by allowing the application to prototype the script structure, just like it would be done in C++.
Methods for the structures are coming, but I can't say when.
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