-
Content Count
56 -
Joined
-
Last visited
-
Medals
Everything posted by Joshua9797
-
Wave Spawning Script Stuck or not completing; Unable to Reproduce
Joshua9797 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
In a mission I recently uploaded, a few players reported that the last part of my mission isn’t working, but I just can’t reproduce the issue. Maybe someone here can help me, or someone might have a suggestion to improve the script. In the last part of my mission, waves of enemies are spawned. Whenever only a certain number of enemies are left, the next wave should be spawned. A total of 4 waves are spawned. On the 4th wave, the extraction helicopter is supposed to arrive (a pickup under enemy fire). The first wave always seems to work as intended, but somewhere after that—either during the second, third, or fourth wave—the script seems to get stuck. It’s unclear if the issue is that the next wave isn’t being triggered or if the extraction helicopter isn’t arriving. It’s also possible that something earlier in the mission is indirectly causing the problem, but I haven’t been able to pinpoint what’s going wrong. Here are the scripts: initServer.sqf: spawnEnemyGroup.sqf: 5Final_part.sqf: -
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.
-
What do we use as a light source inside buildings?
Joshua9797 replied to Luft08's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
Can you pass a local variable to BIS_fnc_loop ?
Joshua9797 replied to Luft08's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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> }; -
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.
-
Getting units to spawn on marker through function
Joshua9797 replied to BeaniePope.'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 }; -
How to Spawn untis/vehicles with a trigger? or somehow else?
Joshua9797 replied to RealLocutus's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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"]; }; -
How to Spawn untis/vehicles with a trigger? or somehow else?
Joshua9797 replied to RealLocutus's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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"]; }; -
How to Spawn untis/vehicles with a trigger? or somehow else?
Joshua9797 replied to RealLocutus's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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) -
How to Spawn untis/vehicles with a trigger? or somehow else?
Joshua9797 replied to RealLocutus's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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"]; -
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;
-
Remote Exec Play music?
Joshua9797 replied to Northup's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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"; -
Remote Exec Play music?
Joshua9797 replied to Northup's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Remote Exec Play music?
Joshua9797 replied to Northup's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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? -
Remote Exec Play music?
Joshua9797 replied to Northup's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Can you please share the code of endMusic.sqf? -
Remote Exec Play music?
Joshua9797 replied to Northup's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Does the exclamation mark work outside in "if !(isServer) exitWith {};" in initServer? -
Remote Exec Play music?
Joshua9797 replied to Northup's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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? -
Detection of a prop object
Joshua9797 replied to Belial0harvester's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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." -
Remote Exec Play music?
Joshua9797 replied to Northup's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Adding an addAction to a specific door
Joshua9797 replied to The Rook's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Action heal in car
Joshua9797 replied to Davis Welder's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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: -
Missing Mission Summary Picture in MP
Joshua9797 replied to kibaBG's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Masking a teleport
Joshua9797 replied to Melody_Mike's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
player suppression mod Suppress by Jokoho482 and LAxemann - An unforgiving player suppression mod
Joshua9797 replied to laxemann's topic in ARMA 3 - ADDONS & MODS: COMPLETE
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. -
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: