🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

AngelScript Bug

Started by
0 comments, last by BornToCode 15 years, 10 months ago
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.
Advertisement
Forget it i fix the problem. It was my fault.

This topic is closed to new replies.

Advertisement