🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Initialising Global Structures

Started by
2 comments, last by SpreeTree 19 years, 5 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
Advertisement
I'm not aware that AS supports that array initialization syntax, which can't be used anyhow as you aren't initializing an array.
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