Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

Am I missing something? Lists/collections help

4: Adsense

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.


  • You cannot reply to this topic
1 reply to this topic

#1 ninvertigo   Members   

127
Like
0Likes
Like

Posted 06 December 2012 - 09:52 AM

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

#2 Andreas Jonsson   Moderators   

4649
Like
0Likes
Like

Posted 06 December 2012 - 11:24 AM

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




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.