SpeedSter 0 Report post Posted August 26, 2017 (edited) New to sqf and have experience in cpp. I have written a server side exile addon and want to store my defined values (class member variables) in the addons config.cpp, instead of the mission or server_config config.cpp. For example accessing a defined value or class member is done as such, configFile >> "CfgSettings" >> "SomeClass" >> "somesetting"; or for mission config.cpp using missionConfigFile. My config.cpp is stored in myaddon.pbo. I want to do this without making the values global variables, or by passing local variables as parameters to another function. Hopefully, someone can shed some light on this, or maybe I am going about this the wrong way. Basically what I am trying to do is either add variables to an existing class, such as class Time or class Weather, define my own class, or use class inheritance, and add my variables in through the addons config.cpp, so that they can be accessed by my newly added functions. Instead of users having to add my variables to the main config, they can just install the addon and edit the config.cpp in the addon pbo Edit: Not going to lie, but I had made a change earlier and published it to my server and noticed later some log output showing it working. I just made a single class with no base class or parent, put in my config.cpp "configFile >> "MyClass" >> "variable;" and it worked. I'm guessing exile or the game code merges config files at some point? I must have been using class inheritance wrong earlier. Edit2: In my addons config.cpp. How do I override the existing "class Time" variables and add my own variables in. Can I only override existing variables of the Time class and need create my own class for my new variables? In other words, say I am making a time addon that depends on the exile_server_config time settings and want to centralize those settings with my addon time settings. This is how I have tried to do it: class CfgSettings; class Time : CfgSettings { // Uses Dedicated Server time as ingame Time useRealTime = 0; // Will overide RealTime useStaticTime = 1; // time in ARMA FORMAT << CONFIG // https://community.bistudio.com/wiki/setDate staticTime[] = {2039,10,24,8,0}; // My inserted values newvalue = 0; anothernewvalue = 1; }; Edit3: I must have been looking at code for too long. Anyway I got it working as I had originally done it. This will override the original time values and add my own in. Another way is to make my own class with CfgSettings as parent. class CfgSettings { class Time { // Uses Dedicated Server time as ingame Time useRealTime = 0; // Will overide RealTime useStaticTime = 1; // time in ARMA FORMAT << CONFIG // https://community.bistudio.com/wiki/setDate staticTime[] = {2039,10,24,8,0}; // My inserted values newvalue = 0; anothernewvalue = 1; }; }; Edited August 29, 2017 by SpeedSter Solved Share this post Link to post Share on other sites
Mezo 1264 Report post Posted August 29, 2017 If you want to store stuff in the exile_client config you need to make another mod. (pointless). either store it in the server or the mission file. 1 Share this post Link to post Share on other sites
SpeedSter 0 Report post Posted August 29, 2017 Thanks Mezo, I already had my addon settings in my exile_server_config, but I wanted to move those settings to my server addon config.cpp. I probably fat fingered some code or forgot to save some file before packing. However, it is working now as an addon, which is nice because it centralizes the time settings in my addon. Share this post Link to post Share on other sites