Sign in to follow this  
Dentoid

String arguments to script functions

Recommended Posts

Dentoid    122
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

Share this post


Link to post
Share on other sites
Dentoid    122
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

Share this post


Link to post
Share on other sites
WitchLord    4678
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this