Jump to content

Kanas Kanas

Member
  • Content Count

    21
  • Joined

  • Last visited

  • Medals

Posts posted by Kanas Kanas


  1. It can be changed in the file named (InputUserSettings).
    This is how I set up the mouse wheel for scrolling through the inventory.

     

      Action Inventory_PrevPage {
       InputSource InputSourceSum "{5DF76AF925E2DA0B}" {
        Sources {
         InputSourceValue "{5DF76AF925E2C52B}" {
          FilterPreset "up"
          Input "mouse:wheel+"
         }
        }
       }
      }
      Action Inventory_NextPage {
       InputSource InputSourceSum "{5DF76AF927520BD0}" {
        Sources {
         InputSourceValue "{5DF76AF927520AF8}" {
          FilterPreset "down"
          Input "mouse:wheel-"
         }
        }
       }
      }


  2. 26 minutes ago, Kanas Kanas said:


    openMap [FALSE, FALSE];


    // --- handle map icons hover actions

    addMissionEventHandler ["GroupIconOverEnter", {
        _grp = _this # 1;
        _sector = _grp getVariable "BIS_WL_sector";
        if (!isNil {_sector getVariable "Name"} || isPlayer _sector) then {
            [_sector, "hover"] call BIS_fnc_WLSectorIconUpdate;
        };
    }];

    addMissionEventHandler ["GroupIconOverLeave", {
        BIS_WL_hoverPlayed = FALSE;
        BIS_WL_hoverAnimated = FALSE;
        _grp = _this # 1;
        _sector = _grp getVariable "BIS_WL_sector";
        if (!isNil {_sector getVariable "Name"} || isPlayer _sector) then {
            [_sector, "default"] call BIS_fnc_WLSectorIconUpdate;
        };
    }];

    "BIS_WL_newlySelectedSector" addPublicVariableEventHandler {
        _sector = _this # 1;
        if !(_sector getVariable "BIS_WL_handleClientRunning") then {
            _sector call BIS_fnc_WLsectorHandle;
            if (BIS_WL_scanEnabled == 1) then {[_sector, side group player] call BIS_fnc_WLsectorScanHandle};
        };
    };

    {
        _x addAction [localize "STR_A3_WL_action_dismiss_teammate", {_unit = (_this select 0); if (vehicle _unit == _unit) then {deleteVehicle _unit} else {(vehicle _unit) deleteVehicleCrew _unit}}, [], -20, FALSE, TRUE, "", "_this == leader _target || _this == _target", -1, FALSE];
        _x addEventHandler ["Fired", BIS_WL_mineRestrictionCode];
    } forEach ((units group player) - [player]);

    {
        _x addAction [localize "STR_A3_WL_menu_remove_item", {{_x setPos position _x} forEach crew (_this select 0); deleteVehicle (_this select 0)}, [], -20, FALSE, TRUE, "", "vehicle _this != _target && _target in ((group _this) getVariable ['BIS_WL_groupVehs', []])", -1, FALSE];
    } forEach (((group player) getVariable ["BIS_WL_groupVehs", []]) select {alive _x && !isNull _x});


    sleep 0.01;


    while {count waypoints group player > 1} do {deleteWaypoint (waypoints group player # 1);};

    if (isNil {player getVariable "BIS_WL_selectedSector"}) then {
        player setVariable ["BIS_WL_selectedSector", objNull, TRUE];
    };

    player setVariable ["BIS_WL_sectorSide", side group player];

    player enableSimulationGlobal FALSE;
    player hideObjectGlobal TRUE;
    startLoadingScreen [""];

    _null = [] spawn {
        scriptName "WLClientInit (loading)";
        if (isMultiplayer) then {
            _i = 0;
            while {_i < 1} do {
                if (_i < 0.5) then {
                    startLoadingScreen [""];
                };
                progressLoadingScreen _i;
                _i = _i + 0.075;
                sleep 0.1;
            };
        };
        player enableSimulationGlobal TRUE;
        player hideObjectGlobal FALSE;
        endLoadingScreen;
        titleCut ["", "BLACK IN", 1];
        1 fadeSound 1; 1 fadeRadio 1; 1 fadeSpeech 1;
        sleep 1;
        "Initialized" call BIS_fnc_WLSoundMsg;
        [toUpper localize "STR_A3_WL_popup_init"] spawn BIS_fnc_WLSmoothText;
        //BIS_WL_selectionFSM = player call BIS_fnc_WLsectorSelectionHandle;
        sleep 3;
    };


    _null = [] spawn {
        scriptName "WLClientInit (group icons)";
        while {TRUE} do {
            setGroupIconsVisible [TRUE,FALSE];
            setGroupIconsSelectable TRUE;
            sleep 5;
        };
    };

    openMap [true, true];

    Player addEventHandler ["Fired", BIS_WL_mineRestrictionCode];

    _null = [] spawn BIS_fnc_WLReputation;
    _null = [] spawn BIS_fnc_WLOSD;
    _null = [] spawn BIS_fnc_WLFundsInfo;
    _null = "init" spawn BIS_fnc_WLPurchaseMenu;
    _null = [] spawn BIS_fnc_WLPlayersTracking;
    _null = [] spawn {
        scriptName "WLClientInit (cursor swap)";
        disableSerialization;
        while {TRUE} do {
            waitUntil {BIS_WL_currentSelection != ""};
            _ctrl = (findDisplay 12) displayCtrl 51;
            _ctrl ctrlMapCursor ["Track", "HC_move"];
            waitUntil {BIS_WL_currentSelection == "" && visibleMap};
            _ctrl ctrlMapCursor ["Track", "Track"];
        };
    };

    if (BIS_WL_playersAlpha > 0) then {
        _null = [] spawn {
            scriptName "WLClientInit (iconDrawArray update)";
            while {TRUE} do {
                _tempArray = +BIS_WL_allWarlords select {side group _x == side group player};
                BIS_WL_iconDrawArrayMap = _tempArray;
                BIS_WL_iconDrawArray = _tempArray select {_x != player && isPlayer _x && _x distance2D player < 75};
                sleep 2;
            };
        };
    };

    [] spawn {
        while {TRUE} do {
            _autonomous = player getVariable ["BIS_WL_autonomousPool", []];
            _autonomousAlive = _autonomous select {alive _x};
            player setVariable ["BIS_WL_autonomousPool", _autonomousAlive];
            sleep 1;
        };
    };

    [] spawn {
        waitUntil {!isNull findDisplay 46};
        sleep 2;
        (findDisplay 46) displayAddEventHandler ["KeyDown", {
            _key = _this # 1;
            if (_key in actionKeys "Gear" && !(missionNamespace getVariable ["BIS_gearKeyPressed", FALSE]) && !(player getVariable ["BIS_WL_toSwitchSides", FALSE]) && (player getVariable ["BIS_WL_friendlyFirePunishmentEnd", 0]) == 0) then {
                if !(isNull (uiNamespace getVariable ["BIS_WL_purchaseMenuDisplay", displayNull])) then {
                    "close" call BIS_fnc_WLPurchaseMenu;
                } else {
                    BIS_gearKeyPressed = TRUE;
                    [] spawn {
                        _t = time + 0.5;
                        waitUntil {!BIS_gearKeyPressed || time >= _t};
                        if (time < _t) then {
                            if (isNull findDisplay 602) then {
                                if (vehicle player == player) then {
                                    if (cursorTarget distance player <= 5 && !(cursorTarget isKindOf "House") && (!alive cursorTarget || !(cursorTarget isKindOf "Man"))) then {
                                        player action ["Gear", cursorTarget];
                                    } else {
                                        player action ["Gear", objNull];
                                    };
                                } else {
                                    vehicle player action ["Gear", vehicle player];
                                };
                            } else {
                                closeDialog 602;
                            };
                        } else {
                            if (BIS_gearKeyPressed) then {
                                if (BIS_WL_currentSelection in ["", "voted"]) then {
                                    "open" spawn BIS_fnc_WLPurchaseMenu;
                                } else {
                                    playSound "AddItemFailed";
                                    _action = switch (BIS_WL_currentSelection) do {
                                        case "voting": {localize "STR_A3_WL_popup_voting"};
                                        case "fastTravel": {localize "STR_A3_WL_action_destination_select"};
                                        case "drop": {localize "STR_A3_WL_action_dropzone"};
                                        case "scan": {localize "STR_A3_WL_action_scan_select"};
                                    };
                                    [toUpper format [(localize "STR_A3_WL_another_action") + " (%1).", _action]] spawn BIS_fnc_WLSmoothText;
                                };
                            };
                        };
                    };
                };
                TRUE
            };
        }];
        (findDisplay 46) displayAddEventHandler ["KeyUp", {
            _key = _this # 1;
            if (_key in actionKeys "Gear") then {
                BIS_gearKeyPressed = FALSE;
            };
        }];
    };

    [] spawn {
        _enemySide = if (side group player == WEST) then {EAST} else {WEST};
        _enemyTargetOld = objNull;
        _enemyVotingResetVarID = format ["BIS_WL_sectorVotingReset_%1", _enemySide];
        while {TRUE} do {
            _enemyTarget = missionNamespace getVariable [format ["BIS_WL_currentSector_%1", _enemySide], objNull];
            if (_enemyTarget != _enemyTargetOld && !isNull _enemyTarget) then {_enemyTargetOld = _enemyTarget};
            if (missionNamespace getVariable [_enemyVotingResetVarID, FALSE]) then {
                if !(isServer) then {
                    missionNamespace setVariable [_enemyVotingResetVarID, FALSE];
                };
                if (!isNull _enemyTargetOld && (_enemyTargetOld == (missionNamespace getVariable [format ["BIS_WL_currentSector_%1", side group player], objNull]) || (_enemyTargetOld getVariable "BIS_WL_sectorSide") == side group player)) then {
                    [toUpper format [localize "STR_A3_WL_popup_voting_reset_user", _enemySide call BIS_fnc_WLSideToFaction]] spawn BIS_fnc_WLSmoothText;
                };
            };
            sleep 1;
        };
    };

    addMissionEventHandler ["Draw3D", {
        if (BIS_WL_markersAlpha > 0) then {
            _curSector = if (side group player == WEST) then {BIS_WL_currentSector_WEST} else {BIS_WL_currentSector_EAST};
            if !(isNull _curSector) then {
                _color = BIS_WL_sectorColors # (BIS_WL_sidesPool find (_curSector getVariable "BIS_WL_sectorSide"));
                _dist = player distance _curSector;
                _units = "m";
                _dist = round _dist;
                if (_dist > 1000) then {_dist = _dist / 100; _dist = round _dist; _dist = _dist / 10; _units = "km"};
                drawIcon3D [
                    if !(_curSector in [BIS_WL_base_WEST, BIS_WL_base_EAST]) then {BIS_WL_sectorIcon} else {BIS_WL_baseIcon},
                    [_color # 0, _color # 1, _color # 2, BIS_WL_markersAlpha],
                    [(position _curSector) # 0, (position _curSector) # 1, 3],
                    1,
                    1,
                    0,
                    "",
                    0,
                    0,
                    "PuristaSemibold",
                    "center",
                    TRUE
                ];
                drawIcon3D [
                    "",
                    [1, 1, 1, BIS_WL_markersAlpha],
                    [(position _curSector) # 0, (position _curSector) # 1, 3],
                    0,
                    0.5,
                    0,
                    format ["%1%2 %3", _dist, if (_dist % 1 == 0 && _units == "km") then {".0"} else {""}, if (_units == "m") then {BIS_WL_localized_m} else {BIS_WL_localized_km}],
                    2,
                    0.0325,
                    "PuristaSemibold"
                ];
            };
        };
        if (BIS_WL_playersAlpha > 0) then {
            {
                drawIcon3D [
                    "A3\ui_f\data\igui\cfg\islandmap\iconplayer_ca.paa",
                    [1, 1, 1, BIS_WL_playersAlpha],
                    if (vehicle _x == _x) then {
                        (_x modelToWorldVisual (_x selectionPosition "head")) vectorAdd [0,0,0.75];
                    } else {
                        getPosATLVisual _x
                    },
                    0,
                    0,
                    0,
                    name _x,
                    2,
                    0.0325,
                    "PuristaSemibold",
                    "center",
                    FALSE
                ];
            } forEach (BIS_WL_iconDrawArray);
        };
        {
            drawIcon3D [
                "\A3\ui_f\data\map\groupicons\selector_selectable_ca.paa",
                [1, 1, 1, 0.5],
                (getPosATLVisual _x) vectorAdd [0,0,1],
                1,
                1,
                0,
                _x getVariable ["BIS_WL_iconText", ""],
                2,
                0.0325,
                "PuristaSemibold",
                "center",
                FALSE
            ];
        } forEach BIS_WL_recentlyPurchasedAssets;
    }];


    waitUntil {visibleMap};

    BIS_colorDrawE = BIS_WL_sectorColors # 0; BIS_colorDrawE set [3, 0.5];
    BIS_colorDrawW = BIS_WL_sectorColors # 1; BIS_colorDrawW set [3, 0.5];
    BIS_colorDrawESel = [0.75, 0.75, 0.75, 1];
    BIS_colorDrawWSel = [0.75, 0.75, 0.75, 1];

    (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw", {
        if !(isNull BIS_WL_currentSector_EAST) then {
            (_this # 0) drawIcon [
                "A3\ui_f\data\map\groupicons\selector_selectedMission_ca.paa",
                BIS_colorDrawE,
                BIS_WL_currentSector_EAST,
                60,
                60,
                if (side group player == EAST || BIS_WL_currentSector_EAST != BIS_WL_currentSector_WEST) then {0} else {45},
                "",
                if (side group player == EAST || BIS_WL_currentSector_EAST != BIS_WL_currentSector_WEST) then {2} else {1}
            ];
        };
        if !(isNull BIS_WL_currentSector_WEST) then {
            (_this # 0) drawIcon [
                "A3\ui_f\data\map\groupicons\selector_selectedMission_ca.paa",
                BIS_colorDrawW,
                BIS_WL_currentSector_WEST,
                60,
                60,
                if (side group player == WEST || BIS_WL_currentSector_EAST != BIS_WL_currentSector_WEST) then {0} else {45},
                "",
                if (side group player == WEST || BIS_WL_currentSector_EAST != BIS_WL_currentSector_WEST) then {2} else {1}
            ];
        };
        if (BIS_WL_playersAlpha > 0) then {
            {
                (_this # 0) drawIcon [
                    "A3\ui_f\data\igui\cfg\islandmap\iconplayer_ca.paa",
                    if (_x == player) then {[1, 0, 0, BIS_WL_playersAlpha]} else {[1, 1, 1, BIS_WL_playersAlpha]},
                    getPosVisual _x,
                    20,
                    20,
                    0,
                    if (_x == player) then {""} else {format [" %1", name _x]},
                    2,
                    0.05,
                    "EtelkaNarrowMediumPro",
                    "right"
                ];
            } forEach (BIS_WL_iconDrawArrayMap);
        };
        if (cheatsEnabled) then {
            if (cheat5) then {
                {
                    _leader = _x;
                    {
                        (_this # 0) drawLine [
                            position _x,
                            position _leader,
                            [0,1,0,1]
                        ];
                        if !(isNull assignedVehicle _x) then {
                            (_this # 0) drawLine [
                                position _x,
                                position assignedVehicle _x,
                                [0,0,1,1]
                            ];
                        };
                        (_this # 0) drawLine [
                            position _x,
                            (expectedDestination _x) # 0,
                            [1,0,0,1]
                        ];
                    } forEach units group _leader;
                } forEach (BIS_WL_allWarlords select {!isPlayer _x});
                    
                {
                    (_this # 0) drawIcon [
                        "A3\ui_f\data\map\markers\military\dot_CA.paa",
                        [1, 1, 0, 0.5],
                        getPosVisual _x,
                        20,
                        20,
                        0,
                        typeOf _x,
                        2,
                        0.05,
                        "RobotoCondensed",
                        "right"
                    ];
                } forEach allDeadMen;
            };
        };
    }];


    _sector = (entities "ModuleWLSector_F") # 0;
    _side = _Sector getVariable "BIS_WL_sectorSide";

    [_sector, _side] call BIS_fnc_WLsectorUpdate;

    0 setFog 0;

    openMap [FALSE, FALSE];

     


  3. 35 minutes ago, Markkos26 said:

     

    @ bombe 

    Dokážete najít způsob, jak zachránit pokrok hry, včetně cp? Můžete mě naučit, jak to udělat, prosím?

    //Save player CP

    _list = [];
    {player getVariable "BIS_WL_funds"]} forEach save_funds;
    profileNamespace setVariable ["save_funds",_list];

    saveProfileNamespace;


    //Load player CP

    {_x params ["_funds"]; player setVariable ["BIS_WL_funds",_funds, TRUE];
    } forEach (profileNamespace getVariable ["save_funds",[]]);


  4. I'm sorry, I can not speak English.
    Example: AI team has two soldiers.
    If the co-commander (AI) dies and the other is alive, the commander teleports to the unit's position after respawnu. They'll both be there again, and that's a three problem. This code will remove the subordinate soldier.


  5. Please consider using this code when respawn  AI.
    It will be more realistic.


    WL: AI Core

    if ({alive _x} count units _this > 1 && !(_base in [BIS_WL_currentSector_WEST,BIS_WL_currentSector_EAST])) then {
         _this setPos position ((units _this) select 1),deleteVehicle ((units _this) select 1);
    };

     

    or maybe

    ((units _this) select 1) setDamage 1;

     

    We will not be afraid to kill the first commander of the team.
    Thank you.

×