RegisterGlobalProperty in 2.13.00

Started by
1 comment, last by Milleniumas 15 years, 9 months ago
It seems that registering a global property in AS is a problem to me. int KB_SPACE = 57; r = ScriptEngine->RegisterGlobalProperty("int KB_SPACE",&KB_SPACE); assert(r>=0); output in screen: Image Hosted by ImageShack.us<br/> It outputs 258? How is it possible? And I checked few times, it seems like not my mistake (or is it?).
Advertisement
The call to RegisterGlobalProperty is correct.

But it seems that the value that the address points to changes. Is the KB_SPACE variable in a global scope? Or is it a local variable? AngelScript stores the address of the variable, so you must make sure the variable stays valid for the duration of the script engine.

Perhaps you have some memory invasion somewhere. Have you tried setting a breakpoint to determine where the value of KB_SPACE changes?

Regards,
Andreas

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

Delete this thread, because It seems that I have managed to figured it out. Definately my mistake. Sorry to bother you :)

This topic is closed to new replies.

Advertisement