Jump to content
  • Advertisement
Sign in to follow this  
ninvertigo

Am I missing something? Lists/collections help

This topic is 2143 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.

Thanks,
-Vert

Share this post


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

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!