Original Post
I'm not sure how this works. I want to make a struct in angelscript that I already registered. Then I want to call a function in angelscript to initialize the struct. So here is what I want to do: The building fails when I call initObjTable(&t); But, if I take out the &t or the *&t in the objTable function, it works fine, so I know it isn't anything else causing the problem. I'm wondering if doing this kind of thing is possible in the scripts, but if not, how can I do it by passing a struct to the host app and then having the host app pass back the struct to angelscript?
void initObjTable(ObjTable *&t)
{
t->img = 0; t->frames = 0;
t->AI = 0; t->dir = 0; t->freq = 0;
t->downTimeMax = 0; t->downTime = 0;
t->depthAdjust = 0; t->bubbleAlways = 0;
t->lightSource = 0; t->lightStrength = 0;
t->sucktion = 0; t->anchorWall = 0;
t->anchorWallDir = 0; t->dieScript = 0; t->visibleScript = 0;
return;
}
bool setObjTable()
{
ObjTable t;
initObjTable(&t);
t.img = 0;
t.frames = GetFrames(t.img);
return false;
}