🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Return values for 1.7.x
I was trying to return a bool value to the host app from the script. here's my code.....
------------------ C++ CODE -------------------------------engine->GetFunctionIDByName("test");
Context->Execute();
DWORD j=0;
Context->GetReturnValue( &j, 0 );
bool bState = (bool)j;
----------------------------------------------------------
----------------- SCRIPT CODE ----------------------------
bool test()
{
OutputDebugMessage("test works!");
return true;
}
----------------------------------------------------------
Is this right? cos I dont seem to be getting results even though i get a debug outputstring!
Change it to
and I believe it will work. You were telling the engine to copy 0 dwords to the j variable, which of course wouldn't work. [wink]
Context->GetReturnValue( &j, 1 );
and I believe it will work. You were telling the engine to copy 0 dwords to the j variable, which of course wouldn't work. [wink]
Oops! seems to be working now? is there anyway i could directly obtain values in the right data type since i think typecasting might be slower.
You can probably do it like this:
bool bState;Context->GetReturnValue( (DWORD*)&bState, 1 );
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement