Smart Games 76 Posted July 16, 2021 Hello all, I am currently working on a Ui in which you can select a spawn location from a list box and then be teleported there. I imagine to store the locations in something of the following type in a config file, but I have no idea how to do it: class JF_Locations { class Devils_Mountain { name = "Devil's Mountain"; id = 001; air = true; //is it allowed to spawn via airdop land = true; //is it allowed to spawn on the ground water = false; //is it allowed to spawn on the water coordinates = [100, 100, 0]; description = "blablabla"; }; class Under_Water_Palace { name = "Under Water Palace "; id = 002; air = false; //is it allowed to spawn via airdop land = false; //is it allowed to spawn on the ground water = true; //is it allowed to spawn on the water coordinates = [50, 250, 0]; description = "blablabla"; }; }; If it's possible, how do I read the locations from the config file and turn them into an array or something? Is there a better way? I like this clean format. Thank in advance, Jacob Share this post Link to post Share on other sites
sarogahtyp 1105 Posted July 16, 2021 I m a noob at config scripting but I guess the syntax for arrays is like this (copied out of a config.cpp): // When any of the addons is missing, pop-up warning will appear when launching the game. requiredAddons[]={"cba_settings"}; in scripts you can get those arrays with getArray but I could be absolutly wrong here cause I know nothing bout UIs and only a little bit of configs... 1 Share this post Link to post Share on other sites
panther42 40 Posted July 16, 2021 5 hours ago, Smart Games said: If it's possible, how do I read the locations from the config file and turn them into an array or something? Perhaps @Larrow post can help you here. See bottom section. 1 Share this post Link to post Share on other sites
gc8 970 Posted July 16, 2021 Configs are good for storing this type of data example: _locations = missionConfigFile >> "JF_Locations"; for "_i" from 0 to (count _locations - 1) do { _loc = _locations select _i; systemchat format["Location: %1", getText (_loc >> "name") ]; }; (Code not tested) 1 Share this post Link to post Share on other sites
Smart Games 76 Posted July 16, 2021 Thank you, @gc8! Works like a charme 🙂 Share this post Link to post Share on other sites