Jump to content

Northup

Member
  • Content Count

    85
  • Joined

  • Last visited

  • Medals

Everything posted by Northup

  1. 1. Pelvis is misspelled. I'm surprised you didn't get an error. 2. Your first addaction had an invisible character that precluded it from running. If you copied it from here, that is probably where you got it. 3. Now it adds the addactions, however once you pick it up, the object loses it's addaction, as it is attached to the player. To solve this, you need to assign the second addaction to the caller, not the object, and remove it when the caller drops it. Example (tested): // Create the barrel on the server _crate = createVehicle ["Land_MetalBarrel_F", position helipad, [], 0, "NONE"]; _crate enableDynamicSimulation false; _crate addAction [ "<t color='#FFFF80'>Pickup</t>", { params ["_target", "_caller", "_actionId", "_arguments"]; _target attachTo [_caller, [0, 2, 1], "Pelvis"]; _caller addAction [ "<t color='#FFFF80'>Drop</t>", { params ["_target", "_caller", "_actionId", "_arguments"]; { detach _x; _x enableSimulationGlobal true; } forEach attachedObjects _caller; _caller removeAction _actionId; } ]; }, nil, 1.5, false, false, "", "true", 3, false, "", "" ];
  2. Welp, then that's why it doesn't work. How/Where is CP defined in your mission? I am assuming you have a param for it in description.ext. Whatever that param is, it's value has to be retrieved in the script that handles that param. One super duper easy way to see if/where/how this param value is applied elsewhere is to first located is to use notepad++, open description.ext, find the parameter you want to look into, select and copy it, hit ctrl+f, click the 'Find in Files' tab, paste it. Change the 'Directory' to your mission folder root and click the 'Find All' button. That will show you any references to that variable in any script present in your mission folder. If you don't see it, there's your issue. Below is example of a parameter being defined in description.ext and retrieved elsewhere. Description.ext: class Params { //Changes speed of holdaction that captures the flag class NUP_flagCapSpeed // THIS IS THE VARIABLE WE WILL RETRIEVE ELSEWHERE { title = "Flag Capture Speed"; values[] = {1, 10, 15, 30}; texts[] = {"1 second (Testing)", "10 seconds", "15 seconds", "30 seconds"}; default = 1; }; }; Then, in my holdAction script, I have this line: _duration = ["NUP_flagCapSpeed", 5] call BIS_fnc_getParamValue; And a bit further down in that same script: ... //Interrupt { params[ "_flag", "_caller" ]; _baseMarker = _flag getVariable "NUP_baseMarker"; [ _flag, 1 ] remoteExec [ "setFlagAnimationPhase", 0, format[ "capFlagPhase_%1", _baseMarker ] ]; _sideID = _flag getVariable "TER_flagSide"; _fileFlag = ["flag_csat_co", "flag_nato_co", "flag_aaf_co", "flag_fd_purple_co", "flag_white_co"] select (_sideID call BIS_fnc_sideID); _flag setFlagTexture format ["\a3\data_f\flags\%1.paa", _fileFlag]; }, [], _duration, // HERE IS THE PARAMVALUE FROM MISSION PARAMETERS, PASSED AS A LOCAL VARIABLE 1.5, false ] call BIS_fnc_holdActionAdd; Point is, something being present in the mission parameters doesn't matter much if there isn't another script retrieving the variable and doing something with it. Same thing applies to the 2x param. I am assuming that CP is your mission's currency. Any currency system is going to be mission specific, created for that mission. As far as Arma is concerned, currency doesn't exist and there is no built in currency system in Arma 3. Disabling player fatigue is easy enough, though from what I found with a quick Google search, fatigue is antiquated and it'd probably be better to disable player stamina. In description.ext, I'd add another param to the params section: class Params { //Changes speed of holdaction that captures the flag class NUP_flagCapSpeed { title = "Flag Capture Speed"; values[] = {1, 10, 15, 30}; texts[] = {"1 second (Testing)", "10 seconds", "15 seconds", "30 seconds"}; default = 1; }; class TAG_myNewPlayerStaminaParam // THIS IS THE NEW STAMINA VARIABLE WE WILL RETRIEVE IN ONPLAYERRESPAWN.SQF { title = "Player Stamina"; values[] = {true, false}; texts[] = {"enabled", "disabled"}; default = false; }; }; Then, in onPlayerRespawn.sqf: params ["_newUnit", "_oldUnit", "_respawn", "_respawnDelay"]; _staminaSetting = ["TAG_myNewPlayerStaminaParam", false] call BIS_fnc_getParamValue; _newUnit enableStamina _staminaSetting; So as you can see, it's a bit more involved than just selecting a value. Please post your code so that someone can help point you in the right direction.
  3. Derp. Youre right. My bad. Thanks for the correction @pierremgi
  4. If it's MP: this addAction ["Play Vietnam", {["Vietnam"] remoteExec ["playMusic", _caller];}]; I was wrong.
  5. Ok, so I figured it out. I wasn't paying close enough attention to the repair script. All of the titleTexts and hints need to be remote exec'd, and the script can just be called. [["<t color='#00ff00' size='2'>Repairing Damage...</t><br/>", "PLAIN", -1, true, true]] remoteExec ["titleText", owner _driver];
  6. Have a repair trigger. Trying to figure out how to remoteExec to client (driver) of the vehicle the repair script. Crude example: // Set trigger condition and statements _repairTrigger setTriggerStatements [ //"{_x isKindOf 'LandVehicle' || _x isKindOf 'Helicopter' && speed _x < 1} count thisList > 0", // Condition (testing cond. below.) "{(_x isKindOf 'LandVehicle' || _x isKindOf 'Helicopter') && speed _x < 1 && damage _x > 0} count thisList > 0",// Condition "call {_handle = [(thisList select 0), thisTrigger] call NUP_fnc_repairVehicle;}", // Activation "" // Deactivation (empty) ]; works fine in local hosted, not dedicated, obviously. Tried: " [(thisList select 0), thisTrigger] remoteExec ['NUP_fnc_repairVehicle', owner _x] ;", // Activation I'm just a tad stumped. Any takers?
  7. Yeah, a little titletext and a few of sleeps basically, in addition to rearming, repairing and refueling. I tried the original and had no result. Assumed it wasn't firing on player. 1. The trigger itself is part of a composition spawned in with Larrow's Eden Comp Spawn, which is called in zoneSelect. In initSafezone, I snag and update the trigger, and call addVehicleServices, where I apply setTriggerActivation and setTriggerStatements posted above. It's a bit complex. InitSever>zoneSelect>LARs_fnc_spawnComp>initSafezone>addVehicleServices. //get the repair trigger private _triggerList = _flag nearObjects ["EmptyDetector", 150]; // Filter only triggers with names starting with "NUP_repairTrigger_" private _repairTriggers = _triggerList select { (toLower (name _x) find "nup_repairtrigger_") isEqualTo 0 }; // Call NUP_fnc_addVehicleServices for each repair trigger { private _repairTrigger = _x; // Ensure the trigger name matches private _triggerName = toLower (name _repairTrigger); if (_triggerName find "nup_repairtrigger_" isEqualTo 0) then { // Call NUP_fnc_addVehicleServices passing the side and the repair trigger [_repairTrigger] call NUP_fnc_addVehicleServices; }; } forEach _repairTriggers; 2. I added a pastebin link to a previous post maybe 30 seconds before I got the notification for this. https://pastebin.com/hAyCkrfL Mission Link: https://drive.google.com/file/d/14ETgJGqbO3z3HL6CC-n4hwb-cGThFv7E/view?usp=sharing BTW Happy Thanksgiving @pierremgi.
  8. _repairTrigger setTriggerActivation ["ANY", "PRESENT", true]; Tried both of those. Neither seemed to work. The mission is MP. NUP_fnc_repairVehicle: https://pastebin.com/hAyCkrfL
  9. Maybe something like: // Initial values private _startingOvercast = 0.3; private _increment = 0.0208; // Increase per step private _interval = 300; // 5 minutes in seconds // Skip 24 hours to simulate mission start skipTime -24; // Set initial overcast to _startingOvercast (0.3) over 24 hours (86400 seconds) [86400, _startingOvercast] remoteExec ["setOvercast", 0, true]; // Skip time forward 24 hours to make sure weather is applied skipTime 24; // Sync client weather to server 0 = 0 spawn {sleep 0.1; simulWeatherSync;}; // Overcast adjustment loop [_startingOvercast, _increment] spawn { params ["_startingOvercast", "_increment"]; for "_i" from 0 to 23 do { // 24 updates over 2 hours private _targetOvercast = _startingOvercast + (_i * _increment); // Set overcast to the calculated target value on all clients [0, _targetOvercast] remoteExec ["setOvercast", 0, true]; // Apply to both server and clients forceWeatherChange; sleep 300; // Wait 5 minutes before the next update }; }; remoteExecing overcast on JIP since syncing is broken. rest of changes are made with info on wiki: 1: Arma 3's volumetric clouds cannot be instantly changed (it would take up to a few seconds to do a full recompute). Therefore, 0 setOvercast 0 will not have the desired effect. You can use skipTime to get to the desired cloud coverage. NOTE: To get instant, seamless overcast change to overcast 1 advance the time 24 hours with skipTime while setting overcast transition time to 86400 seconds (24 hours) - Killzone_Kid (12:08, 15 August 2013) 2: With removal of simulSetHumidity, in order to add instant cloud cover, execute simulWeatherSync with delay (for now).
  10. Northup

    Make radio play a song

    Description.ext: class CfgSounds { sounds[] = {}; class Track01 { name = "Track01"; sound[] = {"\Music\song1.ogg", db+10, 1.0}; titles[] = { 0, "*HEADBANGING*" }; // subtitles titlesFont = "LCD14"; // OFP:R - titles font family titlesSize = 0.05; // OFP:R - titles font size forceTitles = 1; // Arma 3 - display titles even if global show titles option is off (1) or not (0) titlesStructured = 1; // Arma 3 - treat titles as Structured Text (1) or not (0) }; }; In init of radio object: this say3D "Track01"; Example Mission: https://drive.google.com/file/d/15NAzb88tuGvRh8ZK2O4LOy8m0z9Dgcv6/view?usp=sharing Could also name the radio "radio1" and, in initServer: radio1 say3D "Track01"; Just remember to remove the line from radio1's init if doing it that way.
  11. _weather = ["Weather", -1] call BIS_fnc_getParamValue; if (_weather == -1) exitWith { hint "Weather parameter not found!"; }; switch (_weather) do { case 0: { skipTime -24; 0 setOvercast 0; //clear sky skipTime 24; [0,0] remoteExec ["setOvercast", -2, true]; //remoteExec for JIP 0 setRain 0; 0 setFog 0; forceWeatherChange; [1] remoteExec ["skipTime", -2, true]; //remoteExec for JIP [-1] remoteExec ["skipTime", -2, true]; //remoteExec for JIP 999999 setRain 0; 999999 setFog 0; 0 = [] spawn { sleep 0.1; simulWeatherSync; }; //To force instant cloud cover }; case 1: { skipTime -24; 86400 setOvercast 0.5; skipTime 24; [0,0.5] remoteExec ["setOvercast", -2, true]; 0 setRain 0; 0 setFog 0; forceWeatherChange; [1] remoteExec ["skipTime", -2, true]; [-1] remoteExec ["skipTime", -2, true]; 999999 setRain 0; 999999 setFog 0; 0 = [] spawn { sleep 0.1; simulWeatherSync; }; }; case 2: { skipTime -24; 86400 setOvercast 0.6; skipTime 24; [0,0.6] remoteExec ["setOvercast", -2, true]; 0 setRain 0; 0 setFog 0.1; forceWeatherChange; [1] remoteExec ["skipTime", -2, true]; [-1] remoteExec ["skipTime", -2, true]; 999999 setRain 0; 999999 setFog 0.1; 0 = [] spawn { sleep 0.1; simulWeatherSync; }; }; case 3: { skipTime -24; 86400 setOvercast 1; skipTime 24; [0,1] remoteExec ["setOvercast", -2, true]; 0 setRain 0.5; 0 setFog 0; forceWeatherChange; [1] remoteExec ["skipTime", -2, true]; [-1] remoteExec ["skipTime", -2, true]; 999999 setFog 0; 0 = [] spawn { sleep 0.1; simulWeatherSync; }; }; }; The above seems to work instantly for me. Haven't tested in dedicated.
  12. The following code works, except for the music being played. No errors, just silence. What music plays is contingent upon if a player's side matches _winingside. I've tried not remote execing, same thing. // Display the ending message without background { private _playerSide = side _x; private _playerID = owner _x; // Get the player's ID if (_playerSide == _winningSide) then { titleText [_endingWinMessage, "PLAIN", -1, true, true]; // playMusic ["LeadTrack01_F_Bootcamp", 132]; ["LeadTrack01_F_Bootcamp", 132] remoteExec ["playMusic"]; } else { titleText [_endingLoseMessage, "PLAIN", -1, true, true]; //playMusic "BackgroundTrack03_F_EPC"; ["BackgroundTrack03_F_EPC"] remoteExec ["playMusic"]; }; } forEach allPlayers; Not sure where I am going wrong.
  13. waitUntil {getClientStateNumber == 10}; https://community.bistudio.com/wiki/getClientStateNumber
  14. Northup

    RemoteExec a Function

    You can change how it is remoteExec'd. params remoteExec [order, targets, JIP] Params are the array of variables that are passed to the order. Order is the command or function name (the what) you want to execute. Target is the who. (optional). JIP is a boolean, so true/false (also optional). If true, a unique JIP ID is generated and the remoteExec statement is added to the JIP queue from which it will be executed for every JIP (player who joins while the mission is in progress). We want the who, so Target: 0: the order will be executed globally, i.e. on the server and every connected client, including the machine where remoteExec originated 2: the order will only be executed on the server - is both dedicated and hosted server. See for more info Other number: the order will be executed on the machine where clientOwner matches the given number Negative number: the effect is inverted: -2 means every client but not the server, -12 means the server and every client, except for the client where clientOwner returns 12. In the event that you only want it executed on players and not the server: ["end1", true , 3, true, true, true] remoteExec ["VN_fnc_endMission", -2]; If you wanted that to also apply to JIP: ["end1", true , 3, true, true, true] remoteExec ["VN_fnc_endMission", -2, true];
  15. You'd have to go to the discord for KOTH. Afaik, you're limited to a single provider at this point, as all legit KOTH servers are hosted by the same provider. You'll get access to something you can rcon into, but what you can do is heavily restricted.
  16. Northup

    Safezone

    Full script: https://pastebin.com/knHsGNJs Thanks again!
  17. I am trying to implement a safezone. Rules of safezone: Players who spawn inside safezone are invulnerable until they leave the safezone trigger. If they return there is a 10 second delay before they are invincible again. I managed to get that part working. // Create trigger centered on the safezone marker for vehicles _safezoneTriggerVehicle = createTrigger ["EmptyDetector", getPos _logic]; _triggerSize = [(_markerSize select 0), (_markerSize select 1), 0, false, 100]; _safezoneTriggerVehicle setTriggerArea _triggerSize; _safezoneTriggerVehicle setTriggerActivation ["ANY", "PRESENT", true]; _safezoneTriggerVehicle setTriggerStatements [ "this && {count (thisList select {alive _x && (_x isKindOf 'LandVehicle' || _x isKindOf 'Air')}) > 0}", " { if (_x isKindOf 'LandVehicle' || _x isKindOf 'Air') then { _x allowDamage false; hint format ['%1 is now invulnerable', _x]; }; } forEach (thisList select {alive _x && (_x isKindOf 'LandVehicle' || _x isKindOf 'Air')}); ", " { if (_x isKindOf 'LandVehicle' || _x isKindOf 'Air') then { _x allowDamage true; hint format ['%1 is now vulnerable', _x]; }; } forEach (thisList select {alive _x && (_x isKindOf 'LandVehicle' || _x isKindOf 'Air')}); " ]; However, I also need this to apply to players who get in vehicles, any vehicles spawned by the player (not yet implemented), as well as any vehicle being driven by a player. I've tried the following, but the vehicle and player don't become invincible again after reentering the trigger: // Create trigger centered on the safezone marker for vehicles _safezoneTriggerVehicle = createTrigger ["EmptyDetector", getPos _logic]; _triggerSize = [(_markerSize select 0), (_markerSize select 1), 0, false, 100]; _safezoneTriggerVehicle setTriggerArea _triggerSize; _safezoneTriggerVehicle setTriggerActivation ["ANY", "PRESENT", true]; _safezoneTriggerVehicle setTriggerStatements [ "this && {count (thisList select {alive _x && (_x isKindOf 'LandVehicle' || _x isKindOf 'Air')}) > 0}", " { if (_x isKindOf 'LandVehicle' || _x isKindOf 'Air') then { _x allowDamage false; hint format ['%1 is now invulnerable', _x]; }; } forEach (thisList select {alive _x && (_x isKindOf 'LandVehicle' || _x isKindOf 'Air')}); ", " { if (_x isKindOf 'LandVehicle' || _x isKindOf 'Air') then { _x allowDamage true; hint format ['%1 is now vulnerable', _x]; }; } forEach (thisList select {alive _x && (_x isKindOf 'LandVehicle' || _x isKindOf 'Air')}); " ]; I assume its something to do with the changing state of the player on the vehicle, but am not sure. I have combed through forums over the last 2 days, and all I find are old, generally outdated examples. Same with youtube. Any guidance would be appreicated: full script: https://pastebin.com/AExnxN2h
  18. Northup

    Remote Exec Play music?

    Works! Made some small changes, but it finally works. THANKS! BIS_endText = { private["_blocks","_block","_blockCount","_blockNr","_blockArray","_blockText","_blockTextF","_blockTextF_","_blockFormat","_formats","_inputData","_processedTextF","_char","_cursorBlinks"]; _blockCount = count _this; _invisCursor = "<t color ='#00000000' shadow = '0'>_</t>"; // Get screen center position using safezone private _safeZoneX = (safezoneX + safezoneW / 2); private _safeZoneY = (safezoneY + safezoneH / 2); // Process the input data _blocks = []; _formats = []; { _inputData = _x; _block = [_inputData, 0, "", [""]] call BIS_fnc_param; _format = [_inputData, 1, "<t align = 'center' shadow='1' size='2.0'>%1</t><br/>", [""]] call BIS_fnc_param; // Convert strings into array of chars _blockArray = toArray _block; { _blockArray set [_forEachIndex, toString [_x]] } forEach _blockArray; _blocks = _blocks + [_blockArray]; _formats = _formats + [_format]; } forEach _this; // Do the printing _processedTextF = ""; { _blockArray = _x; _blockNr = _forEachIndex; _blockFormat = _formats select _blockNr; _blockText = ""; _blockTextF = ""; _blockTextF_ = ""; { _char = _x; _blockText = _blockText + _char; _blockTextF = format[_blockFormat, _blockText + _invisCursor]; _blockTextF_ = format[_blockFormat, _blockText + "_"]; // Print the output at the center of the screen using safezone [(_processedTextF + _blockTextF_), 0, _safeZoneY, 35, 0, 0, 90] spawn BIS_fnc_dynamicText; playSoundUI ["a3\missions_f\data\sounds\click.wss", 0.25]; sleep 0.08; [(_processedTextF + _blockTextF), 0, _safeZoneY, 35, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep 0.02; } forEach _blockArray; if (_blockNr + 1 < _blockCount) then { _cursorBlinks = 5; } else { _cursorBlinks = 15; }; for "_i" from 1 to _cursorBlinks do { [_processedTextF + _blockTextF_, 0, _safeZoneY, 35, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep 0.08; [_processedTextF + _blockTextF, 0, _safeZoneY, 35, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep 0.02; }; // Store finished block _processedTextF = _processedTextF + _blockTextF; // Do not clear the screen, to keep the text visible //["", _safeZoneX, _safeZoneY, 35, 0, 0, 90] spawn BIS_fnc_dynamicText; } forEach _blocks; }; // Example usage [ ["MISSION COMPLETE","<t align='center' shadow='1' size='2.0'>%1</t><br/>"] ] spawn BIS_endText; private _playerSide = side player; if (_playerSide == Winner) then { // Display win message with typewriter effect [ [WinMessage, "<t align='center' shadow='1' size='1.0'>%1</t><br/>"] ] spawn BIS_endText; playMusic ["LeadTrack01_F_Bootcamp", 132]; 0 fadeMusic 2; } else { // Display lose message with typewriter effect [ [LoseMessage, "<t align='center' shadow='1' size='1.0'>%1</t><br/>"] ] spawn BIS_endText; playMusic "BackgroundTrack03_F_EPC"; 0 fadeMusic 2; }; _start = diag_tickTime; [0, 1, true, false] call NUP_fnc_cinematicBorder; // 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; // Move the camera over 30 seconds _camera camSetPos _endPos; _camera camCommit 30; waitUntil { diag_tickTime - _start >= 25 }; 5 fadeMusic 0; // Wait until the camera has finished its 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 endMission "end"; Edit: A separate script appears to not be necessary. By storing the above in a local variable in the actual endMission function, (_NUP_endSequence), I can then spawn that via remoteExec. So far, seems to work! "_NUP_endSequence" remoteExec ["spawn", 0]; // remoteExec to every player locally
  19. Northup

    Remote Exec Play music?

    I haven't bothered testing singleplayer. Perhaps it's how I am testing? I know there's a way to test as if it were dedicated server, however for the time being I've been testing in a local server environment. Mission is intended to be ran on dedi, but can run local host. Just PVP, no AI. Only mods are 3den Enhanced, CompoT_dev and 3DEN Create as Simple Object. None create any dependencies for players. Edit: I hadn't tried testing it that way, only by executing the gameplay loop. When doing it with console, not only do I NOT hear music, but the environmental sounds (rain, etc) stop, and this cascades into the next loading of the mission: i.e., no music OR environmental effects. Very weird!
  20. Northup

    Remote Exec Play music?

    No change. Mission file is below. For now, keeping everything in fn_endMission. https://drive.google.com/file/d/1_4kvOg5A8Bj3XzzvSBeYdB1OM5Khq6Mp/view?usp=sharing
  21. Northup

    Remote Exec Play music?

    private _playerSide = side player; if (_playerSide == WinningSide) then { titleText [WinMessage, "PLAIN", -1, true, true]; playMusic ["LeadTrack01_F_Bootcamp", 132]; } else { titleText [LoseMessage, "PLAIN", -1, true, true]; playMusic "BackgroundTrack03_F_EPC"; }; Seems to. I've changed it. Will report back if anything changes.
  22. Northup

    Remote Exec Play music?

    1. Assuming you mean playMusic "RadioAmbient1"; and hitting local exec,YES. playMusic ["LeadTrack01_F_Bootcamp", 132] also works. 2. LOL. I had someone in the discord ask me the same thing. Yes, I did. I have intromusic that plays on OnplayerRespawn that works fine. 3.I have 2 functions: //NUP\NUP_flagCapture\functions\NUP_fnc_updateScores.sqf { private _side = _x select 1; switch (_side) do { case west: { NUP_points_BLUFOR = NUP_points_BLUFOR + 1; }; case east: { NUP_points_OPFOR = NUP_points_OPFOR + 1; }; case independent: { NUP_points_INDFOR = NUP_points_INDFOR + 1; }; case civilian: { NUP_points_CIV = NUP_points_CIV + 1; }; }; } forEach (missionNamespace getVariable ["NUP_flagArray", []]); diag_log format ["Blu score: %1, Opf score: %2, Ind score: %3, Civ score: %4", NUP_points_BLUFOR, NUP_points_OPFOR, NUP_points_INDFOR, NUP_points_CIV]; private _winningSide = []; // Array to store winning sides private _maxScore = NUP_points_maxScore; diag_log format ["_maxscore: %1", _maxScore]; // Determine winning sides if (NUP_points_BLUFOR >= _maxScore) then { _winningSide pushBack west; }; if (NUP_points_OPFOR >= _maxScore) then { _winningSide pushBack east; }; if (NUP_points_INDFOR >= _maxScore) then { _winningSide pushBack independent; }; if (NUP_points_CIV >= _maxScore) then { _winningSide pushBack civilian; }; // Check if any side has reached the maximum score and trigger end mission if so if (count _winningSide == 1) then { [_winningSide] call NUP_fnc_endMission; "endMusic.sqf" remoteExec ["execVM",0]; }; // NUP_fnc_endMission: params ["_winningSide"]; WinningSide = _winningSide select 0; private _winnerOutcome = switch (WinningSide) do { case west: { "BLUFOR WINS!" }; case east: { "OPFOR WINS!" }; case independent: { "INDEPENDENT WINS!" }; case civilian: { "CIVILIANS WIN!" }; }; WinMessage = format ["MISSION ACCOMPLISHED! %1", _winnerOutcome]; LoseMessage = format ["MISSION FAILED! %1 ", _winnerOutcome]; // 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 1; _camera camCommit 0; // Start the cinematic borders [0, 0.5, false, true] call BIS_fnc_cinemaBorder; // Move the camera over 30 seconds _camera camSetPos _endPos; _camera camCommit 30; publicVariable "WinningSide"; publicVariable "LoseMessage"; publicVariable "WinMessage"; // 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", false] call BIS_fnc_endMission; and in initServer: 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; [] spawn { while {true} do { [] call NUP_fnc_updateScores; sleep NUP_scoring_interval; }; }; Both are registered. class NUP_flagCapture { tag = "NUP"; class flagCapture { file = "NUP\NUP_flagCapture\functions"; class initSafezone {}; class initFlag {}; class playerMarkers {}; class captureFlag {}; class addFlagHoldAction {}; class getFlagSupplies {}; class updateFlagSupplyActions {}; class addMedicalHoldAction {}; class addEquipmentHoldAction {}; class addRespawnPosition {}; class addVehicleServices {}; class cinematicBorder {}; class updateScores {}; class endMission {}; }; };
×