String arguments to script functions

Started by
1 comment, last by WitchLord 19 years, 8 months ago
Hi I've setup my angelscript engine to use std::string as the native string type. (I explained how in the Constructors/Destructors thread.) This works all fine in most cases. One where it doesn't work though is if I try to send a string as argument to a script function. I do the appropriate SetArguments with a pointer to the std::string and the number of DWORDs (7). In the script the string and all following arguments get trashed. Any idea why? /Anders Stenberg
Advertisement
Never mind this. I had totally misunderstood the stackPos argument.

In the documentation it says:
"The position in the stack to set, relative to the function's stack frame. The argument data should be placed on positions starting with 0 and increasing, i.e the first argument on 0, the second on 1, etc."

I interpreted that as stackPos kinda beeing the argument number. The docs don't really tell that it's based on the argument sizes too. (I.e. first argument is at 0, the second may be at 2, etc.) This could surely be clearer.

/Anders Stenberg
Agreed. I'll try to explain it better in the next release.

Thanks for the feedback.

Actually, there's a whole lot of things that I would like explain better in the docs, but I'm just not that interested in writing documentations so I end up postponing it.

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

This topic is closed to new replies.

Advertisement