Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 1 more developer from Canada and 12 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


Member Since 06 Jul 2011
Offline Last Active Nov 25 2012 11:51 AM

Topics I've Started

More advanced parsing & script section order

21 September 2012 - 03:47 PM


I've took a look into the scriptbuilder-addon and saw, that you store includes first and then include right after the full file has been parsed.
This has some negative consequences which breaks sequential pre-processor commands.

Is this realized this way because of a better design or is the order in which script sections are added to a module important?
Maybe I'm on a complete wrong way.. Does AngelScript even take care of script appearance? Does the order matters?

Secondly, I'm trying to get the exact token return which asCTokenizer::GetToken returns.
Is there a way to get the eTokenType-value without hacking?

Thanks in advance!

Using AngelScript namespace causes linker error (VC11)

21 September 2012 - 09:14 AM


I'm using Visual Studio 2012 and MSVC11 and get linker errors when using RegisterStdString function from the string addon when I enable namespaces.
I don't know if this is also the case for older compiler versions.

Fails with two linker errors (RegisterStdString and RegisterStdStringUtils):
[source lang="cpp"]#define AS_USE_NAMESPACE#include <angelscript.h>#include <add_on/scriptstdstring/scriptstdstring.h>using namespace AngelScript;void test(){ asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); RegisterStdString(engine); RegisterStdStringUtils(engine);}[/source]

Compiles like a charm:
[source lang="cpp"]#include <angelscript.h>#include <add_on/scriptstdstring/scriptstdstring.h>void test(){ asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); RegisterStdString(engine); RegisterStdStringUtils(engine);}[/source]
Is this a bug or am I doing something wrong?
Thanks in advance!

Edit: The forum removes include paths for some reason.
These are the files included:


Edit 2: Of course I'm compiling both scriptstdstring.cpp and scriptstdstring_utils.cpp.

Threading of multiple engines

17 September 2012 - 02:04 AM


I'm about to create a threaded environment of totally seperated engines.
I found this page in the documentation: http://www.angelcode...ultithread.html

It says something about threading, but I don't think this matches my situation.
I want to have about four totally seperated scripting engines which DO NEVER come in interaction with another engine.

Another question is: DO I need four engines? Couldn't this be solved using four contexts?

Also, the scripts are allowed to access only thread local variables and functions.
So I am doing right with not implementing thread-safety mechanism?

Are there other points I have to look at?

Modules / Imports?

20 July 2012 - 06:03 AM

Hello everybody,

I'm fairly new to AS and I've read to the whole documentation twice to get a feeling for the design and the patterns.
But there are two very important questions that were not answered:

1.) Is there module functionality? E. g. like in scripting languages as Python? I think I've read somewhere in the documentation that it is there, but I can't find any examples. I've also read somewhere that it is not possible to share variables through modules even when they are in the same context / execution environment. But this is a feature I need. What do you do for example, if you have such a large script, that it is impossible to structure it in one file? This is some times the case for my needs.

2.) What exactly is an "import"? I've read somewhere that you can "import" functions. Is this the same as using modules?

I'm thankful for answers!

Implementing a map; arrays in arrays?

06 July 2011 - 05:18 PM

completly new to AngelCode I've read in and found it very interesting. It is very well documentated, I like that! At this point, a big THANK YOU to WitchLord :wink:
I hope you understand that I ask these questions before I start to implement AngelCode, otherwise it would be much work without a sense.

1) Is it possible to create a map (like std::map)? I do hope so, but my hope is gone since I've searched in the forums and read that multiple template types are not possible. Even if not, would there be a possiblity to implement a stringmap or something equivalent? Hope is also not great since the opIndex-operator only takes int as argument, so myvar["x"] seems to be unavailable.

2) Is there a way to store arrays in arrays, to create a matrix? Firstly, I've got it right that array in AngelCode is nearly the same as std::vector in C++, right? Example: array<array<array<int>>>

3) Is there any documentation about modules? I think I don't fully understand what they are. Are they equivalent to modules in Python?