Am I missing something? Lists/collections help

Started by
0 comments, last by WitchLord 11 years, 4 months ago
I have a generic class created in angel script that the application is agnostic of. My questions is how exactly is the script writer to keep track of the objects he/she creates? I tried registering the built-in array class and creating an array of @class pointers as the data type without success. After a couple hours of research I found what appeared to be a vector addon for ascript, but this is still dependent on the application registering the vector types. Are there any collections like std::list available for the script to use independently of the application? Worst case, even having access to malloc and being able to store the class pointer in script would be fine.

Thanks,
-Vert
Advertisement
The script array add-on is agnostic to the type of the elements.

The application needs to register it with the script engine with a call to RegisterScriptArray(engine), then the scripts can can create arrays of any types it like:


// script
class MyClass { }
array<MyClass@> arrayOfHandlesToMyClass;
array<int> arrayOfInts;

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