Advertisement

Initialising Global Structures

Started by January 15, 2005 10:14 AM
2 comments, last by SpreeTree 19 years, 10 months ago
I have a simple structre that I have registered with the script and I ideally want to be able to initialise global variables of the struct type. For example BodyProperty planet = {"Earth", "Human"}; Is it possible to do this or should I just initilise the variables in a function call later (which i would prefer not to do)? Thanks Spree
I'm not aware that AS supports that array initialization syntax, which can't be used anyhow as you aren't initializing an array.
Advertisement
The best you can do is to register constructors that take the necessary arguments to initialize the structure.

BodyProperty planet("Earth", "Human");

I have plans to implement initializer lists for arrays, maybe even for structures, but this is quite low priority right now.

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

Ok thanks for that, its not a problem as there are various other ways I can hadle the situation.

Thanks
Spree

This topic is closed to new replies.

Advertisement