-
Content Count
753 -
Joined
-
Last visited
-
Medals
Everything posted by 7erra
-
bis_fnc_dynamicText and screen resulotion
7erra replied to Alert23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You should use the GUI_GRID for this (or pixelGrid but meh): #include "\a3\ui_f\hpp\definecommongrids.inc" Task1 = [ "<img align=''right'' img size='8' image='images\task1.paa' shadow='0'/>", GUI_GRID_TOPLEFT_X + 1 * GUI_GRID_TOPLEFT_W, GUI_GRID_TOPLEFT_Y + 1 * GUI_GRID_TOPLEFT_H, 50, 1, 0, 222 ] spawn bis_fnc_dynamicText; GUI_GRID_TOPLEFT_X is the same as safeZoneX, GUI_GRID_TOPLEFT_Y is safeZoneY. The important ones are GUI_GRID_TOPLEFT_W and _H. You can try around with the 1* multiplier to find a suitable location for the text. -
No need for controlsgroups or more than one control. RscButtonMenu supports images by default: class RscButtonMenuPicture: RscButtonMenu { idc = -1; text = "Text"; x = 8.5 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; y = 22 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; w = 10.5 * GUI_GRID_CENTER_W; h = 2 * GUI_GRID_CENTER_H; textureNoShortcut = "path\to\image.paa"; // This is the image to be displayed // Position of the text: class TextPos { // Positions in ui coordinates are relative to the button left = 2 * GUI_GRID_W; top = 0.5 * GUI_GRID_H; right = 0.005; bottom = 0; }; // Position of the image: class ShortcutPos { left = 0; top = 0; w = 2 * GUI_GRID_W; h = 2 * GUI_GRID_H; }; };
-
Well it can be done in a similar way, so a dialog with an object with controls on it: class RscTestObjectUI { idd=-1; class objects { class TestObject: RscObject { type=82; idc=-1; scale=0.2; model="\A3\Misc_F\Helpers\UserTexture1m.p3d"; position[]={0,0,0.2}; positionBack[]={0,0,0.2}; inBack=0; enableZoom=1; zoomDuration=0.5; direction[]={1,0.25,1}; up[]={0.25,1,0}; class Areas { class Usertexture { selection="usertexture"; class controls { class Test: RscText { text="Schnobble"; sizeEx=0.30000001; colorText[]={0,1,0,1}; colorBackground[]={0,1,0,1}; x=0; y=0; w=1; h=0.5; shadow=0; }; class Picture: RscPicture { text="a3\Ui_f\data\Logos\bi_white_ca.paa"; x=0; y=0.5; w=0.5; h=0.5; }; }; }; }; }; }; }; This is from the a3\ui_f\config.cpp, also @killzone_kid did something like this: http://killzonekid.com/arma-scripting-tutorials-gui-part-6/ Also this post by @HazJ:
-
Problems with an array and a RscCombo
7erra replied to mankyle's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Or if you want to avoid global variables: Option 1) Use BIS_fnc_netID and then BIS_fnc_objectFromNetID Option 2) Save the variable to the display: _display setVariable ["UAVArray", _uavArray]; // To access it: _display getVariable ["UAVArray", []]; -
Animation Loop cuts to black and then gets control
7erra replied to C.T.B Creations's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Looks like your charachter is playing an animation. You can terminate that with player switchMove ""; -
[GUI] trying to clear a structured text...
7erra replied to Erwin23p's topic in ARMA 3 - MISSION EDITING & SCRIPTING
At the end of a KeyDown UIEH always return false: _display displayAddEventhandler ["KeyDown",{ /* code */ false }; Otherwise you are overwriting the default behaviour of that key, or in other words, intercept any following input. -
Two things: 1) The display config, either look at it in the config browser or setup the P drive and export the game files 2) These two files contain most IDCs: "a3\ui_f\hpp\defineresincldesign.inc" "a3\ui_f\hpp\defineresincl.inc"
-
I am 99% sure that there is no error in that line. My guess is that you are trying to execute the code in an unscheduled environment and it is throwing an error because of the waitUntil statement. Anyway, I would recommend to use @Larrow's code since it is way smarter. Why do you not want to make a description.ext? It is really only that one line that @Larrow posted that you have to add to the description.ext.
-
[NEED HELP] Auto recover health
7erra replied to sina alex's topic in ARMA 3 - MISSION EDITING & SCRIPTING
_this call { params ["_bim", "_player", "_fa"]; }; _this is (usually) an array, see https://community.bistudio.com/wiki/Category:Data_Types and https://community.bistudio.com/wiki/Magic_Variables#this . The params command is essentially only assigning variables to the elements of that array: private _element1 = _this select 0; // SAME AS: params ["_element1"]; Also, all opening brackets ( "(, [, {" ) must be closed again. Pay attention to the syntax of the commands you use: https://community.bistudio.com/wiki/SQF_syntax. -
[NEED HELP] Auto recover health
7erra replied to sina alex's topic in ARMA 3 - MISSION EDITING & SCRIPTING
There is so much wrong with this script. Please read the BIKI more carefully. -
if (!hasInterface) exitWith {}; waitUntil {!isNull findDisplay 46}; findDisplay 46 displayAddEventHandler ["KeyDown",{ if (inputAction "ingamePause" > 0) then { [] spawn { waitUntil {!isNull findDisplay 49}; [13287, 13288] apply { (findDisplay 49 displayCtrl _x) ctrlEnable false; }; }; }; }]; Should work. Not tested but the IDCs should be correct.
-
Put this in the initPlayerLocal.sqf: if (!hasInterface) exitWith {}; waitUntil {!isNull findDisplay 46}; findDisplay 46 displayAddEventHandler ["KeyDown",{ if (inputAction "ingamePause" > 0) then { [] spawn { waitUntil {!isNull findDisplay 49}; (findDisplay 49 displayCtrl 13288) ctrlEnable false; }; }; }];
-
Curator Interface "dynamic" button
7erra replied to Lorenz94's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Larrow True. I used the way that BI does it in the script which I mentioned above. But inputAction seems to have quite a few problems of its own according to the BIKI notes? -
Curator Interface "dynamic" button
7erra replied to Lorenz94's topic in ARMA 3 - MISSION EDITING & SCRIPTING
#include "\a3\ui_f\hpp\definedikcodes.inc" _curatorDisplay = findDisplay 312; ([] call BIS_fnc_GUIGrid) params ["", "", "_GUI_GRID_W", "_GUI_GRID_H"]; _GUI_GRID_W = _GUI_GRID_W / 40; _GUI_GRID_H = _GUI_GRID_H / 25; _btn = _curatorDisplay ctrlCreate ["RscButton", 2020]; _btn ctrlSetPosition [ safezoneX + safezoneW - 23.6 * _GUI_GRID_W, safeZoneY + 1.6 * _GUI_GRID_H, 11 * _GUI_GRID_W, 1 * _GUI_GRID_H ]; _btn ctrlSetText "ACTION"; _btn ctrlCommit 0; _curatorDisplay displayAddEventHandler ["KeyDown",{ params ["_curatorDisplay", "_key"]; if (_key in actionkeys 'curatorToggleInterface') then { _screenshotMode = uiNamespace getVariable ["RscDisplayCurator_screenshotMode", false]; _btn = _curatorDisplay displayCtrl 2020; _btn ctrlEnable _screenshotMode; _fade = [0,1] select !_screenshotMode; _btn ctrlSetFade _fade; _btn ctrlCommit 0.1; }; }]; Adjusted the script so it fits the style of zeus interface. Your UI coordinates will not work on other UI settings (UI scale, aspect ratio, ...) so I switched them to the grid used by the Zeus interface. Also the base class "ctrlStaticPicture" is not interactable with. The hiding and showing of the button can be detected by a keyDown UIEH. The variable I used I got from the script that is executed when the Zeus display is opened (\a3\ui_f_curator\ui\displays\rscdisplaycurator.sqf). -
How To Call Scripts Properly
7erra replied to Sertica's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The mission display (Display #46) is not present during mission init. Creating a control ontop of a non-existent dialog won't work. -
That was acutally intentional 😉. I can easily remove it though.
-
Enable Mouse Cursor/CursorTarget/CursorObject during Cutscene
7erra replied to Alert23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Or for no math: getPos _cam + screenToWorld + lineIntersectsObjs -
displayRemoveEventHandler doesn't clear index
7erra replied to phronk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yeah no concern there. Unless the engine uses another datatype for EHs. Bonus: Quick maths: Assuming an onEachFrame EH adds a new EH and engine limitations are the same you could run the script for 3.4028235e+38 / 60 (1/s) / 60 (1/min) / 24 (1/h) / 365 (1/d) = 1.7983804e+29 years = 179,838,040,000,000,000,000,000,000,000 years ACUTUAL ENGINE LIMITATION (int32): 2,147,483,647 / 60 (1/s) / 60 (1/min) / 24 (1/h) / 365 (1/d) = 68 years So basically a decent A3 weekend. If you still fell uncomfortable with large numbers, why not check in the eh itself if a condition is met and exit if not instead of adding and removing the eh? My guess for the origin of the bug is that with a consecutive counting style it is less probable to overwrite any exisiting ehs and also less resource intensive bc the engine does not have to check for unsused numbers. -
scripting Event handlers for certain unit classes?
7erra replied to zzguy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Easiest way would be to use CBA since it supports class eventhandlers: https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new). This way it will also include newly spawned units. Other option without mods woul be to run a loop like this: allUnits apply { if (_x is kindOf "Class") then { // code }; }; Depending on your mission you'd have to run this resource intensive code in a loop to make sure that every unit has the EH. -
Enable Mouse Cursor/CursorTarget/CursorObject during Cutscene
7erra replied to Alert23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ah yeah you'll have to add that code to the newly created dialog: class ALERT_EmptyDialog { idd = -1; onLoad = "_this execVM ""ui_init.sqf"";"; class controls { }; }; And the ui_init.sqf: params ["_display"]; _display displayAddEventHandler ["MouseButtonUP", { if (_this select 1 == 0) then { playSound "ShotGunSound"; if (cursorObject isKindOf "Man") then { cursorObject setdammage 1; //some codes }; false }]; (Also a little bit of better if then statements). I just noticed that cursorObject is not gonna work. The cursorObject will always return what is in the center of the screen, not where the mouse cursor actually is. To maintain a static camera view you'd probalby do some more math with lineintersectsObjs or some command of that sort 🤔 -
Enable Mouse Cursor/CursorTarget/CursorObject during Cutscene
7erra replied to Alert23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The dialog can be empty too. So put the following in the description.ext: class ALERT_EmptyDialog { idd = -1; class controls { }; }; Now you can create it with createDialog "ALERT_EmptyDialog"; -
Enable Mouse Cursor/CursorTarget/CursorObject during Cutscene
7erra replied to Alert23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ah okay that should be easy. You could create a dialog and also move your ui elements to that dialog. The mouse should now be moveable -
Enable Mouse Cursor/CursorTarget/CursorObject during Cutscene
7erra replied to Alert23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Is the screen static when shooting targets or is it the normal 3D movement with turning etc? -
Enable Mouse Cursor/CursorTarget/CursorObject during Cutscene
7erra replied to Alert23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You could do a loop what executes every frame: while {!isNull _display} do { _ctrl ctrlSetPosition getMousePosition; _ctrl ctrlCommit 0; _frame = diag_frameNo; waitUntil {_frame != diag_frameNo}; }; -
Registering damage on prop objects
7erra replied to Reeveli's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The "HitPart" EH fires for these kind of objects.