Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read settings from paramsArray (params in description.ext) #2826

Merged
merged 3 commits into from
Nov 17, 2015

Conversation

PabstMirror
Copy link
Contributor

Just an idea, not sure if we need
Allows you to make settings changeable by mission params, so one mission can be played with different settings

for now just limited to SCALAR/BOOL

e.g.

class Params {
    class ace_medical_level {
        title = "Medical Level";
        ACE_setting = 1;
        values[] = {1,2};
        texts[] = {"Basic", "Advanced"};
        default = 2;
    };

@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Nov 7, 2015
@PabstMirror PabstMirror added this to the Backlog milestone Nov 7, 2015
@jonpas
Copy link
Member

jonpas commented Nov 7, 2015

Nice idea!

@TheMagnetar
Copy link
Member

I have this in my mission template. Essentially one must call this at postInit. Here the function where I set the different parameters (for the moment only Basic medical, advanced medical and advanced ballistics on/of without requiring any of the modules/missionconfig.cpp files. Everything could be dynamically set at mission start.

https://github.com/CavallersDelCel/1RA_Plantilla_Missio/blob/master/scripts/ace3/fn_ace3_config.sqf

Edit: lines 139 and 140 for the medical stuff and 473 for advanced ballistics.

@kymckay
Copy link
Member

kymckay commented Nov 7, 2015

Shouldn't it happen after modules? Good idea though 👍

@thojkooi
Copy link
Contributor

thojkooi commented Nov 7, 2015

@SilentSpike no, the settings here are forced. Anything coming after it will be ignored.

@kymckay
Copy link
Member

kymckay commented Nov 7, 2015

Are you sure?

It looks as though they're only forced if said so in the config, but since they're parameters they should probably take precedence over modules

@thojkooi
Copy link
Contributor

thojkooi commented Nov 7, 2015

Ah, I was looking at the true on the setSettings. Wasn't paying attention. My mistake, sorry.

In that case; they are not forced. But I see no issue with them being executed before modules.

@kymckay
Copy link
Member

kymckay commented Nov 7, 2015

Well, if somene places a module to change a bunch of settings, but wants one of the settings handled by the module to be handled by parameter instead then the module will override it

@PabstMirror
Copy link
Contributor Author

Modules will overwrite and force all settings in the module (unless they are already forced)

  • This needs to run before modules.
  • You really need the force flag (maybe this should force by default?) otherwise the module will just overwrite it right after.

@kymckay
Copy link
Member

kymckay commented Nov 7, 2015

Yeah, I'm thinking this should just force by default 👍

I can't think of a scenario where you want a module to overwrite a parameter (it nullifies the parameter).

@thojkooi thojkooi modified the milestones: 3.4.0, Backlog Nov 10, 2015
PabstMirror added a commit that referenced this pull request Nov 17, 2015
Read settings from paramsArray (params in description.ext)
@PabstMirror PabstMirror merged commit 896615b into settingsErrorChecking Nov 17, 2015
@PabstMirror PabstMirror deleted the settingsParamsArray branch November 17, 2015 20:01
PabstMirror added a commit that referenced this pull request Dec 4, 2015
@Feivel69
Copy link

Is parameters > modules still working? I seem to remember it did work before the last update, but now the modules settings are taken instead of the defaults in description.ext. Or is it just me?

@thojkooi
Copy link
Contributor

What do you mean with that?

All previous options from the ACE settings framework still work.

@Feivel69
Copy link

If I set up description.ext with parameters, for example ace_medical_level with default 1 and ace_medical_medicSetting with default 1 and then place the medical module in editor with both values set to 2, then the mission will take the values from module and not from description.ext. And I seem to remember, that a few days/weeks earlier the description.ext default values had highest priority.

@Feivel69
Copy link

Ok, nevermind, I see, we have to use ACE_setting = 1 now. I'm sorry, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants