Jump to content

Joshua9797

Member
  • Content Count

    55
  • Joined

  • Last visited

  • Medals

Everything posted by Joshua9797

  1. Desert Ocean is a SP/MP co-op mission designed for 1 to 8 players. download link/steam workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=3386249759 No Mods required. The mission's storyline aims to be seamlessly integrated into the 'Arma 3 universe' and provides an immersive experience through compelling cutscenes and a thrilling story. Furthermore, the mission includes a complete english voiceover and carefully placed music from the game, making it streamer friendly. Hope you like it and let me know what you think.
  2. Hi, if, as you mentioned, you have a few fixed positions and simply want to get one of them randomly, I recommend using selectRandom. selectRandom picks a random element from an array. In your case, you can simply create an array with positions: _pos1 = [123, 456, 789]; _pos2 = [123, 456, 789]; _pos3 = [123, 456, 789]; _pos4 = [123, 456, 789]; _randomPos = selectRandom [_pos1, _pos2, _pos3, _pos4];
  3. There is probably a much better way, but the following worked quite well in a multiplayer mission: I placed a small placeholder object at the desired position and named it myLightPos1. Then, I added the following code in initPlayerLocal.sqf: _myLight = "#lightpoint" createVehicleLocal getPos myLightPos1; _myLight setLightColor [0,0,0]; _myLight setLightAmbient [0.8,0.3,0.1]; _myLight setLightBrightness 2.45; deleteVehicle myLightPos1; I used the following page to set the values for setLightAmbient[]: https://www.tug.org/pracjourn/2007-4/walden/color.pdf
  4. Hi, unfortunately I can't test the code at the moment, but the following should give a rough idea of how the whole thing could be rewritten with "spawn" and loops: LFT_startCarLoops = { params ["_cityAreaArray", "_percent", "_carTypeArray", "_deletionRange", "_spawnRange"]; //checkPlayerProximityForCarsLoop [_cityAreaArray, _percent, _carTypeArray, _spawnRange] spawn { //The code in Spawn runs separately from the rest of the code. This means that there is no waiting for the end of the while loop. //Since the private variables within the spawn are not known, we provide them as parameters. params ["_cityAreaArray", "_percent", "_carTypeArray", "_spawnRange"]; while {true} do { //endless loop (It would be better if there was a real ending condition). [_cityAreaArray, _percent, _carTypeArray, _spawnRange] call LFT_CheckPlayerProximityAndSpawnCars; sleep 1; //Without a short break between loops, the game's performance would suffer greatly. }; }; //checkCarsProximityLoop [_deletionRange] spawn { params ["_deletionRange"]; while {true} do { [_deletionRange] call LFT_CheckCarsProximity; sleep 1; }; }; }; LFT_CheckPlayerProximityAndSpawnCars = { params ["_cityAreaArray", "_percent", "_carTypeArray", "_spawnRange"]; <Some code> };
  5. Joshua9797

    Keyframe on Trigger

    Hi, the magical function is called "BIS_fnc_timeline_play". You need to provide the variable name of the timeline to it: [MyTimeline] call BIS_fnc_timeline_play; I would like to mention that, to my knowledge, timelines do not work in multiplayer. For MP, I always make myself the object and record the movement with BIS_fnc_unitCapture.
  6. Hi, this might help: private _spawnPoint = getMarkerPos "_markerCordon"; //The midpoint (marker) at which units are spawned. private _amount = 3; //The amount of units to spawn. private _radius = 30; //The radius in which the units are spawned (from the midpoint). private _unitTypes = ["B_Soldier_F", "B_Pilot_F", "B_Survivor_F", "armst_blinddog2"]; //the types(classnames) of units to be spawned (see CfgVehicles e.g. https://community.bistudio.com/wiki/Arma_3:_CfgVehicles_EAST) //You can see the class name in the editor if you hover over the unit in the list on the left. //or you get the class name with "typeOf" e.g.: typeOf player private _group = createGroup east; //The group into which the units are spawned.(Determines the side) for [{private _i = 0}, {_i < _amount}, {_i = _i + 1;}] do { private _randomTyp = selectRandom _unitTypes; //the typ of Unit to be spawned private _myAI = _group createUnit [_randomTyp, [0,0,0], [], 0, "NONE"]; //spawn the unit at the first available free position nearest to [0,0,0] private _randomPos = (_spawnPoint getPos [_radius * sqrt random 1, random 4000]); _myAI setPosATL (_randomPos); //sets the position relative to the terrain. [_myAI, (random 360)] remoteExec ["setDir"]; //set a random dir };
  7. I just tested the version with the new diary. Unfortunately, you have to attach the AddAction to the vehicle because it's not visible on the driver from the outside. I also added a condition so that the action is no longer visible once it has been executed. Otherwise, you could add an infinite number of diaries. Please use the adjusted code: if (isServer) then { JFR_Diary_created = false; publicVariable "JFR_Diary_created"; [_newPoliceTruck, ["Talk to", { ["New Diary added!"] remoteExec ["hint"]; _newDiaryTitle = "New Infos"; _newDiaryText = "My new Diary Text<br/><br/>This is the new Text in a new line"; { [_x, ["Diary", [_newDiaryTitle, _newDiaryText, "\a3\missions_f_oldman\data\img\holdactions\holdAction_talk_ca.paa"], taskNull, "", true]] remoteExec ["createDiaryRecord"]; } forEach allPlayers; JFR_Diary_created = true; publicVariable "JFR_Diary_created"; } , [], -1000, true, true, "","(JFR_Diary_created == false) && (_this distance _target < 5)"]] remoteExec ["addAction"]; };
  8. Another idea would be to create a new diary entry: if (isServer) then { [_newDriver, ["Talk to", { ["New Diary added!"] remoteExec ["hint"]; _newDiaryTitle = "New Infos"; _newDiaryText = "My new Diary Text<br/><br/>This is the new Text in a new line"; { [_x, ["Diary", [_newDiaryTitle, _newDiaryText, "\a3\missions_f_oldman\data\img\holdactions\holdAction_talk_ca.paa"], taskNull, "", true]] remoteExec ["createDiaryRecord"]; } forEach allPlayers; } , [], -1000, true, true, "","(_this distance _target < 5)"]] remoteExec ["addAction"]; };
  9. 1) With a setDir after createVehicle: _dir = 300; _newPoliceTruck, _dir] remoteExec ["setDir"]; 2) The following adds an action to the driver (mouse wheel menu). When this is selected, a hint will be displayed for all players and the task description will be changed. (Please assign the task a unique ID (variable name), e.g., "TSK_myTask"). if (isServer) then { _newTaskDescription = "new description text"; [_newDriver, ["Talk to", { ["Mission description was changed!"] remoteExec ["hint"]; ["TSK_myTask", [ _newTaskDescription, (("TSK_myTask" call BIS_fnc_taskDescription) select 1), (("TSK_myTask" call BIS_fnc_taskDescription) select 2) ]] call BIS_fnc_taskSetDescription; } , [], -1000, true, true, "","(_this distance _target < 5)"]] remoteExec ["addAction"]; }; (I am currently unable to test the code)
  10. I think the easiest way would be to place everything in the editor beforehand, make it invisible, and disable the simulation. (This will also remove the collision). You can either check the boxes under the attributes or use the Hide/Show module. Then, you can make everything visible again at a certain point via a trigger. You can either embed the code directly in the trigger or link the module to the trigger. If you still want to spawn the vehicles and NPCs, I recommend looking into createVehicle, createUnit, and setDir. _side = east; private _group = createGroup _side; _spawnPoint = [0,0,0]; _myAI = _group createUnit ["O_Soldier_F", _spawnPoint, [], 0, "NONE"]; [_myAI, 300] remoteExec ["setDir"];
  11. Joshua9797

    Hold Action Animation

    Have you already tried other functions like switchMove or BIS_fnc_ambientAnim? Apparently, some animations can only be played with certain functions. I think there was some kind of naming convention that indicated this. In any case, I would try BIS_fnc_ambientAnim, as it is listed in the wiki in connection with the animation: https://community.bistudio.com/wiki/BIS_fnc_ambientAnim [_caller,"REPAIR_VEH_KNEEL","ASIS"] call BIS_fnc_ambientAnim;
  12. Joshua9797

    RemoteExec a Function

    If it helps, I have used this for a simple confirmation: player addAction ["End Mission", { private _result = ["Do you want to end the mission?", "End Mission", "Yes", "No"] call BIS_fnc_guiMessage; if (_result == true) then { ["end1", true , 3, true, true, true] remoteExec ["VN_fnc_endMission", 0]; }; }, nil, 7, false, true, "", ""];
  13. Joshua9797

    JIP not showing addAction

    Hi, I could imagine that you need to set the trigger to repeatable (a checkbox in the trigger). Alternatively, I would suggest moving the addAction to the script "initPlayerLocal.sqf" and adding the activation of the trigger as a condition for showing the action. initPlayerLocal.sqf: Executed locally when a player joins the mission (includes both mission start and JIP). The trigger activation can be added as a condition for the display as follows: ptboat addAction ["Equip SCUBA Gear", "scubagear.sqf", nil, 7, false, true, "", "_this in (crew _target) && !scubaEquipped && triggerActivated myTrigger"]; If the players spawn in the trigger and you only use it for adding the addAction, you can also leave out the condition “triggerActivated myTrigger”.
  14. I just copied the code from above. But I guess that's not the problem then. Unfortunately, I have never executed my own function with remoteExec, but only an entire sqf file. The documentation says: "while any function or command can be used here, only those allowed by CfgRemoteExec will actually be executed" Maybe that is the problem? if this helps, a call to the file should look like this: ["fn_updateAttackMarker.sqf", [westAttackSector]] remoteExec ["execVM",west,"JIPwest"]; But you already said that it works with a 0 instead of “west”… Very strange.
  15. Only thing i can imagine is that these strange invalid characters have somehow made their way into the code. You can get rid of them by removing the red dots when you paste the code here in the forum and then copying the cleaned code again.
  16. Joshua9797

    Remote Exec Play music?

    To trigger the end of the mission, entering the following into the console on the server was enough: ["", 132] call BIS_fnc_playMusic; NUP_points_BLUFOR = 5; publicVariable "NUP_points_BLUFOR";
  17. Joshua9797

    Remote Exec Play music?

    OK, I have now managed to get it running on a server. I made the following changes: In the initServer.sqf, I defined WinMessage = "";. Additionally, I changed the loop from true to while {count(WinMessage) <= 0;} do {. This way, the loop ends as soon as the text in WinMessage is longer than 0. I did this because otherwise, the outro would start over again with each pass of the loop. if (!isServer) exitWith {}; NUP_flagArray = []; NUP_points_BLUFOR = 0; NUP_points_OPFOR = 0; NUP_points_INDFOR = 0; NUP_points_CIV = 0; NUP_points_maxScore = 5; NUP_scoring_interval = 5; NUP_deadlock = 0; WinMessage = ""; [] spawn { while {count(WinMessage) <= 0;} do { [] call NUP_fnc_updateScores; sleep NUP_scoring_interval; }; }; Secondly, I adjusted fn_endMission.sqf. Here, I commented out everything from the point where everything should be executed locally and added the call to the new script localScript.sqf using remoteExec: (The music and everything with the camera needs to be executed locally, otherwise only the server will be able to enjoy the nice outro.) // NUP_fnc_endMission: params ["_winningSide"]; Winner = _winningSide select 0; publicVariable "Winner"; WinnerOutcome = switch (Winner) do { case west: { "BLUFOR WINS!" }; case east: { "OPFOR WINS!" }; case independent: { "INDEPENDENT WINS!" }; case civilian: { "CIVILIANS WIN!" }; }; publicVariable "WinnerOutcome"; WinMessage = format ["MISSION ACCOMPLISHED! %1", WinnerOutcome]; LoseMessage = format ["MISSION FAILED! %1 ", WinnerOutcome]; publicVariable "WinMessage"; publicVariable "LoseMessage"; "localScript.sqf" remoteExec ["execVM",0]; //remoteExec to every Player localy /*{ private _playerSide = side _x; private _playerID = owner _x; // Get the player's ID if (_playerSide == Winner) then { titleText [WinMessage, "PLAIN", -1, true, true]; ["LeadTrack01_F_Bootcamp", 132] call BIS_fnc_playMusic; } else { titleText [LoseMessage, "PLAIN", -1, true, true]; playMusic "BackgroundTrack03_F_EPC"; }; } forEach allPlayers; // Get the position of the NUP_endMissionCamera object private _cameraPos = getPos NUP_endMissionCamera; // Calculate starting and ending positions for the camera private _startPos = [ (_cameraPos select 0), // Same X position (_cameraPos select 1), // Same Y position (_cameraPos select 2) + 10 // 10 meters above ]; private _endPos = [ (_cameraPos select 0), // Same X position (_cameraPos select 1), // Same Y position (_cameraPos select 2) + 50 // 50 meters above (40 meters up during 30 seconds) ]; // Create the camera private _camera = "camera" camCreate _startPos; _camera cameraEffect ["internal", "back"]; _camera camSetTarget NUP_endMissionCamera; _camera camSetFOV 0.5; _camera camCommit 0; // Start the cinematic borders _start = diag_tickTime; [0, 0.5, false, true] call BIS_fnc_cinemaBorder; // Move the camera over 30 seconds _camera camSetPos _endPos; _camera camCommit 30; // Wait until the camera has finished it's trajectory waitUntil { camCommitted _camera }; // Terminate the camera effect and destroy the camera _camera cameraEffect ["terminate", "back"]; camDestroy _camera; // Force all players back to the lobby after the outro ["END1", true] call BIS_fnc_endMission;*/ Lastly, I created a script in the main folder named localScript.sqf: private _playerSide = side player; if (_playerSide == Winner) then { titleText [WinMessage, "PLAIN", -1, true, true]; playMusic ["LeadTrack01_F_Bootcamp", 132]; } else { titleText [LoseMessage, "PLAIN", -1, true, true]; playMusic "BackgroundTrack03_F_EPC"; }; // Get the position of the NUP_endMissionCamera object private _cameraPos = getPos NUP_endMissionCamera; // Calculate starting and ending positions for the camera private _startPos = [ (_cameraPos select 0), // Same X position (_cameraPos select 1), // Same Y position (_cameraPos select 2) + 10 // 10 meters above ]; private _endPos = [ (_cameraPos select 0), // Same X position (_cameraPos select 1), // Same Y position (_cameraPos select 2) + 50 // 50 meters above (40 meters up during 30 seconds) ]; // Create the camera private _camera = "camera" camCreate _startPos; _camera cameraEffect ["internal", "back"]; _camera camSetTarget NUP_endMissionCamera; _camera camSetFOV 0.5; _camera camCommit 0; // Start the cinematic borders _start = diag_tickTime; //[0, 0.5, false, true] call BIS_fnc_cinemaBorder; // Move the camera over 30 seconds _camera camSetPos _endPos; _camera camCommit 30; // Wait until the camera has finished it's trajectory waitUntil { camCommitted _camera }; // Terminate the camera effect and destroy the camera _camera cameraEffect ["terminate", "back"]; camDestroy _camera; // Force all players back to the lobby after the outro ["END1", true] call BIS_fnc_endMission; Please try and see if it works with these changes.
  18. Joshua9797

    Remote Exec Play music?

    When I start the mission as Blufor and then enter "NUP_points_BLUFOR = 5" in the console, I get the outro and I can also hear the music. Although it's a bit quiet, it's still there. Then it can only be due to a mod or a setting, I suppose. EDIT: Do you have this problem on a server or also in single player?
  19. Joshua9797

    Remote Exec Play music?

    Can you please share the code of endMusic.sqf?
  20. Joshua9797

    Remote Exec Play music?

    Does the exclamation mark work outside in "if !(isServer) exitWith {};" in initServer?
  21. Ah now i see. It's always funny how the code just does exactly what you programmed it to do😄.
  22. Joshua9797

    Remote Exec Play music?

    Does playMusic work when you execute it in the debug console? Stupid question, but did you also set the music volume? And where exactly are you calling the code?
  23. I think you forgot the "_" in systemChat str selMin;. As a result, it might not output anything until _selectionName is output again. Find returns a -1. Edit: But that can't be the problem.
  24. Joshua9797

    Detection of a prop object

    The condition "this && box in thisList" should be accurate. The contents of thisList should depend on the trigger's activation. For example, if a trigger is set with the condition "any player" and "present," only players will be included in thisList. For objects, I believe the conditions were "ANY" and "present."
  25. Joshua9797

    Remote Exec Play music?

    The playMusic function seems correct to me and should work. I would check if the code is reaching the respective position, for example, by using a hint. One thing I noticed: An issue is that using remoteExec causes the music to play for all players instead of just the player currently being processed by the forEach loop. Without using remoteExec, the music will only play on the server, meaning the intended player still won't hear the music. I would try to execute the entire code locally for each player and then call the playMusic function locally there. I can't test the following code, but it should roughly work like this: On the server (e.g., in initServer.sqf): JFR_winningSide = _winningSide; JFR_endingLoseMessage = _endingLoseMessage; JFR_endingWinMessage = _endingWinMessage; publicVariable "JFR_winningSide"; publicVariable "JFR_endingLoseMessage"; publicVariable "JFR_endingWinMessage"; "localScript.sqf" remoteExec ["execVM",0]; //remoteExec to every Player localy In another script named "localScript.sqf": private _playerSide = side player; if (_playerSide == JFR_winningSide) then { titleText [JFR_endingWinMessage, "PLAIN", -1, true, true]; playMusic ["LeadTrack01_F_Bootcamp", 132]; } else { titleText [JFR_endingLoseMessage, "PLAIN", -1, true, true]; playMusic "BackgroundTrack03_F_EPC"; }; Alternatively, the variables _winningSide etc. could also be passed to the script instead of broadcasting them with publicVariable.
×