Jump to content

pedeathtrian

Member
  • Content Count

    284
  • Joined

  • Last visited

  • Medals

Everything posted by pedeathtrian

  1. Check pages in this category. Also see Locality in Multiplayer. And this awesome tutorial: ArmA Scripting Tutorials: Locality (actually you better start here). Check what commands your code uses with what arguments. Use already known to you remoteExec command. Use global variants of commands where possible.
  2. Of course I've read Revo's spoiler. And I've read this function file before. remoteExec simply does not exist in v1.42. BIS_fnc_MP does. Therefore not a single mission containing the former command will run on Linux or Mac.
  3. pedeathtrian

    SQL : character ":" causes error

    But at least there will be the way to store any data using your extension. Well, nevermind, I already posted code which is required only on user side. Didn't know that. Failed to find it on your wiki page. Seriously, I tried. This is actually (almost) enough to solve OP's problem without analyzing player's input on any side. So I take my words about obvious bug back. Sorry. We all know it can take forever. Unfortunately.
  4. No. Reread my post (part starting with "until finally", key word "until"). People sometimes write code much more FPS-unfriendly than BIS_fnc_MP. IKR. And, btw it is not useless for the Linux/Mac ArmA 3 players community. remoteExec is instant 0 FPS for them. Dont say for everyone. Even if you think those "everyone" do not exist.
  5. It is obsoleted, not deprecated. And it is backward-compatible by the way. I have to backport any mission I want to play before I can actually play it. And it is pain btw. Guess why I'm here. I don't play anymore, instead I'm becoming an SQF worm. Anyone using BIS_fnc_MP, please feel free to use it further (until finally VP releases ArmA 3 for Linux/Mac version >= 1.50). Thank you very much.
  6. pedeathtrian

    SQL : character ":" causes error

    Obviously, bug in extension. Imagine C did not give us \" for escaping of quotation marks in strings. torndeco, you should have provided some escaping to allow user input contain ":", like C-ctyle "\:" or smth like that. raptor2x, workaround is quite simple. Process user input before calling extension and what extension return on databse read: // 8758 is for U+2236 RATIO #define ESC_CHAR 8758 fnc_processStringOutputToDB = { // function replaces all occurencies of string "∶" with "∶0" and ":" with "∶1" // all function could be written as single line: // (((_this splitString toString [ESC_CHAR]) joinString toString [ESC_CHAR,48]) splitString ":") joinString toString [ESC_CHAR,49]; private ["_spl", "_repl"]; _spl = _this splitString toString [ESC_CHAR]; _repl = _spl joinString toString [ESC_CHAR,48]; // 48 is char '0'; _spl = _repl splitString ":"; _repl = _spl joinString toString [ESC_CHAR,49] // 48 is char '1'; _repl }; fnc_processStringInputFromDB = { // function replaces all occurencies of "∶0" with "∶" and "∶1" with ":" private ["_spl", "_i", "_count", "_chars", "_str"]; _spl = _this splitString toString [ESC_CHAR]; _count = count _spl; for [{_i = 1}, {_i<_count}, {_i=_i+1}] do { switch ((_spl select _i) select [0,1]) do { case "0": { _spl set [_i, (toString [ESC_CHAR]) + (_spl select _i) select [1]]; }; case "1": { _spl set [_i, ":" + (_spl select _i) select [1]]; }; }; }; _spl joinString "" }; ∶ is Unicode U+2236 RATIO symbol, decimal is 8758. Looks almost like colon, but it's not. Actually could be any symbol user most likely not entered before. Note, that you will need to convert all your affected database contents to replace ":" (colon) with "∶1" (RATIO then 1) and "∶" (RATIO) with "∶0" (RATIO then 0).
  7. How to integrate custom sound files in missions? (Searched forums for like 5 seconds)
  8. Make sure all variables are initialized at the time you spawn BIS_fnc_MP (or similar line in your case): waitUntil {!(isNil "laptop01" || isNil "laptop02" || isNil "laptop03")}; [ [ laptop01, laptop02, laptop03 ], "T8L_fnc_addActionLaptop", true, true] spawn BIS_fnc_MP; Demo version has this in init.sqf sleep 10; // I dont know why, but some sleep is requied or the Actions on the Objects wont work ... this is beyond my knowledge Yours probably don't (or 10 is not enough).
  9. It's just extra symbols creeped into the link. Correct link.
  10. pedeathtrian

    Arma 3 Scripting help

    sideChat has local effect, so only shows "TEST" string on computer where F12 was pressed. If you want to detect pressing of F12 key remotely you shoud specify another function and call it remotely, e.g. using remoteExec. Like this: if (isServer) then { Check_Me = [""]; Tell_Me = [""]; publicVariable "Check_Me"; publicVariable "Tell_Me"; } if (hasInterface) { fnc_reportF12 = { if ((getPlayerUID player) in Tell_Me) then { player sideChat format ["F12 pressed by %1 (UID %2)", _this select 0, _this select 1]; }; }; MY_KEYDOWN_FNC = { switch (_this) do { //Key F12 case 88: { [name player, getPlayerUID player] remoteExec ["fnc_reportF12", 0]; }; }; }; if ((getPlayerUID player) in Check_Me) then { waituntil {!isnull (finddisplay 46)}; (findDisplay 46) displayAddEventHandler ["KeyDown","(_this select 1) call MY_KEYDOWN_FNC; false;"]; }; }; Don't forget to allow your report function in CfgRemoteExec
  11. Your code is clunky, but it is correct. It does short circuit evaluation of your logical expression, whereas count does not (only within condition for every element). Most triggers exist and being checked for the whole mission run, so speed matters. I would also suggest put fast checks and checks that would most likely short circuit the whole expression first. Regarding the trigger. Try to delay its check by some flag variable or simply by checking that some time has passed since mission start: (diag_tickTime > 2000) && (/*...other checks go here...*/) or (!isNil "flagVariable") && (/*...other checks go here...*/) Assign any value to flagVariable soon after mission start, e.g. when your scientist gets in car, or, again, simply by time [] spawn { sleep 2; flagVariable = 1; };
  12. pedeathtrian

    Lightpoint brightness

    Move it 1m underground.
  13. pedeathtrian

    Angles in mission.sqm objects

    Most likely they are radians for yaw, pitch and roll/bank. Check Example 1 for setVectorDirAndUp command. Don't forget deg/rad conversion for trigonometric functions.
  14. pedeathtrian

    Config.cpp error, please help!

    You miss the }; for class NORFOR_Dingo_Base_F -- right before class NORFOR_Dingo_MG declaration. PS. And use spoilers, please.
  15. gc8, from the very link you gave us: So, I guess, "(group (_this select 0)) call test"
  16. pedeathtrian

    BIS_fnc_sortBy - broken

    The problem is in lines // replace with select {} {if !(call _filterFnc) then {_inputArray deleteAt _forEachIndex}} forEach _inputArray; Deleting from array being iterated. Every element following deleted element is not being checked at all. Since BIS_fnc_sortBy now uses sort internally, requirement for _this select 2: sorted algorithm (Code) to return scalar is no longer actual. It can return strings, numbers and arrays (all what sort accepts).
  17. pedeathtrian

    BIS_fnc_sortBy - broken

    Confirm (1.56.134627). Also, it does not raise error now if _this select 2: sorted algorithm (Code) returns non-scalar (like in first highhead's example).
  18. What is it? And why does it not take normal arguments array for the expression? If this array is used in your code you will probably want to rewrite it (code) to support array form of something like: ["Test", [2], "", -5, [["expression", [_group], "_this select 0 call test" ]], "1", "1", ""]
  19. Did you try thisList instead of player? Smth like: { private "_has"; _has = false; {_has = _has || _x hasBackpack "tf_rt1523g_big_rhs" } forEach thisList; _has } should check if any of your linked group members has this backpack.
  20. pedeathtrian

    changing the picture of the map

    Your picture of Stratis is off-centered. It has size of 4608x4608, whereas Stratis map area of 8192x8192 meters occupies 4506x4506 in the left bottom corner (good it is sqaure, so same proportions apply to both x and y). 4608 pixels make 8192*(4608/4506) = 8377.438082557 meters, so your icon center is located on Stratis coordinates [8377.438082557 / 2, 8377.438082557/2, 0] or (applying scale factor): [(4608/4506)*worldSize/2, (4608/4506)*worldSize/2,0]. Now to map overall scaling. Open map and scroll out until you see the entire map. Check what ctrlMapScale returns. If it's 1 then you see map size unscaled. In my case ~794 pixels (I guess should be same for you). To get more precise number zoom in while you still can see map borders, measure map size (e.g. on screenshot), then multiply by ctrlMapScale number. So I have 1839*0.431711=793.916529 pixels. Remember you have bigger picture than original Stratis, so width and height for youricon will be (4608/4506)*793.916529/(ctrlMapScale (_this select 0)). PS. You can fill white fields with black color in any graphical software to make them less irritating (it will merge with black background of arma3 map display) PS2. Or even better solution: crop the picture to the 4506x4506 square from the left bottom corner and fill the left white space. This area will 1:1 correspond to the Stratis world coordinates, so only scaling will be needed: no change to positioning from your variant, and 793.916529/(ctrlMapScale (_this select 0)) for icon dimensions.
  21. pedeathtrian

    Server linux 1.56 strange issue

    Oh yes, allow any proccess in the system post and wait on this semaphore! Genius. You could at most create a group for all users that run arma servers, and assign this group to semaphore, and make it readable and writeable by the group. But I personally wouldn't do even that. Applications know better than you what permissions to put on system objects. Unless they don't, haha.
  22. Came here from PreProcessor Commands. Sorry for necroposting. Considering comma as argument separator is known and required feature of any preprocessor (and C preprocessor too, btw). However, workarounds exist not involving changes to underlying code. I tested some and at least two of them worked. Tested on 1.42 LegacyPort for Linux (but I think everything worked the same way two years ago). First approach is to define macro for comma and use it instead of comma where comma is not considered to be argument separator. Second is to define macro simply copying its arguments list on the output. Both methods in one file (test.sqf): // defining #define COMMA , #define MULTIARGMACRO(arg1,arg2,arg3) someNameUsedByMacro(arg3,arg2,arg1); // using MULTIARGMACRO("foo",bar,["baz" COMMA qux]) // another approach #define COMMA2ARGS(arg1,arg2) arg1,arg2 MULTIARGMACRO(foo,"bar",COMMA2ARGS([baz,"qux"])) Preprocessing with following command: diag_log preprocessFile "test.sqf" gave me this result: 13:22:31 " someNameUsedByMacro(["baz" , qux],bar,"foo"); someNameUsedByMacro([baz,"qux"],"bar",foo); "
  23. Indeed it is. But how do you know it's not implemented on top of "DropWeapon"? How do you know it is not that slow? Anyway, list me in for the new nice proper command(s).
  24. Thank you, gentlemen! Looks like "DropWeapon" is what I was looking for.
×