Jump to content

7erra

Member
  • Content Count

    753
  • Joined

  • Last visited

  • Medals

Everything posted by 7erra

  1. 7erra

    Notepad++ problem

    I just compared your sqf.xml with mine and there are some major differences. Can you try my version since it works for me?
  2. 7erra

    Notepad++ problem

    Do you have a screenshot of the messed up Notepad?
  3. I'll continue the discussion on your post 😉
  4. (count thisList) == ({vehicle _x == _x} count thisList)
  5. Well up until now I was using Poseidon tools as my sqf editor. But I think I'll go back to Notepad++ bc Poseidon has this "Buy license" dialog that pops up after saving a certain amount of times. Otherwise it's working fine for me. From where did you download the highlighter? @Larrow Code adjusted, thanks 👍
  6. Corrected the other post there was a missing comment in the example on the BIKI page. Change the "LoadoutClassname" to whatever you named it in the description.ext. In the example from aboe it should be "B_SquadLeader". Leave the rest as is bc it is a path to the config (missionConfigFile is a command and CfgRespawnInventory is the subconfig).
  7. There are some commands which accept both though: [1,2] select 0; //1 [1,2] select false; //1
  8. Huh weird. If you are going to use the cfg then you can probably do it like this: this addEventhandler ["Respawn",{ params ["_unit", "_corpse"]; _unit setUnitLoadout (missionConfigfile >> "CfgRespawnInventory" >> "LoadoutClassname"); }]; Again untested and only a guess.
  9. Create a file called description.ext in the mission folder (where the mission.sqm is). The file extension has to be ".ext". Withing that file paste the following: class CfgRoles { class Assault//Class name used in CfgRespawnInventory { displayName = $STR_A3_Role_Assault;//Name of the role, displayed in the respawn menu icon = "a3\missions_f_exp\data\img\classes\assault_ca.paa";//Icon shown next to the role name in the respawn screen }; }; class CfgRespawnInventory { class B_SquadLeader//Class of the respawn inventory, used by BIS_fnc_addRespawnInventory { displayName = $STR_b_soldier_sl_f0;//Name of the respawn inventory role = "Assault";//Role the respawn inventory is assigned to icon = "\A3\ui_f\data\map\VehicleIcons\iconManLeader_ca.paa";//Icon shown next to the role show = "side group _this == west";//Condition used to make specific respawn inventories only avaiable for specfic sides, must return [[Boolean]] // Exported from Arsenal by Tiger uniform = "U_O_CombatUniform_ocamo"; backpack = "B_TacticalPack_ocamo"; weapons[] = {"arifle_Katiba_GL_F","hgun_Rook40_F","Rangefinder","Throw","Put"}; magazines[] = {"SmokeShell","SmokeShell","MiniGrenade","MiniGrenade","30Rnd_65x39_caseless_green","30Rnd_65x39_caseless_green","30Rnd_65x39_caseless_green","30Rnd_65x39_caseless_green","30Rnd_65x39_caseless_green","1Rnd_HE_Grenade_shell","1Rnd_HE_Grenade_shell","1Rnd_HE_Grenade_shell","UGL_FlareWhite_F","30Rnd_9x21_Mag","30Rnd_9x21_Mag"}; items[] = {"FirstAidKit","FirstAidKit"}; linkedItems[] = {"V_TacVest_khk","H_HelmetSpecO_ocamo","G_Balaclava_TI_blk_F","ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS","NVGogglesB_blk_F"}; }; }; Should probably work, havent used CfgRespawnInventories that much tbh.
  10. err not sure what that is but if you want to put it in a different file then you have to include the content in the descritpion.ext with the #include command (not really mandatory). There is an example https://community.bistudio.com/wiki/Arma_3_Respawn under Loadouts and Roles.
  11. in the init of the units: _loadout = getUnitLoadout this; this setVariable ["unitLoadoutRespawn",_loadout]; this addEventhandler ["Respawn",{ params ["_unit", "_corpse"]; _loadout = _corpse getVariable ["unitLoadoutRespawn",[]]; _unit setUnitLoadout _loadout; _unit setVariable ["unitLoadoutRespawn",_loadout]; }]; Might work
  12. The function doesnt equip items it just adds the option to select the inventory on the respawn screen. If you want to add an inventory you can use either setUnitLoadout or BIS_fnc_loadInventory You can export an inventory from the Arsenal with CTRL+SHIFT+C and then paste the content into the appropiate section of the description.ext: https://community.bistudio.com/wiki/Arma_3_Respawn https://community.bistudio.com/wiki/Arma_3_Arsenal#Export_to_CPP
  13. https://community.bistudio.com/wiki/BIS_fnc_addRespawnInventory It should work in the init where the target will be this: [this, "CfgRespawnInventoryClass"] call BIS_fnc_addRespawnInventory; The "CfgRespawnInventoryClass" has to be defined in the CfgRespawnInventory section of the description.ext
  14. The format command only accepts strings as the first param. What you can do though is use setVariable. private _group = createGroup ["EAST",true]; // why is there a 1 in your script? _id = time; //(or sth similar to identify it) _groupVarName = format ["EastGroup:%1",_id]; missionNamespace setVariable [_groupVarName,_group]; // access it later again: _groupVarName = format ["EastGroup:%1",_id]; _group = missionNamespace getVariable [_groupVarName,grpNull]; if (!isNull _group) then {/*group exists*/}; Depending on what you intend to do in the script later there might be better ways. This is just a quick answere and not tested.
  15. 7erra

    Dialog math?

    Scaling your GUI the correct way is one of the big mysterys that hasn't been solved yet (afaik)... What I can see in your code is that you are using the absolute values (x = 0.52231 etc). This way arma will be rounding some values. If you want really precise results you can use the pixelGrid system. We can take a look at an example from A3 though (A3\ui_f\config.bin): class RscDisplayPassword: RscStandardDisplay { scriptName="RscDisplayPassword"; scriptPath="GUI"; onLoad="[""onLoad"",_this,""RscDisplayPassword"",'GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')"; onUnload="[""onUnload"",_this,""RscDisplayPassword"",'GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')"; movingEnable=0; simulationEnabled=0; class controlsbackground { class Vignette: RscVignette { idc=114998; }; class TileGroup: RscControlsGroupNoScrollbars { idc=115099; x="safezoneXAbs"; y="safezoneY"; w="safezoneWAbs"; h="safezoneH"; class Controls { class Background: RscText { idc=114999; x=0; y=0; w="safezoneWAbs"; h="safezoneH"; colorBackground[]={0,0,0,0.5}; }; }; }; class TitleBackground: RscText { idc=1080; x="1 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; y="15 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; w="38 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; h="1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; colorBackground[]= { "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])" }; }; class MainBackground: RscText { idc=1081; x="1 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; y="16.1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; w="38 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; h="6.8 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; colorBackground[]={0,0,0,0.69999999}; }; }; class controls { delete B_OK; delete B_Cancel; class Title: RscTitle { style=0; idc=1000; text="$STR_DISP_PASSWORD_TITLE"; x="1 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; y="15 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; w="15 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; h="1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; class PlayersName: Title { idc=601; style=1; colorBackground[]={0,0,0,0}; x="16 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; y="15 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; w="23 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; h="1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; class TextPassword: RscText { idc=1002; text="$STR_DISP_PASSWORD"; x="1.5 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; y="18 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; w="5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; h="1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; class ValuePassword: RscEdit { idc=101; x="6.5 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; y="18 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; w="31 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; h="1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; class ButtonOk: RscButtonMenuOK { x="32.75 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; y="23 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; w="6.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; h="1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; class ButtonCancel: RscButtonMenuCancel { x="1 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; y="23 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; w="6.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; h="1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; }; }; The diaog pops up when you enter a password protected server. I took it as an example bc it's short and has all relevant parts. All other dialogs are nearly made the same way (there are some "black sheeps" though). The formulas here are just as those you get when using "Default" call BIS_fnc_exportGUIBaseClasses; Here are the defines: // Default grid #define GUI_GRID_WAbs ((safezoneW / safezoneH) min 1.2) #define GUI_GRID_HAbs (GUI_GRID_WAbs / 1.2) #define GUI_GRID_W (GUI_GRID_WAbs / 40) #define GUI_GRID_H (GUI_GRID_HAbs / 25) #define GUI_GRID_X (safezoneX) #define GUI_GRID_Y (safezoneY + safezoneH - GUI_GRID_HAbs) // Default text sizes #define GUI_TEXT_SIZE_SMALL (GUI_GRID_H * 0.8) #define GUI_TEXT_SIZE_MEDIUM (GUI_GRID_H * 1) #define GUI_TEXT_SIZE_LARGE (GUI_GRID_H * 1.2) When you are creating a dialog (eg with the default A3 GUI Editor) your variables for position (x,y) and size (w,h) are given out as: x = 1 * GUI_GRID_W + GUI_GRID_X; y = 2 * GUI_GRID_H + GUI_GRID_Y; w = 3 * GUI_GRID_W; h = 4 * GUI_GRID_H; If you replace the variables (GUI_GRID_...) then you get what is written in the config. Since the config was binarized all of the #defined variables are replaced with the actual command/value. Therefore you won't see those in the config. Two more things: 1) The GUI_GRID in the default GUI Editor is really broken and not usable unless you use a fix *cough* 2) The newest grid is not the GUI_GRID but the UI_GRID. It is used since the 3den update and relies partially on safezone but when it comes to size (w, h) it uses pixel perfect values by making use of the new pixelGrid commands. There are some other approaches but those are the two "official" ones. Here on the forum are some other discussions about sizing your dialog: https://forums.bohemia.net/forums/topic/189872-gui-position-and-text-size-with-pixelgrid-pixelw-pixelh/ https://forums.bohemia.net/forums/topic/219480-pixel-grid-system-gui-sizeposition-immune-to-ui-scaling-and-resolution-how/ And another really interesting topic which I can't find atm 😞 What I also really can recommend is the website of our lord and saviour, KillzoneKid: http://killzonekid.com/arma-scripting-tutorials-gui-part-3/ You might have some questions now but so do I still 😄
  16. Huh I don't know what advantage that gives you but try the RscPicture as a control base class and then use _ctrl ctrlSetText "#(rgb,8,8,3)color(1,0,0,1)";
  17. So just to keep you guys up-to-date what is currently happening: Due to RL stress I am not really able to work on any projects. Still, I am trying to get out the VASS v2 which will include a new approach to handling the calculation of costs. It is a quite complicated buisness as I am modifying the code from BI and you know what they say: See you, 7erra
  18. Thats not how it works. The TER_money variable is set on the player with player setVariable ["TER_money",1000]; while zk_money is an item. The current amount can be returned with {_x == "zk_money"} count items player; To make it work you'd have to modify the code though. Eg (not tested): //initArsenal.sqf //line 22ish _currentCash = {_x == "zk_money"} count items player; player setVariable ["TER_money",_currentCash]; //... And to remove money (again untested): //arsenalEH.sqf //line 24 case "buy":{ // buy button pressed _ehArgs params ["_control"]; _newBalance = _PLAYER_MONEY -_CURRENTCOST; if (_newBalance >= 0) then { // add new loadout and close arsenal to reload values for "_i" from 1 to _CURRENTCOST do {player removeItem "zk_money";}; _display setVariable ["loadoutOwned",getUnitLoadout player]; _display closeDisplay 2; ["#(argb,8,8,3)color(0,0,0,1)",false,nil,0,[0,0.5]] call BIS_fnc_textTiles; hint format ["Transaction successful\nYour new balance is %1 %2",_newBalance,TER_moneyUnit]; } else { // not enough money, do nothing systemChat "Not enough money"; }; };
  19. 7erra

    Disable Abort Button

    Good point, agreed. I was only thinking about wether I could, not whether I should
  20. 7erra

    Disable Abort Button

    Untested: (findDisplay 46) displayAddEventHandler ["KeyDown",{ if (inputAction "ingamePause" > 0) then { // escape menu opened _abortButton =(findDisplay 49)displayCtrl 104; _abortButton ctrlEnable false; }; }];
  21. Hmmm that makes the problem a bit more complicated. I might have a solution but it will take some time since I'm currently busy. The basic idea is to count the items in the inventory and set a money variable on the player and upon buying something the money gets removed.
  22. I will add a piece of code so that you can only access the modifed arsenal instead of a full one. Any arsenal which has access to not registered items will close immediately. When you are saying that you find the money in the loot do you mean it as an item? Like Ravage money? You are using the config classes from CfgVehicles (the weapons which will show when being put on the ground). Use the classes from CfgWeapons and CfgMagazines instead.
  23. [[1920,1080,1008,756,1.77778,0.7],[18,16,12],[18,16,12],true] Display mode: Fullscreen Window, Resolution: 1920x1080 (16:9), Aspect Ratio: Auto (Stretch) (16:9), VSync: Enabled, Interface Size: Normal Let me guess you are trying to find the holy grail of UI girds?
  24. https://community.bistudio.com/wiki/Procedural_Textures#perlinNoise
×