-
Content Count
816 -
Joined
-
Last visited
-
Medals
Everything posted by Schatten
-
quick question on how to id terrain object
Schatten replied to twistking's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@twistking, use select command. -
Problem with getVariable
Schatten replied to Vadym Mazur's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Maybe, it depends on what you want. -
Problem with getVariable
Schatten replied to Vadym Mazur's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You can use either database or profile namespace (profileNamespace, missionProfileNamespace). -
Problem with getVariable
Schatten replied to Vadym Mazur's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Your code work's fine for me, but returns empty string, because the last line returns it (_text remoteExec ['systemChat',-2,FALSE];). It also won't systemChat of player's rankRating, because systemChat will be executed on each client, but not the server (in singleplayer or hosted game admin's computer is server). -
CfgNotifications error. Can't find the problem.
Schatten replied to DMFalke's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@DMFalke, configs in SQF files won't work. You should include notifications.sqf (BTW, I recommend to change extension to cpp) into Description.ext. -
CfgNotifications error. Can't find the problem.
Schatten replied to DMFalke's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@DMFalke, publish a code where CfgNotifications class is included. -
Problem with getVariable
Schatten replied to Vadym Mazur's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Where this code is placed? -
Problem with getVariable
Schatten replied to Vadym Mazur's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Vadym Mazur, you use wrong syntax of getVariable command. -
Problem with getVariable
Schatten replied to Vadym Mazur's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes. -
Problem with getVariable
Schatten replied to Vadym Mazur's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Vadym Mazur, you set rankRating variable in mission namespace, but get it's value from unit's namespace. Set value in unit's namespace, and, if it's multiplayer mission, make it public. -
Good luck! By the way, you don't have to use preprocessor commands: private ["_captureMarker1", "_captureMarker2"]; for "_n" from 1 to 19 do { _captureMarker1 = format ["capture_%1", _n]; _captureMarker2 = format ["capture_%1", _n + 1]; ... };
-
You can use for-loop: #define CAPTURE_MARKER_FORMAT "capture_%1" private ["_captureMarker1", "_captureMarker2"]; for "_n" from 1 to 19 do { _captureMarker1 = format [CAPTURE_FORMAT_MARKER, _n]; _captureMarker2 = format [CAPTURE_FORMAT_MARKER, _n + 1]; ... };
-
Delay to unit when drop plane
Schatten replied to Casio91Fin's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Casio91Fin, spawn your code as a new script, where using suspensions is allowed. -
@Stormmy1950, I fixed the problem, also I rewrote your code: addMissionEventHandler ["Draw3D", { if (!isGameFocused) exitWith { }; if (!((((vehicle player) isKindOf "Air") || { _control = UAVControl (getConnectedUAV player); ((_control find player) + 1) == (_control find "GUNNER") }) && { cameraView == "Gunner" })) exitWith { }; _zoomLevel = round ((([0.5, 0.5] distance2D (worldToScreen (positionCameraToWorld [0, 3, 4]))) * (getResolution select 5) / 2) * 10) / 10; _offsets = switch (true) do { case (_zoomLevel <= 0.5): { [ [[0, 1, 0], [0, 0.5, 0]], [[0, -1, 0], [0, -0.5, 0]], [[1, 0, 0], [0.5, 0, 0]], [[-1, 0, 0], [-0.5, 0, 0]] ] }; case ((_zoomLevel > 0.5) && { _zoomLevel <= 3 }): { [ [[0, 0.25, 0], [0, 0.12, 0]], [[0, -0.25, 0], [0, -0.12, 0]], [[0.25, 0, 0], [0.12, 0, 0]], [[-0.25, 0, 0], [-0.12, 0, 0]] ] }; case (_zoomLevel > 3): { [ [[0, 0.06, 0], [0, 0.03, 0]], [[0, -0.06, 0], [0, -0.03, 0]], [[0.06, 0, 0], [0.03, 0, 0]], [[-0.06, 0, 0], [-0.03, 0, 0]] ] }; default { [] }; }; if ((count _offsets) == 0) exitWith { }; _drawIcon3DArgs = [ "", [], [], 0, 0, 0, "", 2, 0.05, "PuristaMedium" ]; _center = AGLToASL (positionCameraToWorld [0, 0, 3]); { _letter = _x select 0; _color = _x select 1; _offsetsPair = _offsets select _forEachIndex; _drawIcon3DArgs set [1, _color]; _drawIcon3DArgs set [2, ASLToAGL (_center vectorAdd (_offsetsPair select 0))]; _drawIcon3DArgs set [6, _letter]; drawIcon3D _drawIcon3DArgs; _drawIcon3DArgs set [2, ASLToAGL (_center vectorAdd (_offsetsPair select 1))]; _drawIcon3DArgs set [6, "."]; drawIcon3D _drawIcon3DArgs; } forEach [ ["N", [1, 0.1, 0.1, 1]], ["S", [1, 1, 1, 0.7]], ["E", [1, 1, 1, 0.7]], ["W", [1, 1, 1, 0.7]] ]; }];
-
multiplayer Save Loadout and Position on disconnect
Schatten replied to MrDj200's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is because PlayerConnected event, where player's loadout, position and direction are restored, occurs when a player connects to a server, not joins a mission. As a workaround, reconnect to the server. Or try this patch: if (isServer) then { TAG_fnc_loadClientData = compileFinal ((str { params [ ["_client", objNull, [objNull]] ]; if (isNull _client) exitWith { }; private _clientData = profileNamespace getVariable ["TAG_disconnectedLoadouts", createHashMap]; private _clientDatum = _clientData getOrDefault [getPlayerUID _client, []]; if (_clientDatum isEqualTo []) exitWith { }; _clientDatum remoteExecCall ["TAG_fnc_applyClientData", _client]; }) trim ["{}", 0]); }; if (!isDedicated) then { TAG_fnc_applyClientData = compileFinal ((str { params [ ["_loadout", [], [[]]], ["_position", [], [[]], [2, 3]], ["_direction", 0, [0]] ]; if ((_loadout isEqualTo []) or { _position isEqualTo [] }) exitWith { false }; player setUnitLoadout _loadout; player setDir _direction; player setPos _position; true }) trim ["{}", 0]); waitUntil { !(isNull player) }; [player] remoteExecCall ["TAG_fnc_loadClientData", 2]; }; -
@topden, here seems to be a suitable example for weapon holder removal. To block getting weapons, you need to handle InventoryClosed event, where, for example, to assign the player's GUID to the weapon holder, and InventoryClosed event, where to check this GUID and, if it is equal to the player's GUID, close the inventory. Plus, you need to add using inGameUISetEventHandler command Rearm event handler, where also check the GUID.
-
ListBox multiple item selection issues
Schatten posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey! I have an issue related to ListBox multiple item selection. I've set style property of my list box: style = LB_TEXTURES + LB_MULTI; To use these constants I've included this file: #include "\a3\3den\UI\resincl.inc" Despite that I can't select multiple items with either Shift or Ctrl. Another issue is that if the first item is selected, lbSelection command returns an empty array. This is probably a bug. Can anyone check these issues on their PCs? -
ListBox multiple item selection issues
Schatten replied to Schatten's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I assumed that if to deselect all list box items in regular list box you should use _control lbSetCurSel -1; then to do the same for LB_MULTI list box, you should use lbSetSelected with appropriate changes. -
ListBox multiple item selection issues
Schatten replied to Schatten's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sure. I have such dialog: and want to delete list box items and deselect all of them after unloading cargo items. According to BIKI: My list box has LB_MULTI style, so let's use lbSetSelected: private _netIds = (lbSelection _control) apply { _control lbData _x }; { for "_i" from 0 to ((lbSize _control) - 1) do { if ((_control lbData _i) == _x) exitWith { _control lbDelete _i; }; }; } forEach _netIds; _control lbSetSelected [-1, true]; The result is here: Now let's see the result of using lbSetCurSel: -
ListBox multiple item selection issues
Schatten replied to Schatten's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Also, despite BIKI, you can't use lbSetSelected command to deselect all items in LB_MULTI list box -- I had to use lbSetCurSel instead. So either BIKI has wrong info or lbSetSelected is bugged. -
ListBox multiple item selection issues
Schatten replied to Schatten's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks, @Larrow! The problem was that I was updating the list box content in a loop. I've moved the list box populating code outside of the loop and now everything works fine, both multi selection and lbSelection command. -
How to select a script at random?
Schatten replied to Joe98's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Joe98, you can simplify code: private _scriptName = selectRandom ["script1", "script2", "script3", "script4", "script5"]; execVM (format ["%1.sqf", _scriptName]); It depends what you want. -
@Robustcolor, if you don't need main marker names, then you can simplify the code: _markers = [["m1_1", "m1_2"], ["m2_1", "m2_2"]]; _subTarget = selectRandom (selectRandom _markers); If you need main marker names, then you can use either this code: _markers = [["1", ["m1_1", "m1_2"]], ["2", ["m2_1", "m2_2"]]]; _subTarget = selectRandom ((selectRandom _markers) select 1); or this one: _markersHashMap = createHashMap [["1", ["m1_1", "m1_2"]], ["2", ["m2_1", "m2_2"]]]; _subTarget = selectRandom (_markersHashMap get (selectRandom (keys _markersHashMap)));
-
hint with linebreak/column
Schatten replied to Robustcolor's topic in ARMA 3 - MISSION EDITING & SCRIPTING
No. To do this you need to use @7erra's code and structured text. -
hint with linebreak/column
Schatten replied to Robustcolor's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Harzach, I've got this: https://imgur.com/a/T24LrmE