Page MenuHomeFeedback Tracker

Export Mission to SQF. Several issues when converting attribute code into sqf code
Closed, ResolvedPublic

Description

This attribute code

if (!is3DEN && (_value # 0 != '')) then
{
  [_this, _value] spawn
  {
    scriptName 'ENH_Attribute_GroupMarker';
    params ['_group', '_value'];
    _value params ['_type', '_color', '_text', '_showGroupSize'];
    private _leader = leader _group;
    private _marker = createMarker
    [
      format ['ENH_GroupMarker_%1', str _group],
      _leader
    ];
    _marker setMarkerType _type;
    _marker setMarkerColor _color;
    _marker setMarkerText (_text call BIS_fnc_localize);
    while {true} do
    {
      sleep 1;
      if (units _group isEqualTo []) exitWith {deleteMarker _marker};
      if (_group getVariable ['ENH_GroupMarker_Update', true]) then
      {
        _marker setMarkerPos _leader;
        if (_showGroupSize) then
        {
          _marker setMarkerText format ['%1 (%2)', groupId _group, count units _group];
        };
      };
    };
  };
};

is converted to

if (!is3DEN && (["","ColorWEST","Alpha 2-4",true] # 0 != '')) then
{
  [_this, ["","ColorWEST","Alpha 2-4",true]] spawn
  {
    scriptName 'ENH_Attribute_GroupMarker';
    params ['_group', '["","ColorWEST","Alpha 2-4",true]'];
    ["","ColorWEST","Alpha 2-4",true] params ['_type', '_color', '_text', '_showGroupSize'];
    private _leader = leader _group;
    private _marker = createMarker [format ['ENH_GroupMarker_["","ColorWEST","Alpha 2-4",true]', str _group], _leader];
    _marker setMarkerType _type;
    _marker setMarkerColor _color;
    _marker setMarkerText (_text call BIS_fnc_localize);
    while {true} do
    {
      sleep 1;
      if (units _group isEqualTo []) exitWith {deleteMarker _marker};
      if (_group getVariable ['ENH_GroupMarker_Update', true]) then 
      {
        _marker setMarkerPos _leader;
        if (_showGroupSize) then 
        {
          _marker setMarkerText format ['["","ColorWEST","Alpha 2-4",true] ()', groupId _group, count units _group];
        };
      };
    };
  };
};;
  1. %1 is replaced with the content of the _value variable which causes things like this:
createMarker [format ['ENH_GroupMarker_["","ColorWEST","Alpha 2-4",true]', str _group], _leader];
  1. _value variable is replaced by its content, even if it's used like this:
params ["_value"];
_value params ['_type', '_color', '_text', '_showGroupSize'];

which results in :

params ['_group', '["","ColorWEST","Alpha 2-4",true]'];
["","ColorWEST","Alpha 2-4",true] params ['_type', '_color', '_text', '_showGroupSize'];

Details

Severity
Major
Resolution
Won't Fix
Reproducibility
Always
Operating System
Windows 10 x64
Category
Eden Editor
Additional Information

Relevant function file: A3\3DEN\Functions\fn_3DENExportSQF.sqf

Event Timeline

R3vo created this task.Jun 6 2021, 10:10 AM
R3vo updated the task description. (Show Details)
R3vo updated the task description. (Show Details)Jun 6 2021, 10:28 AM
R3vo edited Additional Information. (Show Details)Jun 6 2021, 10:51 AM
BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.Jun 6 2021, 12:45 PM
BIS_fnc_KK closed this task as Resolved.
BIS_fnc_KK changed Resolution from Open to Won't Fix.
BIS_fnc_KK added a subscriber: BIS_fnc_KK.

Too complicated and the fix would be too unreliable, so won't fix

This comment was removed by BIS_fnc_KK.