Jump to content
  • Advertisement
Sign in to follow this  
Milleniumas

RegisterGlobalProperty in 2.13.00

This topic is 3816 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?).

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!