Jump to content
  • Advertisement
Sign in to follow this  

AngelScript Bug

This topic is 3564 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
Sign in to follow this  

  • Advertisement

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!