I am currently getting some issues with compiling my script
AngelScript:
int SpellFire(BaseEntity& spell, BaseEntity& cast, BaseEntity& trg){
return 0;
}
Register
void RegisterBaseEntityAngel(asIScriptEngine *engine){
// Registering the class method
int r = engine->RegisterObjectType("BaseEntity", sizeof(BaseEntity), asOBJ_REF); DYNAMIC_ASSERT(r >= 0, "Error in return result");
r = engine->RegisterObjectBehaviour("BaseEntity", asBEHAVE_ADDREF, "void f()", asMETHOD(BaseEntity, AddRef), asCALL_THISCALL); DYNAMIC_ASSERT(r >= 0, "Error in return result");
r = engine->RegisterObjectBehaviour("BaseEntity", asBEHAVE_RELEASE, "void f()", asMETHOD(BaseEntity, Release), asCALL_THISCALL); DYNAMIC_ASSERT(r >= 0, "Error in return result");
Init
ctx = scriptMgr.GetEngine()->CreateContext();
asIScriptModule *mod = scriptMgr.GetEngine()->GetModule("SpellFuncs");
Function = mod->GetFunctionByDecl(Str8(Stat("Script")->string));
update
ctx->Prepare(Function);
ctx->SetArgObject(0, &T);// Set the function arguments
ctx->SetArgObject(1, cast);// Set the function arguments
ctx->SetArgObject(2, trg);// Set the function arguments
scriptMgr.ExecuteCall(ctx);
int dmg = ctx->GetReturnDWord();
ctx->Unprepare();
Log complaints
Data/Script/Spells/Fire.as (1, 46) : ERROR: : Expected ')' or ','Please correct the errors in the script and try again. (0, 0) : ERROR: : Failed in call to function 'Prepare' with 'null' (Code: -6) (0, 0) : ERROR: : Failed in call to function 'Execute' (Code: -4)
Anyone care to explain what I am doing wrong?
I've tried removing and changing @ to & and without sign
It works if I am using only one BaseEntity.