Jump to content

7erra

Member
  • Content Count

    753
  • Joined

  • Last visited

  • Medals

Everything posted by 7erra

  1. 7erra

    quick stringReplace

    Huh when I tested it I had about the same result for GOM_fnc_replaceString as for PX_fnc_stringReplace (GOM's was 0.0001ms faster) and a way better performance for my code... Must be the hardware.
  2. 7erra

    quick stringReplace

    I made nearly the same function a year ago :D Here is an efficency comparison: Code: ["xxx is awesome, I love xxx!", "xxx", "Arma"] call PX_fnc_stringReplace; Result: 0.0137 ms Cycles: 10000/10000 Code: ["xxx is awesome, I love xxx!", "xxx", "Arma"] call TER_fnc_editString; Result: 0.0157 ms Cycles: 10000/10000 You win this time ;D
  3. Well the Zeus system is actually pretty good. Nearly no scripting, vanilla and easy to use. The part of not blocking entries is another problem though...
  4. The exit code is used in the "unLoad" eventhandler of the dialog itself: https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onUnload It is the second param: params ["_closedDialog","_exitCode"];
  5. 7erra

    unit not editable in zeus

    AHHHHH... addCuratorEditableObjects curatorObj addCuratorEditableObjects [[this],true]; Put this into the init line of the object and name your zeus module curatorObj or something similar.
  6. 7erra

    unit not editable in zeus

    Are you trying to remove the object from being placable (right panel) or do you want to remove a specific object (left panel)?
  7. 7erra

    unit not editable in zeus

    curatorObj removeCuratorEditableObjects [[this],true] Well this would remove the object from Zeus on mission start (init line). If you are talking about the function then you should put it into the init.sqf.
  8. 7erra

    unit not editable in zeus

    With this function you can add only the objects you want to have: BIS_fnc_curatorObjectRegisteredTable If you want to remove an object from Zeus which was placed beforehand then look here: removeCuratorEditableObjects
  9. Yeah because BIS_fnc_spawnGroup returns a group and not an object. The syntax looks like this: object0 synchronizeObjectsAdd [object1, object2, object3,...,objectN]; Also putting "" around resistancegroup1 doesn't make sense, since it is a variable. Furthermore modules are only initalized at the start of the mission/their creation. Any further edits have no effect. There is a command to add a group to high command though: _newGroup = [getMarkerPos "MARK2", resistance, ["LIB_US_Engineer_w", "LIB_US_Engineer_w", "LIB_US_Engineer_w"]] call BIS_fnc_spawnGroup; player hcSetGroup [_newGroup] hcSetGroup
  10. 7erra

    Shout town script

    Your syntax for addEventHandler is wrong. You are using an array where you should acutally use an object. What exactly are th_1-3 and tr_1-3?
  11. 7erra

    Force AI Stance

    This part won't be executed. Leave out the brackets: { if (side _x == resistance) then { _x setUnitPos (selectRandom ["UP", "MIDDLE"]); }; } forEach allUnits;
  12. _cam = "camera" camCreate getPos player; _cam cameraEffect ["internal", "BACK"]; _targetPos = getPos player; _cam camSetTarget _targetPos; _cam attachTo [testPlane,[0,0,-2]]; _cam camCommit 0; The camSetAttachedLookDir command is not in ArmA3 but in VBS which is developed by BI Simulations, not BI.
  13. 7erra

    Display graph in dialog

    Okay got it (kind of). Video: Scripts: https://drive.google.com/open?id=1gujKZpdbneZmoZRj5BLg0xhcsWCAfosw I had some problems with the math behind the RscLine solution even though @atmo already did a great job on that one Therefore I sticked to the progress bar.
  14. 7erra

    Display graph in dialog

    Wow looks really good! Do you think there is a way to make the line appear like the Task Manager in Windows? Also labeling the axes would be amazing ;) I'm going to try out some stuff too
  15. Alright I've found a solution on my own: Using BIS_fnc_curatorObjectRegisteredTable you can only add the classnames of the objects that you want. If you want to place an unlimited amount of objects just set the cost to 0. The Zeus module has to have all addons unlocked beforehand, otherwise the objects won't be added. Example: [curatorObj,[ "Land_HBarrier_01_line_1_green_F", 0, "Land_HBarrier_01_wall_corridor_green_F", 0 ]] call BIS_fnc_curatorObjectRegisteredTable; This will only unlock the Hesco barriers. As to what I want to achieve after all is a building system and it just got a lot better ;) I may make a guide for this at some point.
  16. It is possible as long as you script it. The unit has to be on the same side and needs a radio. This is a huge topic in ArmA, locality in MP. You first have to understand the basics, like what instances there are (Client, server, and some more), how the commands behave in MP (see the top of the command BIKI page there are some abbreviations like EL, EG, etc). remoteExec is your best friend when it comes to executing local commands to have global effect. Here is an example: [_unit, "My message"] remoteExec ["sideChat",0];
  17. The better condidtion would be waitUntil { {_x in iran_mrap1} count (units group_varza1) == count (units group_varza1) }; sleep 10; hint "MARK";
  18. private ["_pos_jose","_random_pos_jose"]; _pos_jose = [[24871.3,23103.8,1.3],[24869.2,23099.7,1.4],[24852.4,23106.2,0.3],[24843.9,23082.7,0.1],[24837.9,23206.3,0.4],/*masure_foret*/[24868.6,23219.4,3.1],[24655.2,23186.9,0.2],[24876.7,23097.9,0.1]]; _dir_jose = [138,63,70,117,44,128,172,205]; _pos_gdc1 = [[24874.2,23106,1.3],[24866.6,23095.8,1.5],[24852,23111.7,0.1],[24846.8,23079.4,0.1],[24847.7,23202.8,0.1],[24872.1,23214.8,3.1],[24665.9,23173.6,0.2],[24884.3,23099.6,0.1]]; _dir_gdc1 = [321,298,10,145,271,137,76,102]; _random_pos_jose = selectRandom _pos_jose; _index = _pos_jose find _random_pos_jose; _jose setPosAtl _random_pos_jose; _jose setDir (_dir_jose select _index); _gdc1 setPosATL (_pos_gdc1 select _index); _gdc1 setDir (_dir_gdc1 select _index); selectRandom and find are your friends. The forEach command goes through ALL array elements, therefore only the last array element will be the final position and direction.
  19. I don't know about the modded way either but you can do this: player addAction ["Roll up sleeves", { _items = uniformItems player; player forceAddUniform "uniform_classname_long"; {player addItemToUniform _x;} forEach _items; }, [], 1.5, false, true, "", "uniform _this == ""uniform_classname_short"""]; player addAction ["Roll down sleeves", { _items = uniformItems player; player forceAddUniform "uniform_classname_short"; {player addItemToUniform _x;} forEach _items; }, [], 1.5, false, true, "", "uniform _this == ""uniform_classname_long"""]; Where "uniform_classname_short" is your rolled up version and "_long" the opposite one. This is certainly not the smoothest way since the condition is evaluated each frame but better than nothing. Put this in the onPlayerRespawn.sqf because addAction has to be added again after respawn. NOT TESTED.
  20. 7erra

    Creating Markers Not Working

    Ah the _pos variable wan't defined : _pos = [[14672,16625.6], 0, 13000, 3, 0, 1.0, 0] call BIS_fnc_findSafePos; _newtanks29 = [_pos, EAST, (configFile >> "CfgGroups" >> "EAST" >> "OPF_F" >> "Armored" >> "OIA_TankPlatoon")] call BIS_fnc_spawnGroup; _markerstr = createMarker ["TestTest",leader _newtanks29]; _markerstr setMarkerShape "ICON"; _markerstr setMarkerType "ExileMissionModerateIcon"; _markerstr setMarkerText "Test Test Charlie";
  21. What about player addItemToUniform "hgun_Rook40_F"; ? Same goes for addItemToVest and addItemToBackpack.
  22. 7erra

    Entrenched Tank

    Hm when I needed to get a vehicle underground then attachTo did the trick. Did you place the gamelogic below the ground as well? If so then it might be better to keep it at 0m and use the offset instead.
  23. What is the code you are using @pierremgi?
  24. I guess that the script is executed on the server therefore you can run all other commands on the server only too. Use this: ["You've killed %1",_eosKills,". Counter reset"] remoteExec ["hintC", [0,-2] select isDedicated]; Look at the syntax for remoteExec. select can also take true and false as parameter, so if it is a dedicated server then the hint will only be shown to people with interface. That's right. The script will be executed where unit is local (server, I guess). There's no need for a public variable then. What exactly is server in your script? _eosKills = _eosKills + 1; server setvariable ["EOSkillCounter",_eosKills,true]; Remove the true from the array since it is unnecessary network traffic. As far as this script goes the variable is only needed on the server. Correct me if i'm wrong. That's right. I never use private I just define the variables beforehand. Another smooth trick is to do this: _myVar = if (_condition) then {_valueTrue} else {_valueFalse}; Same goes for switch-do: _myVar = switch _value do { case _value1: {_result1}; case _value2: {_result2}; case _value3: {_result3}; default {_defaultResult}; }; Yes. Declaring a variable to only use it once or if it is short (one digit) is not wrong but not good practice. But that's your taste. Keep in mind that longer script will also take up more performance which is the case here.
×