Returning F64 in ConsoleMethods
by Bruce Robertson · in Technical Issues · 05/29/2006 (9:59 am) · 1 replies
I tried returning a F64 in a console method, but received some strange compiler errors (which disappered when I changed it to another data type, i.e F32 / bool etc.
My Method is (simplified version):
ConsoleMethod( AIAffectivePlayer, getRelationshipRating, F64, 2, 2, "()"
"Get Relationship Rating")
{
F64 tempRating;
...
...
...
return tempRating;
}
the errors are:
c:\torque\sdk\engine\game\aiaffectiveplayer.cpp(63) : error C2059: syntax error : ')'
c:\torque\sdk\engine\game\aiaffectiveplayer.cpp(63) : error C2065: 'conmethod_return_F64' : undeclared identifier
c:\torque\sdk\engine\game\aiaffectiveplayer.cpp(63) : error C2146: syntax error : missing ';' before identifier 'cAIAffectivePlayergetRelationshipRating'
c:\torque\sdk\engine\game\aiaffectiveplayer.cpp(63) : error C2664: 'ConsoleConstructor::ConsoleConstructor(const char *,const char *,StringCallback,const char *,S32,S32)' : cannot convert parameter 3 from 'F64 (__cdecl *)(SimObject *,S32,const char **)' to 'StringCallback'
Looking at these errors it seems as if returning this data type is not defined (second line), which would be quite strange.
I am using Torque 1.4 and Visual Studio Express 2005
My Method is (simplified version):
ConsoleMethod( AIAffectivePlayer, getRelationshipRating, F64, 2, 2, "()"
"Get Relationship Rating")
{
F64 tempRating;
...
...
...
return tempRating;
}
the errors are:
c:\torque\sdk\engine\game\aiaffectiveplayer.cpp(63) : error C2059: syntax error : ')'
c:\torque\sdk\engine\game\aiaffectiveplayer.cpp(63) : error C2065: 'conmethod_return_F64' : undeclared identifier
c:\torque\sdk\engine\game\aiaffectiveplayer.cpp(63) : error C2146: syntax error : missing ';' before identifier 'cAIAffectivePlayergetRelationshipRating'
c:\torque\sdk\engine\game\aiaffectiveplayer.cpp(63) : error C2664: 'ConsoleConstructor::ConsoleConstructor(const char *,const char *,StringCallback,const char *,S32,S32)' : cannot convert parameter 3 from 'F64 (__cdecl *)(SimObject *,S32,const char **)' to 'StringCallback'
Looking at these errors it seems as if returning this data type is not defined (second line), which would be quite strange.
I am using Torque 1.4 and Visual Studio Express 2005
Torque Owner Owen Ortmayer