lkincheloe 12 Posted July 20, 2014 What you could do is run the code generator only server-side, then when the players find the laptop send the code over as a public variable. Then when a player inputs the code, is returned back in a bis_fnc_mp call to the server. If correct, disable the bomb and whatnot, if incorrect, KABOOM! Share this post Link to post Share on other sites
mech79 10 Posted July 21, 2014 laptop is also random as there are multiple on a mission Share this post Link to post Share on other sites
johan614 0 Posted August 2, 2014 (edited) In the dialog file (common.hpp) you are using the base class names instead of your own. This causes conflict with other scripts doing the same thing. Please update :) Edit: But I realise this might be a consequens on how dialogs are created in the game? Edited August 2, 2014 by johan614 investigated Share this post Link to post Share on other sites
mech79 10 Posted November 13, 2014 If using in MP each player can find a different code as a code is randomly placed for each player. The player that is defusing the bomb can not use a code another person has located he must use the one set up for them. It works great, but make sure someone else gets their own code in case you die. They wont be able to use yours as the bomb will explode. Share this post Link to post Share on other sites
CaptDaniels 10 Posted November 14, 2014 Really nice! One of the most detailed scripts I've seen for a while. Share this post Link to post Share on other sites
zagor64bz 1225 Posted November 29, 2016 Sorry to revamp an old post...but how do I remove the addAction from the bomb once defused? I put the addAction code on a object(device)..defused..task done..but I want the mission to continue, and I have removed the "endmission" part...but the object still show the "defuse the bomb2 prompt. Any help to this old fart? Share this post Link to post Share on other sites
snakeplissken 96 Posted November 30, 2016 Sorry to revamp an old post...but how do I remove the addAction from the bomb once defused? I put the addAction code on a object(device)..defused..task done..but I want the mission to continue, and I have removed the "endmission" part...but the object still show the "defuse the bomb2 prompt. Any help to this old fart? If you want to remove the object's action menu (pump), I did so. Name of the object (where to enter a password) Casebomb Within the INIT space of the object. Bomb = Casebomb addAction [("<t color='#06FF94'>" + ("Defuse the Bomb") + "</t>"),"DEFUSE\defuseAction.sqf","",1,true,true,"","(_target distance _this) < 3"]; On the trigger(on Act) that removes the menu Casebomb removeAction Bomb 2 Share this post Link to post Share on other sites
zagor64bz 1225 Posted November 30, 2016 Thank you Snake!!! 1 Share this post Link to post Share on other sites
ricoarma 5 Posted March 26, 2018 Hello, I open an old post.@cobra4v320, is it possible to no longer have the code, to cut the threads in a specific order? I know it's been a long time, but maybe since you changed / modified your basic script (still for the MP of course). thanks, and great script I like it. Share this post Link to post Share on other sites
Melody_Mike 127 Posted April 9, 2020 *Out of the depths of the forum underworld, I summon thee!* No but somewhat seriously, I am aware that the designer hasn't logged in since 2018. I want to state the this script still works as advertised, in multiplayer and dedicated servers. But I am about to modify the script to make it slightly more interesting, and was wondering if others could help me, seeing as I have next to zero experience in scripting. My aim: I would like the bomb to require both the correct code, and the correct wire, in order to disarm. As it stands now, the bomb disarms if you get either correct. I have been digging around in the script files, and I am pretty sure this can be easily fixed by inserting an extra global variable, with a check. The only two files that change the DEFUSE variable set up by init.sqf are fn_codeCompare: //Parameters private ["_code", "_inputCode"]; _code = [_this, 0, [], [[]]] call BIS_fnc_param; _inputCode = [_this, 1, [], [[]]] call BIS_fnc_param; //compare codes private "_compare"; _compare = [_code, _inputCode] call BIS_fnc_areEqual; if (_compare) then { cutText ["BOMB DEFUSED", "PLAIN DOWN"]; DEFUSED = true; playSound "button_close"; } else { cutText ["BOMB ARMED", "PLAIN DOWN"]; ARMED = true; playSound "button_wrong"; }; CODEINPUT = []; //Return Value _code -and fn_wireCompare: //Parameters private ["_wire","_cutWire", "_compare"]; _wire = [_this,0,"",[""]] call BIS_fnc_param; _cutWire = [_this,1,"",[""]] call BIS_fnc_param; //compare wires _compare = [_wire, _cutWire] call BIS_fnc_areEqual; if (_compare) then { cutText ["BOMB DEFUSED", "PLAIN DOWN"]; DEFUSED = true; playSound "button_close"; } else { cutText ["BOMB ARMED", "PLAIN DOWN"]; ARMED = true; playSound "button_wrong"; }; //Return Value _wire It's pretty straightforward: they make a comparison and set either the DEFUSED or ARMED variable to true. Obviously I could change their variables to DEFUSED_code and DEFUSED_wire, but where would I make the AND check to set DEFUSE = true? An Eden Editor trigger? An IF statement in initserver.sqf? Remember that this has to work in dedicated multiplayer, and I don't have spare players to test this. Appreciate you taking the time to read this. - MeM 1 Share this post Link to post Share on other sites
RCA3 581 Posted April 9, 2020 16 hours ago, Melody_Mike said: Obviously I could change their variables to DEFUSED_code and DEFUSED_wire With this principle in mind, look at fn_bombtimer.sqf: while {_time > 0 && !DEFUSED} do { And init.sqf: DEFUSED = false; ARMED = false; <snip> waitUntil {DEFUSED}; Might still not be enough though... 1 Share this post Link to post Share on other sites
Melody_Mike 127 Posted April 10, 2020 Hey bub, Thanks for the hints! With a few alterations, I got the mission to work, and have successfully tested it in multiplayer (dedicated). The bomb now only disarms when both the code and wire are correctly clicked. I have had to make minor changes to the init and the three functions. They're pretty short scripts. Should I just paste all the code here @RCA3 ? What's this forum's policy on sharing tweaks of other people's work? 1 Share this post Link to post Share on other sites
RCA3 581 Posted April 10, 2020 (edited) On 2/22/2014 at 9:37 AM, cobra4v320 said: Disclaimer: The same disclaimer as the previous author. Feel free to tweak the scripts to your needs, or make a better version. Just share with our community. 🙂 Glad you got it working (especially with just a few hints 😉). Cheers. edit: @Melody_Mike maybe just post the affected files in spoilers with a note of its effects (since it's still a bit of files). (Or a zip with the full script 🤩). Edited April 10, 2020 by RCA3 1 Share this post Link to post Share on other sites
Melody_Mike 127 Posted April 10, 2020 Okay, here goes. The altered bits are notated with MeM (any way I can set this in bold or colored type?). init.sqf: CODEINPUT = []; CODE = [(round(random 9)), (round(random 9)), (round(random 9)), (round(random 9)), (round(random 9)), (round(random 9))]; //6 digit code can be more or less WIRE = ["BLUE", "WHITE", "YELLOW", "GREEN"] call bis_fnc_selectRandom; DEFUSED_CODE = false; // MeM differentiate the variables for each defuse check DEFUSED_WIRE = false; DEFUSED = false; ARMED = false; codeHolder = [lAPTOP1, LAPTOP2, LAPTOP3, LAPTOP4] call BIS_fnc_selectRandom; codeHolder addAction [("<t color='#E61616'>" + ("The Code") + "</t>"),"DEFUSE\searchAction.sqf","",1,true,true,"","(_target distance _this) < 3"]; //Mission Task if (isServer) then { [ units defuseGrp, "Task_Defuse", ["Find the code and defuse the bomb before it explodes.", "Defuse the bomb.", "DEFUSE"], caseBomb, TRUE ] call BIS_fnc_taskCreate; }; //Briefing _diaryEntry = player createDiaryRecord ["Diary",["Situation","Assault the hangar, find the code on one of the laptops and defuse the bomb before it detonates."]]; // Hide helper arrows {hideObject _x} forEach allMissionObjects "Helper_Base_F"; //Hangar lights private ["_light","_lightPos"]; { _lightPos = _x; _light = "#lightpoint" createVehicleLocal (position _lightPos); _light setLightAmbient [0/255, 15/255, 15/255]; _light setLightColor [255/255, 215/255, 80/255]; _light setLightBrightness 1.0; _light attachTo [_lightPos, [0,0,0]]; } forEach [mrkLight1, mrkLight2, mrkLight3, mrkLight4]; MissionIntro = [] spawn { ["BIS_blackStart", false] call BIS_fnc_blackOut; playMusic "EventTrack02a_F_EPB"; [[["DEFUSE THE BOMB","<t align = 'center' shadow = '1' size = '1' font='PuristaBold'>%1</t><br/>"], ["Assault the hangar and search the laptops for the code.","<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>"], ["If you are detected the bomb will arm.","<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>"]],0,0,"<t color='#FFFFFFFF' align='center'>%1</t>"] spawn BIS_fnc_typeText; sleep 15; ["BIS_blackStart", true] call BIS_fnc_blackIn; }; waitUntil {scriptDone MissionIntro}; //Lightning Effects [] spawn { while {true} do { private ["_position","_height","_distance","_direction"]; _position = position player; _height = 50; _distance = 350; _direction = random 360; _position set [2, _height]; [_position, _distance, _direction] spawn BIS_fnc_thunder; sleep (30 + random 10); }; }; [] spawn { waitUntil {DEFUSED_CODE && DEFUSED_WIRE}; // MeM change condition for mission success ["Task_Defuse", "Succeeded"] call BIS_fnc_taskSetState; sleep 2; ["end1", true] call BIS_fnc_endMission; }; [] spawn { waitUntil {ARMED}; ["Task_Defuse", "Failed"] call BIS_fnc_taskSetState; sleep 10; ["LOSER", false] call BIS_fnc_endMission; }; fn_bombTimer.sqf: private ["_bomb", "_time"]; _bomb = [_this, 0, objNull, [objNull]] call BIS_fnc_param; _time = [_this, 1, 0, [0]] call BIS_fnc_param; //Validate parameters if (isNull _bomb) exitWith {"Object parameter must not be objNull. Accepted: OBJECT" call BIS_fnc_error}; // MeM check for both variables during bomb countdown while {_time > 0 && !DEFUSED_CODE && !DEFUSED_WIRE} do { _time = _time - 1; hintSilent format["Bomb Detonation: \n %1", [((_time)/60)+.01,"HH:MM"] call BIS_fnc_timetostring]; if (_time < 1) then { _blast = createVehicle ["HelicopterExploSmall", position _bomb, [], 0, "NONE"]; { if (_x distance _bomb <= 15) then {_x setDamage 1}; } forEach allUnits; }; if (ARMED) then { _time = 5; ARMED = false }; sleep 1; }; deleteVehicle _bomb; //Return Value _bomb fn_codeCompare.sqf: //Parameters private ["_code", "_inputCode"]; _code = [_this, 0, [], [[]]] call BIS_fnc_param; _inputCode = [_this, 1, [], [[]]] call BIS_fnc_param; //compare codes private "_compare"; _compare = [_code, _inputCode] call BIS_fnc_areEqual; if (_compare) then { cutText ["CODE ACCEPTED", "PLAIN DOWN"]; // MeM changed text to more appropriate DEFUSED_CODE = true; // MeM differentiate variable playSound "button_close"; execVM "DEFUSE\defuseAction.sqf"; // MeM keep bomb dialog open so you can still cut wires } else { cutText ["BOMB ARMED", "PLAIN DOWN"]; ARMED = true; playSound "button_wrong"; }; CODEINPUT = []; //Return Value _code fn_wireCompare.sqf: //Parameters private ["_wire","_cutWire", "_compare"]; _wire = [_this,0,"",[""]] call BIS_fnc_param; _cutWire = [_this,1,"",[""]] call BIS_fnc_param; //compare wires _compare = [_wire, _cutWire] call BIS_fnc_areEqual; if (_compare) then { cutText ["...SEEMS OKAY", "PLAIN DOWN"]; // MeM changed text to appropriate in progress DEFUSED_WIRE = true; // MeM differentiated the defused variable playSound "button_close"; execVM "DEFUSE\defuseAction.sqf"; // Keep dialog open so you can still enter the code if necessary } else { cutText ["BOMB ARMED", "PLAIN DOWN"]; ARMED = true; playSound "button_wrong"; }; //Return Value _wire Replace the contents of the script files with the above, and you are set. This was a fun first exercise in Arma scripting. Enjoy! 3 Share this post Link to post Share on other sites