Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


- - - - -

String arguments to script functions


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Dentoid   Members   -  Reputation: 122

Like
0Likes
Like

Posted 04 August 2004 - 09:04 AM

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

Sponsor:

#2 Dentoid   Members   -  Reputation: 122

Like
0Likes
Like

Posted 04 August 2004 - 09:18 AM

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

#3 Andreas Jonsson   Moderators   -  Reputation: 3418

Like
0Likes
Like

Posted 04 August 2004 - 02:53 PM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS