Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

Return values for 1.7.x


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 EddHead   Members   -  Reputation: 140

Like
0Likes
Like

Posted 31 August 2004 - 03:52 AM

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!
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3267

Like
0Likes
Like

Posted 31 August 2004 - 03:56 AM

Change it to


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]
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 EddHead   Members   -  Reputation: 140

Like
0Likes
Like

Posted 01 September 2004 - 04:47 AM

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.
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.

#4 Andreas Jonsson   Moderators   -  Reputation: 3267

Like
0Likes
Like

Posted 01 September 2004 - 06:03 AM

You can probably do it like this:


bool bState;
Context->GetReturnValue( (DWORD*)&bState, 1 );

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#5 EddHead   Members   -  Reputation: 140

Like
0Likes
Like

Posted 01 September 2004 - 07:47 PM

Tried it.......Doesnt seem to work, the older method works though!
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS