[s]2) I followed steps from this example code: http://www.angelcode...ddon_array.html to register CScriptArray containing Block_Vector's (it's my custom class). How should I register that kind of array as a global property? I did it this way: [/s]
CScriptArray* resultsV;
RegisterScriptArray(ASM->GetEngine()->m_ptr, true);
asIObjectType* t = ASM->GetEngine()->m_ptr->GetObjectTypeById(ASM->GetEngine()->m_ptr->GetTypeIdByDecl("array<Vector>"));
resultsV = new CScriptArray(1000000, t);
for( int i = 0; i < 1000000; i++ )
{
Block_Vector** p = static_cast<Block_Vector**>(resultsV->At(i));
*p = new Block_Vector(0.0f, 0.0f, 0.0f, 0.0f);
}
ASM->GetEngine()->m_ptr->RegisterGlobalProperty("array<Vector> g_resultsV", &resultsV);
When I use g_resultsV in script in loop, this statement causes crash: g_resultsV[ no ].
It looks like my CScriptArray is totally wrong and uninitialized, it's buffer is NULL.
What should I fix in my code?
I'm using the latest 2.20.3 version of Angel Script.
EDIT:
Ad 2) It was stupid mistake, it was here:
ASM->GetEngine()->m_ptr->RegisterGlobalProperty("array<Vector> g_resultsV", &resultsV);
I passed pointer to pointer, working version looks like this:
ASM->GetEngine()->m_ptr->RegisterGlobalProperty("array<Vector> g_resultsV", resultsV);
EDIT2:
It still crashes :/.
EDIT3:
Again... it was my mistake

Working code:
Block_Vector* p = static_cast<Block_Vector*>(resultsV->At(i);
p = new Block_Vector(0.0f, 0.0f, 0.0f, 0.0f);
But my question number 1 is still open
