Jump to content

sizraide

Member
  • Content Count

    111
  • Joined

  • Last visited

  • Medals

Community Reputation

4 Neutral

About sizraide

  • Rank
    Sergeant

Recent Profile Visitors

820 profile views
  1. Thanks, I'll take a look into it.
  2. I haven't seen anywhere where I can convert my grid (ctrl + G) to pixelGrid definitions, if it helps. Because I am willing to recreate the entire dialog.
  3. Considering I have hundred of classes in my .hpp files to convert the positions. Would it be possible to just run a function that converts there x, y, w, h to pixelGrid? class MenuFrame_StartButton_BG: RscPicture { idc = -1; text = "#(argb,8,8,3)color(0.05,0.05,0.05,1)"; x = 0.849453 * safezoneW + safezoneX; y = 0.934 * safezoneH + safezoneY; w = 0.152578 * safezoneW; h = 0.07 * safezoneH; onLoad = "[_this # 0] call DES_fnc_changeToPixelGrid;"; // <-- For example. }; Because right now my dialog in 16:9 1920 x 1080 looks like this: https://imgur.com/a/sKaihj4 And in 21:9 2560 x 1080, it looks like this: https://imgur.com/undefined I want all aspect ratios to have consistent size in dialogs and text, just the way the dialog looks like in 21:9.
  4. I want my GUI dialogs to stay consistent in size with different ratio aspects. At the moment my dialogs stay consistent in size with different resolutions. How do I convert this (for example): x = 0.00492199 * safezoneW; y = 0.014 * safezoneH; w = 0.132891 * safezoneW; h = 0.056 * safezoneH; To something like this (taken from Dynamic Recon Ops)? x = "safezoneX + (5 * pixelGridNoUIScale * pixelW)"; y = "safezoneY + (0.25 * pixelGridNoUIScale * pixelH)"; w = "15 * pixelGridNoUIScale * pixelW"; h = "15 * pixelGridNoUIScale * pixelH"; I hope I made sense, thanks.
  5. It's put into a variable to check how many units are in a faction are suitable for the scenario. It's part of a larger function to collect every faction from CfgFactionClasses and determine if a faction is usable in a scenario based on how many amount of units are appropriate for the scenario. _index = { [configName _x] call SIZ_fnc_checkUnit } count ("(configName _x isKindOf 'Man') && getText (_x >> 'faction') == _faction" configClasses (configFile >> "CfgVehicles")); Here is the full function. _factions = []; { _faction = configName _x; _index = { [configName _x] call SIZ_fnc_checkUnit } count ("(configName _x isKindOf 'Man') && getText (_x >> 'faction') == _faction" configClasses (configFile >> "CfgVehicles")); if(_index > 2) then { _displayName = getText (configFile >> "CfgFactionClasses" >> _faction >> "displayName"); if(_displayName isNotEqualTo "") then { _icon = getText (configFile >> "CfgFactionClasses" >> _faction >> "icon"); _side = getNumber (configFile >> "CfgFactionClasses" >> _faction >> "side"); if(_icon == "") then { switch(_side) do { case 0: {_icon = "a3\data_f\flags\flag_red_co.paa"}; case 1: {_icon = "a3\data_f\flags\flag_blue_co.paa"}; case 2: {_icon = "a3\data_f\flags\flag_green_co.paa"}; }; }; _factions set [_forEachIndex, [_displayName, _faction, _side, _icon]]; }; }; } forEach ("getNumber (_x >> 'side') in [0,1,2,3]" configClasses (configFile >> "CfgFactionClasses")); EDIT: I forgot to mention SIZ_fnc_checkUnit is where the classname is sent through.
  6. Hello, I have a script here that checks if the classname provided has any primary, secondary, or handgun. This script works sometimes, when it doesn't, it gets an error for Error Zero Divisor Script: // Check if unit has any weapons. _weapons = getUnitLoadout _classname select [0,3]; if((_weapons select 0) isEqualTo [] && (_weapons select 1) isEqualTo [] && (_weapons select 2) isEqualTo []) exitWith { false }; Any help is appreciated.
  7. So, I tried using HitPart, but I have one more issue. I am trying to get the accumulated damage of the unit based off hitpoint damage. Somehow, this script doesn't run at all when the accumulated damage reaches beyond 1.5. SIZ_enableReviveForUnit = { params["_unit"]; // HandleDamage event handler _unit addEventHandler ["HitPart", { (_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"]; _totalDmg = 0; { _totalDmg = _totalDmg + _x } forEach (getAllHitPointsDamage _target select 2); hint str _totalDmg; // DEBUG, it works. if(_totalDmg >= 1.5) then { // Doesn't fire when _totalDmg goes beyond 1.5? if !(_unit getVariable "SIZ_Downed") then { _unit spawn { [_this, true] call SIZ_setUnitState; waitUntil{sleep 0.5; (lifeState _this == "INCAPACITATED" && _this getVariable "SIZ_Downed")}; _this call SIZ_addReviveAction; _this call SIZ_startBleedout; if(!isPlayer _this && _this getVariable "SIZ_Bleeding") then { sleep 1; if(alive _this) then { _this call SIZ_reviveCallOut; }; }; }; }; }; }]; // Killed event handler _unit addEventHandler ["Killed", { params ["_unit"]; [_unit, false] call SIZ_setUnitState; }]; };
  8. Hello, I have a script that calls when a unit gets damaged, and depending on that damage it incapacitates the unit. My issue is that SIZ_reviveCallOut calls out twice sometimes. This frequently HAPPENS when I shoot the AI on the head once first, then shoot at it's legs a few times until the script sets off and incapacitates the unit, where it will randomly play the SIZ_reviveCallOut function twice. My script, any solution is appreciated: SIZ_enableReviveForUnit = { params["_unit"]; // HandleDamage event handler _unit addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; if (_damage >= 0.99 && !(_unit getVariable "SIZ_Downed")) then { _unit spawn { [_this, true] call SIZ_setUnitState; waitUntil{sleep 0.5; (lifeState _this == "INCAPACITATED" && _this getVariable "SIZ_Downed")}; _this call SIZ_addReviveAction; _this call SIZ_startBleedout; if(!isPlayer _this && _this getVariable "SIZ_Bleeding") then { sleep 1; if(alive _this) then { _this call SIZ_reviveCallOut; }; // <----- THIS IS THE ERROR }; }; }; _damage; }]; // Killed event handler _unit addEventHandler ["Killed", { params ["_unit"]; [_unit, false] call SIZ_setUnitState; }]; };
  9. sizraide

    waitUntil returning nil

    I really appreciate the solution Larrow, I have an unrelated problem. How do you work around when a unit radio's "NEGATIVE" in chat when it refuses to perform a doMove command. I often get this issue when the position is inside a building, because I have this command running in a script where the healer moves to the incapacitated unit. I have tried getting all the positions in a building and looping through all those positions to find the nearest one to the incapacitated unit, but it doesn't work.
  10. Hello, I have made a script here that runs on a player and gets a nearby AI to heal that player (player must be in incapacitated state). The problem is, this code works completely fine when the player is not unconscious, but the moment the player is unconscious I get an error that waitUntil returns nil. Here is the code: Any help would be appreciated. EDIT: I fixed it, I used the wrong unit for moveToCompleted. The code kind of works, but only works when the unit is not in a incapacitated state.
  11. Is there a way to fade in a image from RscPicture? I am trying to create visual effects for a downed player/unit. Code below: SIZ_postProcessEffects = { params["_unit"]; "radialBlur" ppEffectEnable true; "radialBlur" ppEffectAdjust [0.05,0.05,0.21,0.21]; "radialBlur" ppEffectCommit 1; "ChromAberration" ppEffectEnable true; "ChromAberration" ppEffectAdjust [0.05,0.05,true]; "ChromAberration" ppEffectCommit 1; _ctrl = findDisplay 46 ctrlCreate ["RscPicture", -1]; // Picture being created _ctrl ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH]; _ctrl ctrlSetText selectRandom [ "a3\ui_f\data\igui\rsctitles\healthtextures\blood_middle_ca.paa", "a3\ui_f\data\igui\rsctitles\healthtextures\blood_lower_ca.paa", "a3\ui_f\data\igui\rsctitles\healthtextures\blood_upper_ca.paa" ]; _ctrl ctrlSetFade random 0.35; _ctrl ctrlCommit 0; waitUntil{!alive _this || (lifeState _this == 'HEALTHY' && alive _this)}; ctrlDelete _ctrl; "radialBlur" ppEffectEnable false; "ChromAberration" ppEffectEnable false; };
  12. FIXED: I fixed it guys. If anyone wants to use this script for whatever purpose to gather all groups of factions and place them under each seperate category. Here it is:
  13. NOTE: I have to comment that some specific factions would actually work and the arrays would be filled out, but on other occassions it would be empty.
  14. Hello, I have a script here that completely works by itself standalone. test.sqf Output However, when implemented into my scripts that takes in the currently selected faction from a GUI, it completely breaks down. get_variables.sqf Output (currently) As you can see, for some reason it doesn't fill out the array. Here are my other files (GUI files): controls.hpp And here is my second file: menu.sqf Any help would be appreciated.
  15. sizraide

    Splitting map into columns

    Thank you, I appreciate it.
×