Jump to content

sizraide

Member
  • Content Count

    111
  • Joined

  • Last visited

  • Medals

Everything posted by sizraide

  1. 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.
  2. Thanks, I'll take a look into it.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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; }]; };
  8. 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; }]; };
  9. 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.
  10. 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.
  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. 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.
  13. 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:
  14. 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.
  15. Hello, I am trying to split the map into columns and create a marker representing each column. My script is working, but its not working as intended, the columns are not positioned correctly. _path = configfile >> "cfgworlds" >> worldname; _size = getnumber (_path >> "mapSize"); _size = _size / 2; _center = [_size,_size,0]; _columnsAmount = 8; _xCrd = _size / _columnsAmount; _add = _size / _columnsAmount; _middleHeight = _size / 2; for "_i" from 1 to _columnsAmount do { _marker = createMarker ["Column_" + str _i, [(_xCrd/2), _middleHeight]]; _marker setMarkerSize [_xCrd/2, _size]; _marker setMarkerShape "rectangle"; _marker setMarkerColor selectRandom["ColorRed", "ColorYellow", "ColorBlue", "ColorGreen", "ColorPink"]; _marker setMarkerAlpha 0.5; _xCrd = _xCrd + _add; };
  16. sizraide

    Splitting map into columns

    Thank you, I appreciate it.
  17. sizraide

    Splitting map into columns

    Update: I managed to get it working, but one more issue: I've added a picture below to show that the column markers extend beyond the map above and below, is there any way I can adjust to the exact size of the map? https://imgur.com/a/DDVhBmf
  18. Hello, I created a script to spawn an AI in every building near the location with a marker on that unit. The problem is that the AI is not spawning and I don't see any markers on the map. Here is my script: _marker = _this select 0; _markerSize = ((getMarkerSize _marker) select 0); _markerPos = getMarkerPos _marker; _aafUnits = [ "AAF_Soldier", "AAF_Soldier_GL", "AAF_Soldier_AR", "AAF_Soldier_AT", "AAF_Soldier_Medic", "AAF_Sniper" ]; _nearbyBuildings = nearestObjects [_markerPos, ["House"], _markerSize]; _housesSelected = []; { _object = typeOf _x; _hasKeyword = false; if (isClass (configFile >> "CfgVehicles" >> _object)) then { { if (_object find _x > -1) then { _hasKeyword = true; }; } forEach ["House", "Building", "Shop", "Shed"]; if (_hasKeyword) then { _housesSelected pushBack _x; }; }; } forEach _nearbyBuildings; _amount = floor (count _housesSelected / 2); _housesChosen = []; for "_i" from 1 to _amount do { _house = selectRandom _housesSelected; _housesChosen pushBack _house; _housesSelected = _housesSelected - [_house]; }; hint str _housesChosen; { _unit = (createGroup INDEPENDENT) createUnit [str (selectRandom [_aafUnits]), getPos _x, [], 0, "none"]; _unit setPos (selectRandom (_x buildingPos - 1)); _unit setDir (random 360); _marker = createMarkerLocal [format ["BuildingMarker%1", _forEachIndex], _unit]; _marker setMarkerShapeLocal "ICON"; _marker setMarkerTypeLocal "mil_dot"; } forEach _housesChosen;
  19. It works great, I appreciate it. Could you give me some sources to optimize code? Or some advice?
  20. Yes, that was stupid of me to not check the classes. I fixed it since but it still doesn't work. Here is my script.
  21. Hello, I'm making a singleplayer scenario. And I'm using the conversations system in A3 for AI and the player to interact with each other. This is my intro.bikb file And here is my description.ext file However, when I type this function below, there is no audio for the conversation, but the lips syncing works and subtitles appear and they go in order and start one after the another when the audio finishes, except, there's no audio or noise, it's just silent. I suppose it recognizes the audio and is playing it, but there's no noise. ["Introduction", "Beginning"] call BIS_fnc_kbTell; Any help? EDIT: William is the player and the audio works when I use playSound or any other function to play the .ogg file.
  22. I fixed it, I managed to fix the audio. Stupid me had this in my init.sqf file showChat false; enableRadio false; 0 fadeRadio 0; Now, the only issue I have is BIS_fnc_showSubtitle not rendering in.
  23. Both of them have radios, still no noise from audio.
  24. I'd like to make a comment that also if I wanted to incorporate rendering BIS_fnc_showSubtitle with BIS_fnc_kbTell function, the subtitles doesn't appear. Here is the intro.bikb class Sentences { class Sentence1 { text = ""; textPlain = "Test1"; speech[] = { "\Sounds\thunder.ogg" }; class Arguments {}; actor = "nic"; }; class Sentence2 { text = ""; textPlain = "Test2"; speech[] = { "\Sounds\thunder.ogg" }; class Arguments {}; actor = "william"; }; class Sentence3 { text = ""; textPlain = "Test3"; speech[] = { "\Sounds\thunder.ogg" }; class Arguments {}; actor = "nic"; }; }; class Arguments {}; class Special {}; startWithVocal[] = { hour }; startWithConsonant[] = { europe, university };
  25. Hello, I'm creating a COOP mission. I have some dialog and I'm using TitleText, the text dissapears too fast even though I don't know why? Here is my script.
×