• Create Account

## AngelScript 1.8.0c (2004/07/19)

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.

31 replies to this topic

### #1Andreas Jonsson  Moderators

4454
Like
0Likes
Like

Posted 10 July 2004 - 09:06 AM

I've finally decided to release version 1.8.0. Lot's of things have been done for this version. Let's see if I can give a summary of them here: There is no longer a built in bstr type. Instead the application needs to register its own type. This change was made to add flexibility in how strings are passed between script and application and vice versa. For those who have come acustomed to the bstr type I've made a small library for registering that type with complete compatibility. It is now possible to overload compound assignment operators as well. Scripts can now be compiled into separate modules, each with their own namespace. This is especially useful if you have two scripts with the same interface but different implementations, e.g. AI routines for different types of entities. The STDCALL calling convention is now supported as well, which means that Win32 API functions can be registered directly with the library. It is now possible to enumerate and access global variables declared in the scripts. This could for example be used for saving script states. The interface for registering functions and methods have changed slightly in preparation of improvements coming in version 1.8.1. Other changes you'll find in the change log as usual. I'll spend the following days updating the articles to conform to the new version. PS. I decided to postpone the switch-case implementation for the next version. [Edited by - WitchLord on July 19, 2004 8:30:40 PM]
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

### #2 Anonymous Poster_Anonymous Poster_*   Guests

0Likes

Posted 11 July 2004 - 08:00 PM

Great job WitchLord!!!!!!!!!!!

can acces to global vars, i love you :-D.

when a struct or class implementaion :-?

Thanks for all!!!

Gunder.

140
Like
0Likes
Like

Posted 11 July 2004 - 09:03 PM

Still running on 1.7.1a will update ASAP. need to put out some time on this.

Is there any way in which i can get VS.NET to decide to enable syntax highlighting on AS script files? will help a lot!!!
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.

### #4SiCrane  Moderators

11529
Like
0Likes
Like

Posted 11 July 2004 - 09:08 PM

Quote:
 Original post by EddHeadIs there any way in which i can get VS.NET to decide to enable syntax highlighting on AS script files? will help a lot!!!

There was a thread on syntax highlighting in VS .NET a while ago. Though if you decide to use the registry hack and you're using 7.0, you'd use the 7.0 key instead of the 7.1 key.

140
Like
0Likes
Like

Posted 12 July 2004 - 12:15 AM

Thanks a lot, but i found something on the net already. kinda helpful too since AS code is very much C++-ish!
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.

### #6Andreas Jonsson  Moderators

4454
Like
0Likes
Like

Posted 12 July 2004 - 01:13 AM

Gunder:

Thanks, I'm happy you liked the new features. I don't know when support for structs or classes will be added. I haven't planned that far ahead. It will most likely be at least 3 or 4 months before I add that support.

You will that most of the work will be with the way you register functions and objects with AS. It's shouldn't be too hard to upgrade to 1.8.0. Hopefully you will also find the new features useful, though perhaps you've already come too far in your project to really take advantage of them.

Could you post a link to what you found about syntax highlighting in VS.NET? Either here or in the thread that SiCrane mentioned would be ok. Thanks.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

### #7zola  Members

122
Like
0Likes
Like

Posted 12 July 2004 - 02:02 AM

Hi

I get an access violation error in my String assignment behaviour, this is very strange because it worked with WIP5.
Any suggestions what might have changed?

### #8zola  Members

122
Like
0Likes
Like

Posted 12 July 2004 - 02:46 AM

sorry,
I just realized that it didn't work with WIP5 so, the question is not what has changed, but what do I have to change :))

I do the following for assign behaviour:

#define asFUNCTION4(c,r,f,p) asFunctionPtr((asFUNCTION_t)( (r(*)p)c::f) )r = engine->RegisterTypeBehaviour("String", asBEHAVE_ASSIGNMENT, "String& f(const String&)", asFUNCTION4(StringBinding,String&,StringCopy,(const String&,String&)), asCALL_CDECL_OBJLAST); assert( r >= 0 );String& StringBinding::StringCopy(const String& src, String& dst){  dst=src; // Error occures here when memcpy is called  return dst;}

String is an extension of std::string.
src is assigned a value but dst points to some weard place.

The funny thing is that the add assign operation works. The following script code does not bail out.

String s;s+="Hello World";

Any hints?
Tom

### #9zola  Members

122
Like
0Likes
Like

Posted 12 July 2004 - 03:31 AM

I have this code
String s="hello";

How many time must the string factory be called?
Two Times?
1 anonymous string _anon:"hello";
2 string s:"";
and then assign the string _anon to s.

Or one time for string s init with char array "hello" ?

However I' expect that the factory is called for the string s at least one time. But when I trace the calls only the anonymous string gets a factory call. S is held uninitialized.
Do I understand that right, is this behaviour intentional?

Regards
Tom

### #10zola  Members

122
Like
0Likes
Like

Posted 12 July 2004 - 04:00 AM

