Advertisement Jump to content
Sign in to follow this  

Am I missing something? Lists/collections help

This topic is 2236 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.


Share this post

Link to post
Share on other sites
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;

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!