🎉 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
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement