Erwin23p 34 Posted November 5, 2022 Hi, while exploring some public missions to learn, I have come around custom classes defined with custom names and it's variables, it was inside a github I found online while looking for extdb3/sql info. Though not related to data base and sql, this could come handy for something I have planned, I looked on the biki and on google but found no info on this, so what is the use of this? Can I declare my own classes to use with other scripts? Could these classes have it's own functions? For example, could I do a class named base, with variables like position, markers, garrison and faction, and then declare various bases? Or, one class named bases with inside the class of each base? Share this post Link to post Share on other sites
gc8 977 Posted November 5, 2022 i think you mean something like this (in description.ext): class Bases { class FOB1 { side = west; position[] = { 7000, 3000 }; // Etc }; }; then you can extract information from the classes with commands such as getArray, getText, getNumber _base = missionConfigFile >> "Bases" >> "FOB1"; _pos = getArray (_base >> "position"); 2 Share this post Link to post Share on other sites
Larrow 2822 Posted November 5, 2022 This maybe helpful. 1 1 Share this post Link to post Share on other sites
Erwin23p 34 Posted November 5, 2022 Thanks a lot, I will have to study that to absorb all that knowledge, so, in a big mission or campaign the usefulness of this is to set up some non editable classes with non editable variables? And, being able to access it over the whole place? Sorry I didn't get the usability. Share this post Link to post Share on other sites
gc8 977 Posted November 5, 2022 classes are readonly and can be accessed anywhere from sqf script 1 Share this post Link to post Share on other sites
Erwin23p 34 Posted November 8, 2022 Would this be a good way to use configs? it's a mission with different jobs and each job has several tasks. _job is a string variable. params ["_job"]; private ["_taskList","_task","_missionFnc","_taskInfo"]; _taskList = getArray (missionConfigFile >> "Jobs" >> _job >> "tasks"); _task = selectRandom _taskList; _missionFnc = getText (missionConfigFile >> "Tasks" >> _task >> "function"); _taskInfo = call compile _missionFnc; _taskInfo; 1 Share this post Link to post Share on other sites
gc8 977 Posted November 8, 2022 11 hours ago, Erwin23p said: Would this be a good way to use configs? it's a mission with different jobs and each job has several tasks. _job is a string variable. params ["_job"]; private ["_taskList","_task","_missionFnc","_taskInfo"]; _taskList = getArray (missionConfigFile >> "Jobs" >> _job >> "tasks"); _task = selectRandom _taskList; _missionFnc = getText (missionConfigFile >> "Tasks" >> _task >> "function"); _taskInfo = call compile _missionFnc; _taskInfo; Looks like to me you got the grasp of it. i try to use configs much as possible in my missions, in my side mission script I have defined all the missions as config classes. Like this: https://pastebin.com/xMba1QfX so I can add new missions by adding a new class only 1 Share this post Link to post Share on other sites