Jump to content
  • Advertisement
Sign in to follow this  
BornToCode

AngelScript Bug

This topic is 3749 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

using the string class. If you create a global variable of that type and then pass that to the c++ side, when you get the object address it gives me garbage. if i do this it works. class MM { string switchName; MM(){ switchName=""; } } MM mm; void CheckIfItemCollected(Sprite& s) { Map@ map = GetCurrentMap(); string mapName; map.Name(mapName); mm.switchName = "hasItem"+mapName+s.name; Print("1"+mm.switchName); if (game.GetGlobalVariable(mm.switchName) == SWITCH_ON) { Print("2"+mm.switchName); s.visible = false; s.Release(); } else { Print("3"+mm.switchName); game.SetGlobalVariable(mm.switchName,SWITCH_OFF); } } but if i do not use the class and just use string switchname as a global variable then it crashes when i pass switchname to GetGlobalVariable.

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!