Jump to content
  • Advertisement
Sign in to follow this  
Dentoid

String arguments to script functions

This topic is 5066 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

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

Share this post


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