Jump to content

HazJ

Member
  • Content Count

    2756
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by HazJ

  1. Hi all, I have this little function that creates booby traps on doors. I can't seem to figure out how to return the direction of a door though. Any ideas? /* Code written by Haz */ scriptName "fn_doorBoobyTraps"; #define __FILENAME "fn_doorBoobyTraps.sqf" // #include "..\..\..\includes.sqf" // __tky_starts; CQBCleanupArr = []; pt_tripmines = []; // TODO: Code refactoring // (?) TODO: Switch to a blacklist approach rather than whitelist? _eligibleBuildings = [ /* "Land_building_Big_01_F", "Land_building_Small_01_F", "Land_building_Small_02_F", "Land_building_Small_03_F", "Land_building_Small_04_F", "Land_building_Small_05_F", "Land_building_Small_06_F", "Land_Shed_02_F", "Land_Shed_05_F", "Land_Shop_Town_01_F", "Land_Shop_Town_03_F", "Land_Slum_01_F", "Land_Slum_03_F", "Land_i_building_Big_01_V2_F", "Land_i_building_Big_02_V1_F", "Land_i_building_Big_02_V2_F", "Land_i_building_Big_02_V3_F", "Land_i_building_Small_02_V2_F", "Land_i_building_Small_02_V3_F", "Land_i_Shed_Ind_F", "Land_i_Stone_buildingSmall_V1_F", "Land_i_Stone_buildingSmall_V2_F", "Land_i_Stone_buildingSmall_V3_F", "Land_u_building_Big_01_V1_F", "Land_u_building_Small_02_V1_F" */ ]; _fnc_getDoors = { params ["_building"]; _buildingPositions = _building buildingPos -1; _buildingPosition = selectRandom _buildingPositions; hintSilent str selectionNames _building; { _arrow = "Sign_Arrow_Cyan_F" createVehicleLocal _x; _arrow setPosATL _x; } forEach _buildingPositions; _doors = []; _doorPositions = []; _worldPos = []; _inModelPosition = []; { if (_x find "door" >= 0 and _x find "handle" < 0) then { _doors pushBack _x; _inModelPosition = _building selectionPosition _x; hintSilent str _inModelPosition; _arrow = "Sign_Arrow_Yellow_F" createVehicleLocal [0, 0, 0]; _arrow setPos (_building modelToWorld _inModelPosition); // _doorPositions pushBack (getPosATL _arrow); _doorPositions pushBack [getPosATL _arrow, 0]; // TODO: Figure out how to return the direction of a door }; } forEach selectionNames _building; _doorPositions }; _fnc_createMine = { params ["_pos", "_dir"]; _building = nearestBuilding _pos; _m = createMine ["APERSTripMine", _pos, [], 0]; _m setDir _dir; CQBCleanupArr pushBack _m; pt_tripmines pushBack _m; // [_m, "mymine"] call fnc_setVehicleName; _m }; { _doors = _x call _fnc_getDoors; { _x params ["_pos", "_dir"]; systemChat format [":: %1", _x]; [_pos, _dir] spawn _fnc_createMine; } forEach _doors; } forEach nearestObjects [player, _eligibleBuildings, 500]; // __tky_ends; There are some elevation issues that I haven't addressed yet. Though that isn't the focus at the moment.
  2. You could use a simple trigger. When the man is not inside, it completes. You could sync it to a task. I'm not sure how you have things setup. Could you provide some more information? I don't really use the Editor for anything other than playable units and respawn markers. I'm on mobile at the moment so I can't be much help. Search the Wiki for 'in' and 'list'. !unit1 in thislist
  3. Hi all, I am using RscXListBox as you can see in the picture but it seems offset (not centered) so I am looking for a fix. If I change the text to say just "A" then you can see the issue more. Hopefully there is simple fix and I don't have to create invisible spacing. class RscXListBox { deletable = 0; fade = 0; idc = -1; type = CT_XLISTBOX; x = 0.1; y = 0.1; color[] = {1,1,1,0.6}; colorActive[] = {1,1,1,1}; colorDisabled[] = {1,1,1,0.25}; colorSelect[] = {0.95,0.95,0.95,1}; colorText[] = {1,1,1,1}; soundSelect[] = { "\A3\ui_f\data\sound\RscListbox\soundSelect", 0.09, 1 }; colorPicture[] = {1,1,1,1}; colorPictureSelected[] = {1,1,1,1}; colorPictureDisabled[] = {1,1,1,0.25}; colorPictureRight[] = {1,1,1,1}; colorPictureRightSelected[] = {1,1,1,1}; colorPictureRightDisabled[] = {1,1,1,0.25}; tooltipColorText[] = {1,1,1,1}; tooltipColorBox[] = {1,1,1,1}; tooltipColorShade[] = {0,0,0,0.65}; style = ST_CENTER + LB_TEXTURES + SL_HORZ; shadow = 2; arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa"; arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa"; border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa"; w = 0.14706; h = 0.039216; font = "RobotoCondensed"; sizeEx = GUI_TEXT_SIZE_MEDIUM; }; As you can see, it has ST_CENTER but it seems that there is more padding on the right side. class spawnType : RscXListBox { idc = idc_spawnSelection_spawnType; x = 0.2875 * safezoneW + safezoneX; y = 0.3 * safezoneH + safezoneY; w = 0.15 * safezoneW; h = 0.03 * safezoneH; text = ""; };
  4. Not tested. For quick test, name your trigger say trg1 and inside init.sqf: player addAction [ "Teleport everyone to trigger", { _x setPos getPos trg1; } forEach allPlayers - entities "HeadlessClient_F"; ];
  5. allUnits will move everyone. No need for the isPlayer check when you can do: { // setPos... } forEach allPlayers - entities "HeadlessClient_F"; // exclude Headless Clients https://community.bistudio.com/wiki/allPlayers
  6. HazJ

    Authority 20 player coop.

    Wah... lol. There will also be a parameter to turn the feature off completely.
  7. HazJ

    Authority 20 player coop.

    Here is a video demonstrating the functionality. Still a work in progress. Video by @Tankbuster
  8. HazJ

    Authority 20 player coop.

    We did some multiplayer tests and it's working pretty well so far. More work to do on it but generally it's coming along nicely so far.
  9. HazJ

    Authority 20 player coop.

    Jotting ideas down with @Tankbuster Disclaimer: Left handed drawing with the mouse. Not that I'm good at drawing anyway. 😂
  10. HazJ

    Authority 20 player coop.

    Default Authority Keys: User20 - Mission Status - Left Windows Key User19 - Earplugs - F1 User18 - Holster - H User17 - Location Finder - Ctrl + F These were changed in the latest build of the mission. Previously it used User1, User2, User3 and User4. Additional info: The key handler function was updated so now multiple key presses work.
  11. HazJ

    Authority 20 player coop.

    Authority release version 1.08.3798. Release highlights.
  12. You're welcome. If you have any other questions, let us know. 🙂
  13. Did you try: https://community.bistudio.com/wiki/allowFleeing
  14. This may be of use:
  15. It seems like it is being disabled by the island or Exile.
  16. I meant select above. init.sqf { _x addAction ["Spawn Ifrit", { _vehicle = createVehicle ["O_MRAP_02_F", (player getRelPos [random 100, random 360]), [], 5, "NONE"]; _vehicle addEventHandler ["GetOut", { _this spawn { params ["_vehicle", "_role", "_unit", "_turret"]; sleep 10; if ( count (crew _vehicle select {alive _x}) == 0 ) then { deleteVehicle _vehicle; }; }; }]; }]; } forEach [ IfritSpawn, IfritSpawn1 ]; Example: https://we.tl/t-3g8c7mJwIM This doesn't account for all occasions such as where all crew die in vehicle before anyone disembarks, etc. I think it would be better in this case to just do: {alive _x} count (crew _vehicle) == 0 Though I was testing with select and forgot to change.
  17. Perhaps unload the dead crew then delete the vehicle? On phone atm so can't provide example.
  18. @opusfmspol Good point on the count crew. @Heidelberg As opus said, you can't just add an action to multiple objects like that. { _x addAction ["Spawn Ifrit", {createVehicle ["O_MRAP_02_F", (getPosATL IfritSpawn), [], 5, "NONE"];}]; } forEach [ IfritSpawn, IfritSpawn1 ]; You could also do: count (crew _vehicle apply {!alive _x}) Not sure which is faster off the top of my head, I don't think it is much difference with just this snippet though I haven't ran any tests.
  19. Tested and working. Can't run sleep in unscheduled. _vehicle addEventHandler ["GetOut", { _this spawn { params ["_vehicle", "_role", "_unit", "_turret"]; sleep 10; if (count crew _vehicle == 0) then { deleteVehicle _vehicle; }; }; }];
  20. Please add a space between the : and $ dollar sign on the inventory screen, and perhaps remove the space after as well. Your money:$ 95 Your money: $95 Also, doesn't Tanoa use €?
  21. You forgot ; after your sleep. You also want to check if the vehicle crew is 0. Something like this (not tested): _vehicle addEventHandler ["GetOut", { _this spawn { params ["_vehicle", "_role", "_unit", "_turret"]; sleep 10; if (count crew _vehicle == 0) then { deleteVehicle _vehicle; }; }; }]; Change _vehicle accordingly.
  22. HazJ

    Authority 20 player coop.

    Location finder 😉 https://imgur.com/a/5ainXW0
  23. You aren't passing anything to format. Perhaps this would work but completely unnecessary. Not tested. _ctrltext ctrlSetStructuredText parseText format ["", nil];
  24. @beno_83au's solution works. Also ctrlSetText "" works as well. Both tested.
  25. If it doesn't work it doesn't work. Key words, try and I didn't say a string was structured text. Maybe instead of replying with such a pointless post, actually help contribute ?
×