genesis92x / VcomAI-3.0

Vcom AI 3.0
75 stars 39 forks source link

VCM_ARTYSIDES and VCM_SIDEENABLED settings in cba_settings.sqf prevent all settings from being applied #155

Open commy2 opened 4 years ago

commy2 commented 4 years ago

Describe the bug The settings VCM_ARTYSIDES and VCM_SIDEENABLED are using as values ARRAY types which contain SIDE types. SIDE type is not supported by the game for serialization:

call compile str west // west
call compile str resistance // nil
parseSimpleArray str [west] select 0 // nil, error

A type supporting full serialization is required for the settings system. Thus only BOOL, NUMBER, STRING and ARRAYs can be used for settings. SIDE type cannot be used without errors. This leads to the following error if the repro steps are followed:

RPT excerpt ``` 13:55:19 [CBA] (settings) INFO: Mission Config: File [cba_settings.sqf] loaded successfully. 13:55:19 Error in expression 13:55:19 Error position: 13:55:19 Error Generic error in expression 13:55:19 File x\cba\addons\settings\fnc_parse.sqf..., line 30 ```

Subsequently no settings are applied due to the error.

I suggest that the settings are changed to use either NUMBERs (0:east, 1:west, 2:resistance) or STRINGs ("west", "east", "resistance") to enumerate the sides.

To Reproduce Steps to reproduce the behavior:

  1. Have cba_settings.sqf with the following entries:
    force VCM_ARTYSIDES = [WEST,EAST];
    force VCM_SIDEENABLED = [WEST,EAST];
  2. Start the game with VCOM_AI and CBA_A3

VCOM Version:

Additional mods used:

Additional context Issue has been discussed on the CBA_A3 Github here and here.