Jump to content

Mr H.

Member
  • Content Count

    597
  • Joined

  • Last visited

  • Medals

Everything posted by Mr H.

  1. EDIT: Works with RscStructured text, it does the job for me!
  2. onMouseButtonDblClick doesn't work for me as a control event handler on a RscPicture control (and all others except RscMapControl for that matter) I've tried looking at this solution but to no avail. Any ideas?
  3. Thank you both for your answers, @Larrow, your code is much better than mine which was a quick fix. I have used control groups before but am I correct in assuming that safezone positions are not relative to the size of the ctrl group but to the whole screen? @pierremgi my intent is to make this into a mod and I am aware of the issue of paths you mention. (I have passed multiple scripts into mods before). As for the issue of screentoworld on PIP I fear I'm hitting a dead end... I would like to implement some kind of target detection and tracking like the uavs do but am at my wit's end...
  4. these shouldn't be in arma3profile but in arma3Missions.Arma3profile (the file itself being in the user profile folder corresponding to the profile you have set for the server)
  5. My understanding is that RscTitles let the player keep control over his avatar (not what I'm looking for) while dialogs open an interface and show the mouse arrow, but I'm not a 100% sure I understand your point, do you have a code example that I could use as reference? also @pierremgi 3 things: 1) I've noticed your answers and comments pretty much everywhere here, on armaholic and on BisWiki, among my mission making friends you are an urban legend and we consider you a god of arma (along with Nou from ace and acre). ;-) 2) Your video is amazing. 3) I feel like you're the one able to answer a question I have on another problem I'm facing: I'm using PIP to display the satellite camera on a RscPicture control. I'd like to use the screentoworld command (https://community.bistudio.com/wiki/screenToWorld) on the pip view (and not the player's view) but have been unable to achieve this so far. Any ideas?
  6. yes but can't you group the controls inside another control? Like in a RcControlGroup, but without the position being taken into account? Beause the group itself would be part of a larger display group. Here's the full hpp: class MRHSatellite { idd=9751; movingenable=false; class controls { //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT START (by Mr H., v1.063, #Giqaqu) //////////////////////////////////////////////////////// class MRHLaptopSat: RscPictureMRHSAT { idc = 1200; text = "MRHSatellite\Paa\laptop.paa"; x = 0.00125001 * safezoneW + safezoneX; y = -0.00399999 * safezoneH + safezoneY; w = 1.01719 * safezoneW; h = 1.008 * safezoneH; }; class MRHScreenzone: RscPictureMRHSAT { idc = 1201; text = "MRHSatellite\Paa\welcomescreen.paa"; onMouseButtonClick = "hint ""testé""; ";//[_this] call MRH_fnc_ConvertCoordinates; x = 0.250625 * safezoneW + safezoneX; y = 0.122 * safezoneH + safezoneY; w = 0.49875 * safezoneW; h = 0.49 * safezoneH; }; /* class Group1 : RscControlsGroupMRHSAT { idc = 1208; show = false; class controls { */ class MRHMarkings: RscPictureMRHSAT { idc = 1231; show = false; text = "MRHSatellite\Paa\screenmarks.paa"; x = 0.250625 * safezoneW + safezoneX; y = 0.122 * safezoneH + safezoneY; w = 0.49875 * safezoneW; h = 0.49 * safezoneH; }; class MRHAltitudeName: RscStructuredTextMRHSAT { idc = 1204; show = false text = "Altitude"; x = 0.63125 * safezoneW + safezoneX; y = 0.192 * safezoneH + safezoneY; w = 0.0590625 * safezoneW; h = 0.028 * safezoneH; }; class MRHAltitudeDisplay: RscStructuredTextMRHSAT { idc = 1205; show = false text = "AltDisplay"; x = 0.63125 * safezoneW + safezoneX; y = 0.22 * safezoneH + safezoneY; w = 0.0590625 * safezoneW; h = 0.028 * safezoneH; }; class MRHViewModeName: RscStructuredTextMRHSAT { idc = 1206; show = false text = "View Mode"; x = 0.63125 * safezoneW + safezoneX; y = 0.248 * safezoneH + safezoneY; w = 0.0590625 * safezoneW; h = 0.028 * safezoneH; }; class MRHViewModeDisplay: RscStructuredTextMRHSAT { idc = 1207; show = false text = "ViewDisplay"; x = 0.63125 * safezoneW + safezoneX; y = 0.276 * safezoneH + safezoneY; w = 0.0590625 * safezoneW; h = 0.028 * safezoneH; }; class MRHSlider: RscSliderMRHSAT { idc = 1202; show = false type = CT_SLIDER; style = SL_VERT; x = 0.716563 * safezoneW + safezoneX; y = 0.122 * safezoneH + safezoneY; w = 0.0328125 * safezoneW; h = 0.49 * safezoneH; color[] = { 1, 1, 1, 1 }; coloractive[] = { 1, 0, 0, 0.5 }; //onLoad = "call MRH_fnc_SetSatRange;"; onSliderPosChanged = "((findDisplay 9751) displayCtrl 1205) ctrlSetStructuredText parsetext (str (round (_this select 1))); _cam = missionNamespace getVariable ""SATCAM""; _cam setPos [(getpos _cam select 0), (getpos _cam select 1), (_this select 1)];"; }; /* }; }; */ class MRHMapTest : RscMapControlMRHSAT { idc = 1777; show = false; onMouseButtonClick = "hint ""Nouvelle position enregistrée""; [_this] call MRH_fnc_ConvertCoordinates;"; //onMapSingleClick = "hint ""bouhyah"""; //text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.250625 * safezoneW + safezoneX; y = 0.122 * safezoneH + safezoneY; w = 0.49875 * safezoneW; h = 0.49 * safezoneH; }; class MRHChangeVision: RscButtonMRHSAT { idc = 1600; show = false; text = "Changer le mode de vue"; //--- ToDo: Localize; x = 0.250625 * safezoneW + safezoneX; y = 0.122 * safezoneH + safezoneY; w = 0.118125 * safezoneW; h = 0.028 * safezoneH; action = "ctrlshow [2100, true];"; }; class MRHOpenMapButton: RscButtonMRHSAT { idc = 1601; show = false; action = "ctrlshow [1777, true];"; text = "Changer la position du satellite"; //--- ToDo: Localize; x = 0.36875 * safezoneW + safezoneX; y = 0.122 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.028 * safezoneH; }; class MRHSelectView: RscComboMRHSAT { idc = 2100; show = false; text = "Default"; //--- ToDo: Localize; x = 0.257187 * safezoneW + safezoneX; y = 0.15 * safezoneH + safezoneY; w = 0.21 * safezoneW; h = 0.028 * safezoneH; onLBSelChanged = "_value = _this select 1; [_value] call MRH_fnc_SelectViewMode;ctrlshow [2100, false];"; }; class MRHClosebutton: RscButtonMRHSAT { idc = 1602; text = "Fermer"; //--- ToDo: Localize; action = "Closedialog 0;"; x = 0.513125 * safezoneW + safezoneX; y = 0.122 * safezoneH + safezoneY; w = 0.07875 * safezoneW; h = 0.028 * safezoneH; }; class DialogBoxGroup : RscControlsGroupMRHSAT { idc = 5001; show = false; class controls { class MRHChooseInitBackGround: RscPictureMRHSAT { idc = 5002; text = "MRHSatellite\Paa\interfacewindow.paa"; x = 0.381875 * safezoneW + safezoneX; y = 0.304 * safezoneH + safezoneY; w = 0.223125 * safezoneW; h = 0.154 * safezoneH; }; class MRHAcceptButton: RscButtonMRHSAT { idc = 5003; text = "Accepter"; //--- ToDo: Localize; x = 0.408125 * safezoneW + safezoneX; y = 0.416 * safezoneH + safezoneY; w = 0.0525 * safezoneW; h = 0.028 * safezoneH; }; class MRHRefuseButton: RscButtonMRHSAT { idc = 5004; text = "Annuler"; //--- ToDo: Localize; action = "ctrlshow [5001, false];" //"Closedialog ((findDisplay 9751 5001;"; x = 0.52625 * safezoneW + safezoneX; y = 0.416 * safezoneH + safezoneY; w = 0.0525 * safezoneW; h = 0.028 * safezoneH; }; class MRHWarningBoxText: RscStructuredTextMRHSAT { idc = 5006; text = "Dummytesttext"; x = 0.388437 * safezoneW + safezoneX; y = 0.318 * safezoneH + safezoneY; w = 0.21 * safezoneW; h = 0.084 * safezoneH; }; }; }; class MRHStaticsoverlay: RscPictureMRHSAT { idc = 1333; text = "MRHSatellite\Paa\overlaystatics.paa"; colorText[] = { 1, 1, 1, 0.4 //transparencedeloverlay }; x = 0.250625 * safezoneW + safezoneX; y = 0.122 * safezoneH + safezoneY; w = 0.49875 * safezoneW; h = 0.49 * safezoneH; }; class MRHProgressBar: RscProgressMRHSAT { idc = 6203; show =false; colorFrame[] = {0.5,0.5,0.5,1}; colorBar[] = {0,1,0,1}; //texture = "#(argb,0,8,0)color(1,1,1,1)"; text = "test"; //#(argb,8,8,3)color(1,1,1,1) x = 0.292231 * safezoneW + safezoneX; y = 0.51512 * safezoneH + safezoneY; w = 0.426562 * safezoneW; h = 0.042 * safezoneH; }; class MRHSatMovingTextBackground: RscPictureMRHSAT { idc = 6204; show =false; text = "MRHSatellite\Paa\interfacewindow.paa"; x = 0.618125 * safezoneW + safezoneX; y = 0.318 * safezoneH + safezoneY; w = 0.0984375 * safezoneW; h = 0.14 * safezoneH; }; class MRHMovingSatTextZone: RscStructuredTextMRHSAT { idc = 6205; show =false; text = "Dummytext"; x = 0.624687 * safezoneW + safezoneX; y = 0.332 * safezoneH + safezoneY; w = 0.0853125 * safezoneW; h = 0.112 * safezoneH; }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END //////////////////////////////////////////////////////// }; }; you'll see that' I've commented out the group I'm trying to create. I call each display inside the group with a function by listing them one by one: here's the function: fn_ShowHide1208.sqf params ["_show"]; switch (true) do { case _show : { ctrlshow [1231,true]; ctrlshow [1204,true]; ctrlshow [1205,true]; ctrlshow [1206,true]; ctrlshow [1207,true]; ctrlshow [1202,true]; }; case !_show : { ctrlshow [1231,false]; ctrlshow [1204,false]; ctrlshow [1205,false]; ctrlshow [1206,false]; ctrlshow [1207,false]; ctrlshow [1202,false]; }; }; what i'd like is to figure out a simpler more elegant way of doing things. BTW here's the current advancement of the mod explainations are in french but you'll get the visual side at least
  7. that is my currently working fix, but i'd like to avoid that, just for the sake of clarity and for the sake of trying things out ^^
  8. The cba solution is the best one, as stated above
  9. Hi, when I create a backpack (left on the ground) through a script, the packpack is deleted but the object's model remains visible. If I pick the model again, it disappears (and is not visible in my backback inventory slot). Am I doing it wrong or is this a known issue? here's a small test script to illustrate the issue. ////test.sqf _bag = "B_Carryall_oli" createVehicle (player modelToWorld [0,1,0]); sleep 3; deleteVehicle _bag; hint "deleted";
  10. perfect I'll try that very soon thanks dude!
  11. Hi, I'm currently working on converting a series of tools I made as script into a mod. I'd like to create a configure addon menu that would allow the user to select some options. (as well as server owners/ mission makers). I'd also like to give the user the option to change the keybinds for the mod. ACE3 and ACRE2 have such implementations for example, I have had a look at their files but I'm not sure how to do this, I guess they are using CBA to do this but have no idea how. Could anyone here point me in the right direction?
  12. I'm sorry but you didn't understand, I know all that but the server doesn't reject mods (or addons) we use, (Some of our mods are homemade and I resign them after every update btw) it rejects addons we have not activated (ticked in the launcher)! This is what puzzles me. It's more like you have a mod in your mod library, you know the mod's forbidden on the server so you deactivate it yet you are kicked off for having this mod... As for armasync, our modpack is relatively small and I update the server every time a new update is released for one of our mods , since steam automatically updates the workshop mods when you use the vanilla arma launcher it's absolutely seemless for other players hence I really don't see the point in using it.
  13. Hi! My team and I had been playing for a while with verifysignatures disabled on our server. I've decided to reenable signatures check on the server for various reasons but the server behaves strangely. I have no troubles connecting to it whatsoever but some of my friends are kicked out with the usual message stating that the addons are forbidden. Trouble is the error message tells them about mods that they do have but ARE NOT activated when they join the server (we've checked and double checked and there's the autoconfigure thingy in the launcher as a 3rd failsafe). All mods and keys on the server are up to date and we use steam workshop to keep our mods updated. Contrarily to other players in my team I've changed the !worshop mods directory's location to a different location from the default one which might be why I don not get the error message? I was also wondering if it was an issue brought by the latest updates of the game since we used to have signatures verification a while back and it worked fine at the time. For the moment I have disabled signatures on the server but I'd like to have them back. Has anybody experiences the same issue and found a solution? Is it a known issue?
  14. found the solution on my own, post it here for anyone who is interested: [OBJECT,0,["ACE_MainActions","ACTION"]] call ace_interact_menu_fnc_removeActionFromObject;
  15. Okay so apparently it was the pilot switching off the engine, if I order him to move to the end of the unitplay path it seems to work fine! (will have to do further testing)
  16. I have noticed that they do move while there's a player inside the vehicle but not when there's only an AI. Also they do not move when you are the server (hosting or in the editor) but move when you are not (MP).
  17. So, I'm making a credits script which spawns movie-like credits rolling on the screen. The script works fine but I'm using bis_fnc_dynamictext to create the text, and there seems to be a limit to the length of the text you can use. My initial idea was to rewrite a very similar function only changing the length cap. Trouble is I don't understand what's limiting the length of the text in the original function. Any clues? Here's the code to the fnc: /* File: credits.sqf Author: Karel Moricky Description: Dynamic opening credits Parameter(s): _this select 0: Text _this select 1: (Optional) X coordinates _this select 2: (Optional) Y coordinates _this select 3: (Optional) Duration _this select 4: (Optional) Fadein time _this select 5: (Optional) Delta Y _this select 6: (Optional) Resource layer */ disableserialization; _text = _this select 0; _x = if (count _this > 1) then {_this select 1} else {-1}; _y = if (count _this > 2) then {_this select 2} else {-1}; _w = -1; _h = -1; _delay = if (count _this > 3) then {_this select 3} else {4}; _fade = if (count _this > 4) then {_this select 4} else {1}; _moveY = if (count _this > 5) then {_this select 5} else {0}; _layer = if (count _this > 6) then {_this select 6} else {[] call bis_fnc_rscLayer}; if (_delay < 0) then {_delay = 4}; if (_fade < 0) then {_fade = 1}; //--- Width and Height if (typename _x == typename []) then { _array = _x; _x = _array select 0; _w = _array select 1; }; if (typename _y == typename []) then { _array = _y; _y = _array select 0; _h = _array select 1; }; _layer cutrsc ["rscDynamicText","plain"]; _display = uinamespace getvariable "BIS_dynamicText"; _control = _display displayctrl 9999; _control ctrlsetfade 1; _control ctrlcommit 0; _pos = ctrlposition _control; if (_x != -1) then {_pos set [0,_x]}; if (_y != -1) then {_pos set [1,_y]}; if (_w != -1) then {_pos set [2,_w]}; if (_h != -1) then {_pos set [3,_h]}; _control ctrlsetposition _pos; if (typeName _text == typeName "") then { _control ctrlsetstructuredtext parseText _text; } else { _control ctrlsetstructuredtext _text; }; _control ctrlcommit 0; _control ctrlsetfade 0; _control ctrlcommit _fade; waituntil {ctrlcommitted _control}; if (_moveY != 0) then { _y = _pos select 1; _pos set [1,_y + _moveY]; _control ctrlsetposition _pos; _control ctrlcommit _delay; }; //if (_layer != 789) exitwith {}; _spawn = missionnamespace getvariable format ["bis_dynamicText_spawn_%1",_layer]; if (!isnil "_spawn") then {terminate _spawn}; _spawn = [_control,_delay,_fade,_moveY,_layer] spawn { disableserialization; _control = _this select 0; _delay = _this select 1; _fade = _this select 2; _moveY = _this select 3; _layer = _this select 4; if (_moveY != 0) then {waituntil {ctrlcommitted _control}} else {sleep _delay}; _control ctrlsetfade 1; _control ctrlcommit 1; waituntil {ctrlcommitted _control}; _layer cuttext ["","plain"]; }; missionnamespace setvariable [format ["bis_dynamicText_spawn_%1",_layer],_spawn]; waituntil {scriptdone _spawn};
  18. I have tried that by using the controlTextHeight command (I think it was that one) to determine the text height and set it as the correct height, that is becaus I wan't this script to be reusable and depending on missions and Player attendency, there is no way to know how long the text is going to be. It didn't work for me but maybe I did something wrong.
  19. It defines the duration of pre/post credits.
  20. as you will notice I split the generated text into several parts as a solution, there are parts of the original roster script I have deactivated but I haven't bothered to clean it so sorry if it's a bit messy.
  21. the text is generated by a script, it has a variable size depending on how many players participate in the mission. Disclaimer: not all of the code is mine, I've taken skippy's roster script as a base for this. Here's a video of the script in action: https://www.twitch.tv/videos/178329712 _duree = _this select 0; _includeAI = 1;//0->only players, 1->both AI and players, 2->playable units only (includes player and some AI) _rank = true;//true->display unit's rank false->hide unit's rank _role = true;//true->display unit's role false->hide unit's role _strRank = "";//will contain unit's rank _strRole = "";//will contain unit's role _strGrp = "";//will contain unit's group name _strColorGrp = "";//will contain unit's group color _strFinal = "";//will contain final string to be displayed _oldGrp = grpNull;//group of last checked unit _newGrp = grpNull;//group of current unit _unitsArr = [];//will contain all units that have to be processed switch(_includeAI) do { case 0:{//only players { if(isPlayer _x) then { _unitsArr = _unitsArr + [_x]; }; }forEach allUnits; }; case 1:{//both AI and players _unitsArr = allUnits; }; case 2:{//only playable units if(isMultiplayer) then { _unitsArr = playableUnits; } else { _unitsArr = switchableUnits; }; }; default{ _unitsArr = allUnits; }; }; {//forEach if(side _x == side player) then { _newGrp = group _x; _strGrp = ""; if(_rank) then { switch(rankID _x) do { case 0:{ _strRank = "Simple soldat "; }; case 1:{ _strRank = "Caporal "; }; case 2:{ _strRank = "Sergent "; }; case 3:{ _strRank = "Lieutenant "; }; case 4:{ _strRank = "Capitaine "; }; case 5:{ _strRank = "Major "; }; case 6:{ _strRank = "Colonel "; }; default{ _strRank = "Simple soldat "; }; }; }; if(_role) then { _strRole = " - " + getText(configFile >> "CfgVehicles" >> typeOf(_x) >> "displayName"); }; if((_x getVariable "displayName") != "") then { _strRole = " - " +(_x getVariable "displayName"); }; if(_newGrp != _oldGrp) then { _strGrp = "£"; if((_this find ("Color"+str(side _x)))>-1) then { if(count _this > ((_this find ("Color"+str(side _x))) + 1)) then { _strColorGrp = _this select ((_this find ("Color"+str(side _x))) + 1); } else { hint "Skippy-Roster - Missing Param"; _strColorGrp = ""; }; } else { switch (side _x) do { case EAST:{ _strColorGrp = "'#990000'"; }; case WEST:{ _strColorGrp = "'#0066CC'"; }; case RESISTANCE:{ _strColorGrp = "'#339900'"; }; case CIVILIAN:{ _strColorGrp = "'#990099'"; }; }; }; if(((group _x) getVariable "color") != "") then { _strColorGrp = (group _x) getVariable "color"; }; }; _strFinal = _strFinal +_strGrp + _strRank + name _x + _strRole + "<br/>" ; _oldGrp = group _x; }; }forEach _unitsArr; _title = _this select 1; _makername = _this select 2; _thanks = _this select 3; _extratext = _this select 4; //if(_extratext == objNull) then { _extratext = "";}; _year = _this select 5; _strprecredit ="<t font = 'PuristaMedium'>" + "C'était: <br/>" + _title +"<br/>" + "Une mission proposée par:<br/>" + _makername +"<br/>" + "Entièrement réalisée pour Arma III <br/>" + "Une production Team TGV<br/>" + "Avec les mods: <br/> CBA 3 <br/> Ace 3 <br/> Acre 2 <br/> RHS Escalation <br/> Project Opfor <br/> Cup Terrains <br/> Cup Terrains core<br/><br/> Remerciements:<br/>" + "<br/>" + _thanks +"<br/>" + "<br/>" + _extratext + "<br/>" + "Avec dans leurs rôles respectifs:<br/>" + "</t>"; _strpostcredit ="<t font = 'PuristaMedium'>" + "<br/><br/><br/>" + "© " + _makername + "<br/>" + _year + "</t>" + "<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>"; //_strFinal = _strprecredit + _strFinal + _strpostcredit; test = _strfinal splitstring "£"; //copytoclipboard _test; part1 = [_strprecredit,-1,-1,_duree ,-1, -1] spawn BIS_fnc_dynamicText; waituntil {scriptdone part1}; sleep 1; part2 = [] spawn {{["<t font = 'PuristaMedium'><t size = '1'>" + _x + "</t>",-1, -1,1 ,2, 0] spawn BIS_fnc_dynamicText; sleep 5;} forEach test;}; waituntil {scriptdone part2}; part3 = [_strpostcredit,-1,-1,_duree ,-1, -1] spawn BIS_fnc_dynamicText; waituntil {scriptdone part3}; //[_strFinal,-1,-1,_duree ,-1] spawn BIS_fnc_dynamicText; // trouver le cap et réécrire la fonction /* Number: X coordinates (optional) Number: Y coordinates (optional) Number: Duration (Optional) Number: FadeIn time (Optional) Number: Delta Y, Text will move up or down depending on value (Optional) Number: Resource layer (Optional) */
  22. found a solution on my own, I put it here for anyone who needs it : ZeusMaster addEventHandler [ "CuratorObjectRegistered", { _classes = _this select 1; _costs = []; { _cost = if (_x isKindOf "Man" or _x isKindOf "tank" or _x isKindOf "Air" or _x isKindOf "Car") then { switch (true) do { case (_x isKindOf "tank"): {[true,0.5]}; case (_x isKindOf "Man"): {[true,0.01]}; case (_x isKindOf "Air"): {[true,0.3]}; case (_x isKindOf "Car"): {[true,0.05]}; }; } else {[true,0.01]}; _costs = _costs + [_cost]; } forEach _classes; // Go through all classes and assign cost for each of them _costs } ]; just change the values as you need
  23. I gather you haven't found a solution yet? I agree that it seems the size of the display layer plays a role in this, I've given up on this and done things differently but if you find a working solution let me know!
×