Jump to content

7erra

Member
  • Content Count

    753
  • Joined

  • Last visited

  • Medals

Everything posted by 7erra

  1. @Larrow If BI didn't change the setPos command family then it is not MP friendly. Last time I tested it the executing instance saw the object move smoothly while I saw it warp across the scenery as if only every nth command was broadcasted. This might be because the every frame refers to the frames that the script executor has and not the other clients'. This was like 2 years back though... My two cents would be to use Keyframe Animation.
  2. @gc8 The teleport is meant to work while looking at a location. A3 has a default map teleport with the keybind ALT + LMouse.
  3. @Tankbuster Hmm that's a though one. Unfortunately there is no way to manipulate the text height of a control outside of its config. All I can say is that the whole debug console scales with the ui size, so setting it to small or very small will actually give you more space for commands but will also make all other ui elements smaller.
  4. v2.3 - "Config Viewer 73" Update + "Config Viewer 73": Adds a modern UI for browsing configs This is one of my favourite additions so far. The idea had been there for a longer time but now I was finally able to pull it off. There are still some functionalities missing such as config inheritance. I will be working on adding other options to access the config viewer (shortcut in 3den, escape menu) as you can only access it via the toolbar in 3den atm.
  5. 7erra

    Global hint format

    Less functions more commands: _time = selectRandom [45, 60, 120]; format ["All friendly units are KIA. Next available unit in: %1 seconds!", _time] remoteExec ["hint", 0]; remoteExec is the way to go.
  6. [_veh, ["<t color ='#ffcc00'>Radio on</t>",{ params ["_target", "_caller", "_actionId", "_arguments"]; [_target, [selectRandom ["music_one","music_two","music_three","music_four","music_five","music_six","music_seven"],2000,1]] remoteExec ["say3D"]; },[],1.5,true,true,"","driver _target == _this"]] remoteExec ["addAction", 0, _veh]; The addaction script runs in another instance (scope? Don't know the correct term) of the script. No local variables from your script will be usable there. Instead we can use the arguments passed to the function where the first parameter references the object the action is attached to, the _veh.
  7. This will only add the action on the machine (server or ONE client) that executes the script. Visibility will depend on how you call the script. There are some symbols on the BIKI page that tell you about the MP compability of the command. In case of addAction: - Arguments Global: _veh object can be local to another machine and still be used - Effects Local: Action is only visible on the machine that executes the command Therefore remoteExecution is required: [_veh, ["Music on",{ [_veh, [selectRandom ["music_one","music_two"],2000,1]] remoteExec ["say3D"]; },[],1.5,true,true,"","driver _target == _this"]] remoteExec ["addAction", 0, _veh]; selectRandom should work. By the way: No need to create a private local variable when you want to make it global anyway. setVehicleVarname is only an identifier and has no effect in scripts. veh_music = createVehicle [selectRandom ["O_G_Offroad_01_armed_F","I_C_Offroad_02_LMG_F"], _pos, [], 0, "NONE"];
  8. Hi, I was creating a dialog with a combo and was using the lbSetCurSel command. Apparently the BIKI is not entirely correct because it states ~ https://community.bistudio.com/wiki/lbSetCurSel There is one note which seems interesting: ~ @dreadedentity, November 29, 2014 It looks like this behaviour only applies to Listboxes (CT_LISTBOX) but not Combos (CT_COMBO). Instead when selecting the "-1st" entry it selects the 0th. So here's the question: Has anyone got an idea how to deselect a combo entry (ideally without clearing it)?
  9. _ctrl lbSetCurSel _ind; This one. Referencing a control only by it's IDC might lead to interferences with other controls with the same IDC.
  10. Some ideas: Have you made sure that the code executes? Maybe the if statements are returning false? Instead of this maybe use createAgent? The BIS_fnc_initModules_disableAutoActivation has to be set to false. Why so many ";;"? It shouldn't break anything but is not good practice. Otherwise I'd suggest checking with diag_log if the modues are created _item18813 = (group (missionNamespace getvariable ["BIS_functions_mainscope",objnull])) createUnit ["ModuleEffectsBubbles_F",[15231.8,14142.8,0.494209],[],0,"CAN_COLLIDE"]; diag_log [_item18813, alive _item18813, isNull _item18813, isNil "_item18813"];
  11. When talking about GUI coordinates then absolute values mean 0, 0.5, 0.6345, etc.. This coordinate system was used for 4:3 screens and is out of date. Instead BI introduced safeZone coordinates. Based upon these BI develeoped a newer coordinate system called GUI_GRID. This is used in nearly all dialogs ingame because it guarentees the visibility of controls even with different settings (UI size, monitor size, screen ration, etc.). When dealing with UI elements it is always good practice to set your UI settings to the extreme options, like UI scale: Very Large. You might notice that your text won't stay where it is while the RscUnitInfo will move somwhere else on the screen. These positions are not absoulte because they use the original positions which are GUI_GRID, so simple math with a complicated background. This is the config for the Fuelbar (a3\ui_f\config.bin: RscIngameUI >> RscUnitInfo) : class CA_ValueFuel: RscProgress { idc=113; texture="#(argb,8,8,3)color(1,1,1,1)"; text="#(argb,8,8,3)color(1,1,1,1)"; x="0 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (profilenamespace getvariable [""IGUI_GRID_VEHICLE_X"", (safezoneX + 0.5 * ( ((safezoneW / safezoneH) min 1.2) / 40))])"; y="1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getvariable [""IGUI_GRID_VEHICLE_Y"", (safezoneY + 0.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; w="10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; h="0.2 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; Or translated to the GUI_GRID defines: class CA_ValueFuel: RscProgress { idc=113; texture="#(argb,8,8,3)color(1,1,1,1)"; text="#(argb,8,8,3)color(1,1,1,1)"; x="0 * GUI_GRID_W + (profilenamespace getvariable [""IGUI_GRID_VEHICLE_X"", (safezoneX + 0.5 * GUI_GRID_W)])"; y="1 * GUI_GRID_H + (profilenamespace getvariable [""IGUI_GRID_VEHICLE_Y"", (safezoneY + 0.5 * GUI_GRID_H)])"; w="10 * GUI_GRID_W"; h="0.2 * GUI_GRID_H"; }; So using 5 times the control's height (ctrlPosition _ctrl select 3) is the same as using 1 * GUI_GRID_H. Btw the newest gui coordinate system is the pixelGrid but this is another story.
  12. _rscUnitInfo = uiNamespace getVariable "RscUnitInfo"; _ctrlPos = ctrlPosition (_rscUnitInfo displayCtrl 113); _ctrlPos params ["_xP", "_yP", "_wP", "_hP"]; _ctrl = _rscUnitInfo ctrlCreate ["RscStructuredText", 200401]; _ctrl ctrlSetTextColor [0,0,0,1]; _ctrl ctrlSetStructuredText parseText format ["<t align='center' size='0.45' shadow='0'>%1%2</t>", ((fuel vehicle player)*100) toFixed 0, "%"]; _ctrl ctrlSetPosition [_xP, _yP - _hP/2, _wP, 2 * _hP]; _ctrl ctrlCommit 0; The magic here is the Structured Text. The attribute "center" aligns the text. Some other notes: You can use the display itself to display the value. When exiting the vehicle it is reset and doesn't show up anymore. Use the RscStructuredText base class. When chaning the ui size it scales the text size correctly. ctrlSetTextColor for more contrast on white background You can play around with the 'size' parameter to find something that suits you vehicle command instead of objectParent seems a bit more intuitive but doesnt matter GUI positions are a bit complicated. You were using absolute values which will stay the same while the ui changes depending on UI size, screen size, ... The only problem that remains is that RscUnitInfo closes as soon as you leave the vehicle. Calling it everytime the player enters a vehicle is a possible solutin with a getin EH.
  13. From the BIKI (https://community.bistudio.com/wiki/Eden_Editor:_Object) if (isServer) then {[this, ["Pickup Key","Scripts\PickupKey.sqf"]] remoteExec ["addAction", 0, this]; Seems a bit whack but cant think of anything better.
  14. Add this to the "Expression" on the Spawn AI module: [param[0], getPos param[1], 200] call bis_fnc_taskPatrol
  15. 7erra

    Detach command delay

    The command immediately detaches the object. The object sometimes gets stuck in the air though (even PhysX™️) objects.
  16. A soldier on foot will move to the exact position (if it is reachable). If there is an object in the way the unit will move to a nearby position, depending on the size of that object. _unit assignAsDriver _car; [_unit] orderGetIn true; _inAnim = toLower getText(configfile >> "CfgVehicles" >> typeOf _car >> "getInAction"); waitUntil { _inAnim in toLower animationState _unit }; _car lockDriver true; [_unit] orderGetIn false; _unit switchMove ""; unassignVehicle _unit; sleep 1; _car lockDriver false; Problem is that the unit sees the car as an obstructing object, so he wont go near the door. This script tells the unit to get in the vehicle but denies him access when he actually gets there.
  17. Hi everyone and happy new year! Introduction This is my first script in 2020. @Ori150418 posted a request about a marker searching system and this piqued my interest so I got to work. This script adds a searchable list with all markers to the right side of the map (see video below). Features Adds list with all markers Markers are searchable by their text Updates positions periodically Updates markers when opening the map Includes user made markers List is hideable Note: The performance might suffer in missions with a lot of markers. The example mission has a small test built into it which generates 100 markers randomly on the map. I'd appreciate feedback about the performance as I have a good enough system to not notice a difference. Usage Copy the file "fn_markersearch.sqf" to your mission directory Add the following line to your init.sqf/initPlayerLocal.sqf: ["init"] execVM "path\to\file\fn_markersearch.sqf" Video Downloads https://github.com/7erra/marker_search Have fun!
  18. Yes I know but that depends on what data type the params are. The information is not enough to work with for me. If it is a string/number/object then comparing these is no problem but it gets harder with code/arrays.
  19. 7erra

    Campaign Style Map Markers

    That whole system is called ORBAT: https://community.bistudio.com/wiki/Arma_3_ORBAT_Viewer. There is a module to handle the groups and markers but writing the config is still neccessary.
  20. What datatype (number, string, ...) are _patrol/_hunt/_garrison?
  21. When setting up the dialog you could use lbSetValue to assign a value to each entry with the price from the array. When the player buys an item that value can be returned with lbValue.
  22. This is what I would try: addMissionEventHandler ["EntityKilled",{ params ["_killed","_killer","_instigator"]; _vehicles = [vehCivSUV_1,vehCivSUV_2];// Add the names of the vehicles which should respawn if !(_killed in _vehicles) exitWith {};// Don't run if no relevant vehicle was destroyed _var = vehicleVarName _killed;// get the name of the car _type = typeOf _killed;// "C_SUV_01_F" or whatever type of vehicle the previous one was deleteVehicle _killed; _newVeh = _type createVehicle [1263,1298,0];// Only works if there is only one respawn position _newVeh setVehicleVarName _var;// Set the name of the object (NOT THE SAME AS "mySUV = _newVeh;") missionNamespace setVariable [_var,_newVeh,true];// Now the variable also references the actual object (MP and JIP) }]; I kept it as simple as possible but this limits the amount of respawn positions to only one. Therefore not sure if both cars blow up when getting destroyed and respawned at the same time.
  23. 7erra

    Titlecut Issues

    The BIKI suggests naming your layer so can you try again with "layer_name" cutText ["","BLACK OUT",4]; ? Adapt the rest of the script accordingly.
×