Class registration problem

Started by
11 comments, last by Maega 15 years, 3 months ago
Quote:Original post by WitchLord
That last error is probably due to opening the script file in text mode, instead of binary mode. If opening the script file in text mode, the line endings may get translated from CRLF to just LF, thus producing a shorted script buffer than the file size.


I'm passing the script text to Angelscript via a std::string. I'm using Angelscript inside of a browser plugin, so the script text comes from a text file on a web server. If I output it to a message box, it looks right. Would you suggest I do it another way?

Advertisement
Does the script length correspond with strlen(scrípt.c_str())?

Obviously the parser is trying to find more tokens beyond the end of the script, and the only way it will do that is if your telling AngelScript in AddScriptSection that the script is longer than it really is.

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

Quote:Original post by WitchLord
Does the script length correspond with strlen(scrípt.c_str())?

Obviously the parser is trying to find more tokens beyond the end of the script, and the only way it will do that is if your telling AngelScript in AddScriptSection that the script is longer than it really is.


That's what it was. I messed up a memcpy which made me miss the null terminator. I was getting junk at the end and didn't notice. It was intermittent which made it fun to find.

This topic is closed to new replies.

Advertisement