**sigh**
ok, next time I swear I'll take a closer look at my source first.
I forgot the constructors.... shame on me...

### #11Andreas Jonsson  Moderators

4454
Like
0Likes
Like

Posted 12 July 2004 - 05:27 AM

Just to clarify: The string factory function is only called for string constants. It is used for converting the string constants to whatever type the application has registered for handling strings.

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

### #12LDenninger  Members

122
Like
0Likes
Like

Posted 12 July 2004 - 09:29 AM

I can't imagine the next lines are intended this way ?

(as_scriptengine.h @ Line 960...)

if( systemFunctions[n]->returnType.GetSizeOnStackDWords() > 2 )
systemFunctions[n]->hostReturnMethod = asCALL_RETURNBYREF;
else
systemFunctions[n]->hostReturnMethod = asCALL_RETURNBYREF;

Since this if-statement is useless, the code for 'complex' objects compiles to the exact same code as the code for 'non-complex' objects...

### #13Andreas Jonsson  Moderators

4454
Like
0Likes
Like

Posted 12 July 2004 - 10:39 AM

Quite useless indeed. ;)

I'll look into it as soon as possible. I guess my tests didn't cover that part of the code.

Thanks for letting me know, Lennart.

Regards,
Andreas

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

### #14Andreas Jonsson  Moderators

4454
Like
0Likes
Like

Posted 12 July 2004 - 02:09 PM

I've just uploaded version 1.8.0a that has a couple of bug fixes. One of them is very important for those that intend to use modules as only first module did compile correctly. The second (and any other modules) wasn't able to compile any function calls as the function ID got out of range. The other bug is the one Lennart mentioned above. In fact, both of the bugs were discovered by Lennart.

I think I need to improve my release program and have three library versions available for download at any one time: The current stable one, a feature complete beta version, and the work in progress. I'll probably start with this for the next release.

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

140
Like
0Likes
Like

Posted 12 July 2004 - 07:11 PM

i dont remember the link but heres the .reg file code. name it as a reg file and change the extention to use as required
----------------------------------------
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Languages\File Extensions\.as]
@="{B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}"
-----------------------------------------

maybe i will use the features in 1.8.0 but i am looking for a decent C++ syntax but thats it. i havent yet thought of what and how i will use the rest of the features. but will keep everyone

Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.

### #16zola  Members

122
Like
0Likes
Like

Posted 13 July 2004 - 04:05 AM

Hi
Still working with Strings ;) which seem to work from time to time. I have the following script

void dir(String path, String filter){   CDirectory* dir=getDirectory();   dir->setFilter(filter);   dir->changeWorkingDirectory(path)}void main(){   dir(".", "*");}

This script doesn't work. it bails out when i call 'dir'.
But if I make the parameters call by ref 'void dir(String& path, String& filter)' everything works just fine.

I don't think this has something to do with the way I registered the string class, does it?

Btw: the error occures at line 69 in ac_array.h / access violation
this signatur works too void dir(String path, String& filter)
maybe something with the parameter passing for the registered string class doesn't work since passing multiple Integers etc. is working too...

[Edited by - zola on July 13, 2004 10:05:53 AM]

### #17Andreas Jonsson  Moderators

4454
Like
0Likes
Like

Posted 13 July 2004 - 05:59 AM

It could have something to do with how you registered the assignment behaviour function. This function is used to effectively assign a copy of your string to the parameter when sending it by value.

I'm not sure how the access violation for ac_array.h comes into the picture, I'll have to do some debugging.

Would it be possible for you to write a small test case in the test framework that reproduces the error and send it to me? That would help me find the problem. You'll find the test framework on the download page.

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

### #18zola  Members

122
Like
0Likes
Like

Posted 13 July 2004 - 08:00 AM

Hi Andreas

I send You the testcase as email.
BTW. I linked against the debug version of angelscript I hope this doesn't matter.

### #19zola  Members

122
Like
0Likes
Like

Posted 14 July 2004 - 02:00 AM

I have tracked the runtime error with vc7.1 to this location
file as_context.cpp
void asCContext::CleanStack(){  // TODO: Increase the numActiveContexts when cleaning the stack  // Run the clean up code for each of the functions called  CleanStackFrame();  while( callStack.GetLength() > 0 )  {    PopCallState();    asCScriptFunction *func=engine->GetScriptFunction(functionID);    byteCode = func->byteCode.AddressOf();    CleanStackFrame();  }}

'func' appears to be a null pointer at some time which causes the access violation call to ac_array.

### #20Andreas Jonsson  Moderators

4454
Like
0Likes
Like

Posted 14 July 2004 - 02:45 AM

OK, thanks.

I'll add an assert to the method and run the tests again. If func is null at any time for MSVC6 as well I should be able to find the bug. If it is indeed null for MSVC6 as well, it is very strange that I don't get an access violation though.

I will give the VC++ .NET 2003 Toolkit another try tonight. I hope that the debug output is compatible with MSVC6 so that I can debug the library, otherwise it will be a lot tougher for me to find any error.

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.