Jump to content

Joshua9797

Member
  • Content Count

    55
  • Joined

  • Last visited

  • Medals

Everything posted by Joshua9797

  1. Here is a variant that I used once. In this variant, the player needs a key object in his inventory. (I think you can find it in the editor as an inventory item) office setVariable ['bis_disabled_Door_7',1,true]; JFR_showKeyInput = true; publicVariable "JFR_showKeyInput"; [ keyInput, "Open with key", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa", "(_this distance _target < 3) && (JFR_showKeyInput == true)", "(_caller distance _target < 3) && (JFR_showKeyInput == true)", {}, {}, { if("Keys" in (magazines _caller)) then { JFR_showKeyInput = false; publicVariable "JFR_showKeyInput"; deleteVehicle keyInput; //playSound3D [getMissionPath "sounds\DoorOpen.ogg", Auto, false, getPosASL Auto, 10, 1, 23]; office setVariable ['bis_disabled_Door_7',0,true]; } else { hint parseText format ["You need a <t color='#ff0000'>key</t> for this door!"]; }; }, {}, [], 0.8, nil, false, false ] remoteExec ["BIS_fnc_holdActionAdd", 0, Auto]; I placed an object of the appropriate size in front of the corresponding door, named it “keyInput” and then made it invisible with the following: keyInput setObjectTextureGlobal [0, ""]; (Changing the visibility doesn't work, otherwise the holdAction will no longer be displayed!) Looking back, the “JFR_showKeyInput” is probably not needed, as the “keyInput” is deleted anyway so as not to block the path.
  2. Joshua9797

    Action heal in car

    I'm not sure if this will help you, but this is how you could add an action to the player when they are in a vehicle. In this example, the script myCareScript.sqf is called, and the player is passed to this script. player addAction ["care", { _player = _this select 3 select 0; [_player] execVM "myCareScript.sqf"; } , [player], 1.5, true, true, "","(!(isNull objectParent Player))"]; If you meant to add an action in ACE, this might help you:
  3. Unfortunately, no solution, but here is my experience: For me, the image is always displayed only after I have downloaded the mission. So, only after the second start. It is just a guess, but I assume that if you host the mission yourself (locally), you already have the mission through the export in the MPMissions folder and thus have "downloaded" it. Therefore, the image seems to be displayed there even before the first start.
  4. Joshua9797

    Masking a teleport

    I once used an elevator for this purpose. The elevator simply consisted of two self-built identical rooms with animated doors and logic for when they would open and close. For the floor, I used a square plate. As soon as the doors were closed, I teleported all the players who were in the elevator (in a trigger area) to the second room. To do this, I took the position of each player relative to the floor plate and then set it relative to the identical floor plate in the second room. I animated the doors using BIS_fnc_unitPlay. With some nice elevator music, you didn't notice the teleportation at all.😉 However, I think on a server with weak performance or heavy load, you might notice something.
  5. Hello, quick question, I'm currently trying to disable the effects of suppression in a section of my mission but unfortunately without success. I've already tried using L_Suppress_enabled = false; via the debug console. But even when the variable is set to false, I still receive the effects. I suspect that my clan is using a very old version of the mod since I can only set this variable through the CBA settings and I don't receive any value for L_suppress_threshold. Am I doing something wrong, or do I need to ask my clan to update to the latest version? Edit* When I remove the checkmark for L_Suppress_enabled in the CBA settings, the effect disappears. However, I need to achieve this via scripts at a specific location.
  6. First time playing with config files and first time publishing here. This script allows the player to change the paint job of a vehicle without needing to enter the Zeus slot or execute lines of code themselves. I came up with the idea when I repeatedly had to switch to the Zeus slot on a KP-Liberation server whenever I wanted to change the paint job on a vehicle that I had previously purchased with resources. Since I didn't want to provide the player with a cheat tool, creating a virtual garage using BIS_fnc_garage would have been too powerful. Note: Please let me know if you have any improvements. One thing that bothers me, for example, is that I can't pass the variables _vehicle and _textureList to the EH "LBSelChanged" and therefore have to write them into a public variable. Instructions: Place: An input object, such as a laptop, and assign it the variable name "JFR_PaintShop_Input". (You can open the PaintShop on this) A trigger with an appropriate size, for example, 10x10x10, and assign it the variable name "JFR_TGR_PaintShop". (The vehicle to be customized must be driven into the trigger area) Any object for the camera and assign it the variable name "JFR_CamPosObj". For example, a holographic arrow (helper). (The camera will switch to this position and focus on the vehicle after opening the PaintShop) (The camera object can be made invisible in the attributes of the object) Create the following file structure in your mission folder: (the mission.sqm should already be there) myMission.map - mission.sqm - initPlayerLocal.sqf - description.ext scripts paintShop - initPaintShop.sqf - paintShop.sqf dialogs - controls.hpp - defines.hpp Copy and paste the following code into the appropriate files: initPlayerLocal.sqf: description.ext: initPaintShop.sqf: paintShop.sqf: controls.hpp: defines.hpp:
  7. Joshua9797

    [Release] PaintShop Script SP/MP

    The script dynamically searches for all stored textures within the CfgVehicles. Essentially, for all vanilla vehicles (car, helicopter, plane), you should see all available textures as you would in the virtual garage. However, I haven't tested mod vehicles. I also attempted to add some of the unused textures from BI using CfgVehicleTemplates, but it seems I am too stupid for that.
  8. Joshua9797

    Need help with unit capture

    Can you please send us the code you are using and the name of the helicopter? Are you using a helicopter from a mod?
  9. Joshua9797

    Need help with unit capture

    Have you used BIS_fnc_unitPlayFiring to play back the recorded weapon data? _movementdata = [[0,[11484.9,6405.11,1.36345],[-0.443961,-0.895987,0.0103379],....]; _firingdata = [[2.828,"vnrocket_ffar_275in_launcher_m229"],[4.682,"vn_rocket_ffar_275in_launcher_m229"]]; [MyHelicopter, _movementdata] spawn BIS_fnc_unitPlay; [MyHelicopter, _firingdata] spawn BIS_fnc_unitPlayFiring; Otherwise, I could imagine that you might need to assign the driver as a gunner. If your driver doesn't have control over the weapons, the BIS_fnc_unitPlayFiring function won't be able to play back the data. You can switch control under the pylons-tab using the small icons.
  10. Maybe you could deal damage to an NPC, then use getObjectTextures to copy the .paa paths and apply them with setObjectTextureGlobal. At least, that's what I would try. But I suspect that the wounded texture is applied differently, so this approach probably won't work.
  11. Unfortunately, it is not possible to capture the orientation of a turret with "unitcapure." I use the "lockCameraTo" function for this issue, which I call when the turret should pivot towards the target. If you don't have a target, I recommend using an invisible object as a target.
  12. Joshua9797

    Help Script

    hay there, please explain further what you are trying to achieve. Are you trying to consistently check if a civilian is in front of you? And if you've found one, then there should be a 33% probability of creating a 'stay in place' action for them? And once you've activated the 'stay in place' action, another 'surrender' action should be created for that civilian? And if you've activated the 'surrender' action, should they surrender through ACE?
  13. Oh, the idea of using a Mission Event Handler is brilliant. I was trying to find a solution yesterday and attempted to use a regular event handler ("Killed"). However, I couldn't come up with a good solution for the problem when an enemy is spawned mid mission because the "Killed" EH needs to be associated with a specific unit. Now I need to take a look at some of my scripts and see if I can improve them with a Mission Event Handler. 😄
  14. Joshua9797

    UnitCapture and landing gear down?

    Ah, okay, I think I see the problem now. The "action" function only works on a unit. So either a player or an AI. In your case, you'll need to place an AI in the driver's seat. You can achieve this through a script by doing the following: //inside e.g. Trigger _crew = createGroup [civilian, true]; _unit = _crew createUnit ["B_helicrew_F", [0,0,0], [], 0, "NONE"]; _unit moveInDriver vehicleName; _unit action ["LandGear", vehicleName];
  15. Joshua9797

    UnitCapture and landing gear down?

    Apart from the onEachFrame. Have you tried: unitName action ["LandGear", vehicleName]; //Alternatively driver vehicleName action ["LandGear", vehicleName]; //or unitName action ["LandGear", vehicle unitName]; In your example, you used unit (unitName) instead of vehicleName. By the way, the command works for me even without an onEachFrame. But in multiplayer, it still doesn't work every time, even though it has a global effect. Maybe I'm missing the onEachFrame there.
  16. Joshua9797

    Animations not working properly

    You can then loop all of this in a while loop. I recommend executing it within a "spawn" to allow the script to continue running afterward. Moreover, a while loop or sleep wouldn't be permissible in a trigger without a spawn. 0 spawn { while { alive bot1 } do { bot1 switchMove "Acts_hubTalk_salute1"; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_1b"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_1"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_2"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_3"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_4"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_5"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_6"; sleep 2.45; }; };
  17. Joshua9797

    Animations not working properly

    Hi, one idea would be to execute all animations using "switchMove" and incorporate an appropriate sleep. I assume you obtained the animations from the Animations Viewer? There, in the bottom left corner, you can always see the duration of the animation. You can then use that for the sleeps. (For example, 2.45 seconds per animation <- please replace with the correct duration): bot1 switchMove "Acts_hubTalk_salute1"; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_1b"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_1"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_2"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_3"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_4"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_5"; sleep 2.45; bot1 switchMove "Acts_welcomeOnHUB01_AIWalk_6"; Although most animations also work with "playMove," in my experience, there are exceptions. (I think there's a naming convention for the animations that indicates this, but I usually just try things out.) I am still a beginner in SQF, so please take my statements with a grain of salt.
  18. Joshua9797

    Shot timer

    I just tested the code and updated it in my previous post, and as they say, it works on my machine.😉
  19. Joshua9797

    Shot timer

    It's just an idea, and nothing has been tested (it probably won't work this way), but I thought that an approach involving calculations with 'time' and using an array could work. Here's a version using the variable 'time' (time since the start of the mission) and an array. inside initServer.sqf JFR_ShotsTime = []; publicVariable "JFR_ShotsTime"; JFR_fnc_ShotTimer = { params ["_thePlayer"]; _initialTime = time; _index = _thePlayer addEventHandler ["Fired", { params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; JFR_ShotsTime pushBack time; publicVariable "JFR_ShotsTime"; }]; sleep 5; _thePlayer removeEventHandler ["Fired", _index]; _result = "Number of shots fired: " + str (count JFR_ShotsTime) + " timestamps: "; { _result = _result + (str (_x - _initialTime)) + "sec, "; } forEach JFR_ShotsTime; JFR_ShotsTime = []; // reset publicVariable "JFR_ShotsTime"; hint _result; }; publicVariable "JFR_fnc_ShotTimer"; inside init of Obj with addAction: this addAction ["5 sec timer", { params ["_target", "_caller", "_actionId", "_arguments"]; [_caller] call JFR_fnc_ShotTimer; }]; I am still a beginner in SQF, so please take my statements with a grain of salt.
  20. Oh, right. I don't know how I overlooked that. It's even the step right above the publicVariable. thanks for pointing that out.😅
  21. Hi. I'm not sure if this helps, but if you just want to have an enemy who can endure more than an ordinary enemy, you could alternatively reduce the incoming damage instead of managing a separate variable for the HP. If I understand the documentation for 'HandleDamage' correctly, you can override the received damage value by overriding the '_damage' parameter and returning this value: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage this addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"]; _damage = _damage * 0.1; _damage; }]; (This is not tested!) The following are just tips: A small tip that I can give is that it's not necessary to receive the parameters using 'select.' After you have received the parameters using 'params,' you can simply access them by their names. For example: params ["_unit", "_damage"]; _unit setDamage 0; Another thing I noticed is that the variable you are trying to publish with 'publicVariable' (dommage) is not the same as _dommage. Notice the underscore (_) before the name. The underscore indicates that it's a private variable and is only known within your script's scope. You cannot publish a private variable with 'publicVariable.' This can only be done with public variables, which are the ones without an underscore. However, public variables have the disadvantage that they can only exist once and will be overwritten in any other script. I'd like to mention that I am still a beginner in SQF, so please take my statements with a grain of salt.
  22. Joshua9797

    Add shake effects to custom camera

    I would like to add that although I tested the scenario in singleplayer and therefore a remoteExec should not make any difference, the following execution of addCamShake does not work either: //old: enableCamShake true; addCamShake [20, 4, 25]; //replaced by: [true] remoteExec ["enableCamShake"]; [[20, 4, 25]] remoteExec ["addCamShake"];
  23. Joshua9797

    Add shake effects to custom camera

    OK, so here's a simple attempt that unfortunately doesn't work. The map is the VR map. I placed a player and nothing else. I created 2 scripts inside the mission folder: initServer.sqf cutscene.sqf initServer.sqf: _building = "Land_i_House_Small_01_V2_F" createVehicle [7439,2928,0]; sleep 1; "cutscene.sqf" remoteExec ["execVM",0]; sleep 4; _bomb = "Bo_GBU12_LGB" createVehicle [7439,2928,0]; _bomb setDamage 1; enableCamShake true; addCamShake [20, 4, 25]; cutscene.sqf: _camera = "camera" camcreate [7453,2905,2]; _camera cameraEffect ["internal", "back"]; _camera camPrepareTarget [7439,2928,0]; _camera camPreparePos [7453,2905,2]; _camera camPrepareFOV 0.700; _camera camCommitPrepared 0; sleep 0; _camera camPrepareTarget [7439,2928,0]; _camera camPreparePos [7430,2905,2]; _camera camPrepareFOV 0.700; _camera camCommitPrepared 10; waitUntil{camCommitted _camera}; Player cameraEffect ["terminate","back"]; camDestroy _camera; If addCamShake actually works with a camera created with camcreate then I would expect the camera to start shaking immediately after the explosion.
  24. Joshua9797

    Add shake effects to custom camera

    I have the same problem. If I find the time, I'll quickly build a small scenario today to better demonstrate the problem.
  25. Hello, I noticed that since the 1.2 update of the S.O.G DLC, a scenario that I created a few months ago no longer works properly. To be precise, the helicopters I captured with BIS_fnc_UnitCapture no longer shoot missiles. However, this problem seems to only occur on the UH-1 helicopters, as it still works on the AH-9 pawnee. I have created a simple example mission and uploaded it to my GoogleDrive (no mods and just the SOG DLC): https://drive.google.com/file/d/14rgX7Hk-ULCq_NrX3LKv44i6GPMMgXH2/view?usp=sharing I also made a small video to demonstrate the problem. In this video, the AH-9 fires missiles but the UH-1C does not: Here is the Code I used: - for capturing the Data: rec = [vehicle player,200,20,true] spawn BIS_fnc_UnitCapture; - for the UH-1C flightpath (H1flightpath.sqf) : _movementdata = [[0,[1331.95,3293.66,73.3128],[-0.989004,0.0451461,-0.140831],[-0.140656,0.00704925,0.990034],[-1.30963,0.0658325,-0.0288855]],.....]; _firingdata = [[2.616,"vn_rocket_ffar_275in_launcher_m229"],[3.107,"vn_rocket_ffar_275in_launcher_m229"],......]; [H1, _firingdata, true] spawn BIS_fnc_UnitPlayFiring; _sequence = [H1, _movementdata] spawn BIS_fnc_UnitPlay; waitUntil {scriptDone _sequence}; hint "Playback 1 finished"; - for the AH-9 flightpath (H2flightpath.sqf) : _movementdata = [[0,[1337.54,3255.75,66.2256],[-0.980305,0.155578,-0.121648],[-0.119848,0.0209321,0.992571],[-4.7839,0.813286,-0.0131848]],....]; _firingdata = [[4.826,"missiles_DAR"],[4.832,"missiles_DAR"],....]; [H2, _firingdata, true] spawn BIS_fnc_UnitPlayFiring; _sequence = [H2, _movementdata] spawn BIS_fnc_UnitPlay; waitUntil {scriptDone _sequence}; hint "Playback 2 finished"; I have already checked my game files but nothing was found. Thank you in advance.
×