AngelScript 2.2.0 WIP 5 (2005/05/31)

Started by
41 comments, last by kaysik 18 years, 10 months ago
Quote:I've made a small addition for WIP 3: auto handles.


This might convince me to finally make the jump away from 1.10.

Quote:The book Game Scripting Mastery, looks like an interesting read. Maybe I'll pick it up, although I usually don't read a lot of books (I prefer separate articles on the internet). Thanks for the tip.


I expect you will find the book boring. Not because it is a bad book, but because you could write it better. It is at a level you have far exceeded.
Advertisement
It's good to hear that I'm finally able to move people over from 1.10. :)

Thanks for the tip about the book. I suppose I won't pick it up after all then.

I probably wouldn't have in either case. Programming books on specific topics are rather scarse here in Brazil, and imported books are very expensive.

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

I've uploaded the 4th WIP of version 2.2.0, this time adding support for object handles in struct members. To make the engine able to handle potential circular references that are now allowed, a garbage collector was implemented. Currently this garbage collector must be invoked manually with a call to engine->GarbageCollect(), but I intend to make the GC incremental and allow the application to configure the engine to invoke it automatically.

I also added a new preprocessor flag AS_MAX_PORTABILITY which disables support for native calling conventions such as cdecl, stdcall, and thiscall. Only asCALL_GENERIC is available when this flag is defined. The benefit is that this should make the library work on any platform/compiler. If anyone has other compilers and/or platforms that have not yet been confirmed I would appreciate it if you could test this for me. Example: PS2, Mac, Metrowerks Codewarrior, etc.

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

Quote:Original post by WitchLord
It's good to hear that I'm finally able to move people over from 1.10. :)


Really, I'd like to go to 2.x !

How can I, in 2.x, call register Windows API such as MessageBox witch needs a LPCTSTR without writing wrappers ?

AbrKen
You could do it by registering a type that holds a pointer to a char array, and then pass that type by value to the MessageBox function.

But I don't recommend doing it like this because it wouldn't be safe. If you have a type that stores a pointer to a char string, it will be possible for the scripts to access invalid pointers, e.g. by storing the pointer and the releasing the original string. It might be possible to add safeguards though, for example by registering behaviours for the char pointer type, that counts the number of references to the pointer, or in some other way makes sures that the pointer stays valid while references are still alive.

The question is which is easier, adding a wrapper or implementing a scheme for protecting raw pointers. I would think wrappers are easier to implement.

Of course, if you don't care about the safety, then you don't have to do all that, just register a simple type that can store a pointer, and a couple functions for freeing/allocating the memory in the pointers.

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

Is it possible to do what arbken needs in 1.10?
Yes, it is possible if you don't care about the safety. Pointers are built-in types in 1.10, so no extra type has to be registered to store them.

Pointers were removed in 2.0.0, because they are not safe. Object handles were introduced instead, which are able to use the behaviours ADDREF and RELEASE to control the references to a pointer.

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

Quote:Original post by Rain Dog
Is it possible to do what arbken needs in 1.10?


Of course it is possible ! That's one of the main reason that made me choose AngelScript when I have choosen a script engine.

But the pointer discussion is over now.

Quote:Original post by WitchLord
You could do it by registering a type that holds a pointer to a char array, and then pass that type by value to the MessageBox function.

But I don't recommend doing it like this because it wouldn't be safe.


This is an interesting answer. I will investigate this way soon.

Today is Velo'V opening day, the project I am working on for month now and that is driven (kiosk where you rent a bike) by AngelScript. This is not a game, this is real life !

I'd like inhere (even if it's not the right place) to THANK'S WithcLord for the so good AngelScript including support that he does on it.

Some facts on Velo'V kiosk :
- AngelScript 1.10
- script with more than 14000 lines
- event driven including socket, printer, specifique hardware
- kiosk is 24/24 7/7 (AngelScript is stable)

Best Regards,

AbrKen.
Very cool, abrken!

I'll add this site to the AngelScript users list a.s.a.p. Unless you prefer not to, of course.

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

AngelScript 2.2.0 WIP 5 has been released.

Now script structures can hold any type, including arrays, as members.

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

This topic is closed to new replies.

Advertisement